You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/12/19 18:23:09 UTC
[PR] Minor: port last test from parquet.rs [arrow-datafusion]
alamb opened a new pull request, #8587:
URL: https://github.com/apache/arrow-datafusion/pull/8587
## Which issue does this PR close?
Follow on to https://github.com/apache/arrow-datafusion/pull/8560
Related to https://github.com/apache/arrow-datafusion/issues/8206.
## Rationale for this change
While porting tests in parquet.rs to sqllogictests @hiltontj noticed there was a disabled test that could be ported.
The test predates most of DataFusion / the parquet crate's ability to read structured data / arrow-rs's ability to print it so it was somewhat akward in its original form. Given the better support now things are in much better shape
## What changes are included in this PR?
1. port final test and remove parquet.rs module
## Are these changes tested?
all tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Minor: port last test from parquet.rs [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #8587:
URL: https://github.com/apache/arrow-datafusion/pull/8587
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Minor: port last test from parquet.rs [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #8587:
URL: https://github.com/apache/arrow-datafusion/pull/8587#discussion_r1431832754
##########
datafusion/core/tests/sql/parquet.rs:
##########
@@ -1,91 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-use datafusion_common::cast::{as_list_array, as_primitive_array, as_string_array};
-
-use super::*;
-
-#[tokio::test]
-#[ignore = "Test ignored, will be enabled as part of the nested Parquet reader"]
-async fn parquet_list_columns() {
- let ctx = SessionContext::new();
- let testdata = datafusion::test_util::parquet_test_data();
- ctx.register_parquet(
- "list_columns",
- &format!("{testdata}/list_columns.parquet"),
- ParquetReadOptions::default(),
- )
- .await
- .unwrap();
-
- let schema = Arc::new(Schema::new(vec![
- Field::new_list(
- "int64_list",
- Field::new("item", DataType::Int64, true),
- true,
- ),
- Field::new_list("utf8_list", Field::new("item", DataType::Utf8, true), true),
- ]));
-
- let sql = "SELECT int64_list, utf8_list FROM list_columns";
- let dataframe = ctx.sql(sql).await.unwrap();
- let results = dataframe.collect().await.unwrap();
-
- // int64_list utf8_list
- // 0 [1, 2, 3] [abc, efg, hij]
- // 1 [None, 1] None
- // 2 [4] [efg, None, hij, xyz]
-
- assert_eq!(1, results.len());
- let batch = &results[0];
- assert_eq!(3, batch.num_rows());
- assert_eq!(2, batch.num_columns());
- assert_eq!(schema, batch.schema());
-
- let int_list_array = as_list_array(batch.column(0)).unwrap();
- let utf8_list_array = as_list_array(batch.column(1)).unwrap();
-
- assert_eq!(
Review Comment:
This equality check predates the ability to print out ListArrays
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Minor: port last test from parquet.rs [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #8587:
URL: https://github.com/apache/arrow-datafusion/pull/8587#issuecomment-1865119603
Thank you for the review @comphead
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org