Skip to content

Commit

Permalink
Consolidate ParquetExec tests in parquet_exec integration test (#…
Browse files Browse the repository at this point in the history
…4130)

* Consolidate `ParquetExec` tests in `parquet_exec` integration test

* improve comment
  • Loading branch information
alamb authored Nov 8, 2022
1 parent 175adbd commit ebc279c
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 4 deletions.
2 changes: 2 additions & 0 deletions datafusion/core/src/physical_plan/file_format/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,8 @@ pub async fn plan_to_parquet(

#[cfg(test)]
mod tests {
// See also `parquet_exec` integration test

use super::*;
use crate::config::ConfigOptions;
use crate::datasource::file_format::parquet::test_util::store_parquet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ async fn single_file_small_data_pages() {

// TestCase::new(&test_parquet_file)
// .with_name("selective")
// // predicagte is chosen carefully to prune pages 0, 1, 2, 3, 4
// // predicate is chosen carefully to prune pages 0, 1, 2, 3, 4
// // pod = 'iadnalqpdzthpifrvewossmpqibgtsuin'
// .with_filter(col("pod").eq(lit("iadnalqpdzthpifrvewossmpqibgtsuin")))
// .with_pushdown_expected(PushdownExpected::Some)
Expand All @@ -291,7 +291,7 @@ async fn single_file_small_data_pages() {
// page 5: DLE:RLE RLE:RLE VLE:RLE_DICTIONARY ST:[min: 1970-01-01T00:00:00.000000000, max: 1970-01-01T00:00:00.005330944, num_nulls not defined] CRC:[none] SZ:12601 VC:7739
TestCase::new(&test_parquet_file)
.with_name("selective")
// predicagte is chosen carefully to prune pages
// predicate is chosen carefully to prune pages 1, 2, 4, and 5
// time > 1970-01-01T00:00:00.004300000
.with_filter(col("time").gt(lit_timestamp_nano(4300000)))
.with_pushdown_expected(PushdownExpected::Some)
Expand Down
21 changes: 21 additions & 0 deletions datafusion/core/tests/parquet/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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.

//! Parquet integration tests
mod filter_pushdown;
mod page_pruning;
mod row_group_pruning;
File renamed without changes.
19 changes: 19 additions & 0 deletions datafusion/core/tests/parquet_exec.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 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.

/// Run all tests that are found in the `parquet` directory
mod parquet;
2 changes: 1 addition & 1 deletion datafusion/core/tests/sql/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ async fn sort_empty() -> Result<()> {
#[tokio::test]
async fn sort_with_lots_of_repetition_values() -> Result<()> {
let ctx = SessionContext::new();
let filename = "tests/parquet/repeat_much.snappy.parquet";
let filename = "tests/parquet/data/repeat_much.snappy.parquet";

ctx.register_parquet("rep", filename, ParquetReadOptions::default())
.await?;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/tests/sql/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async fn fixed_size_binary_columns() {
let ctx = SessionContext::new();
ctx.register_parquet(
"t0",
"tests/parquet/test_binary.parquet",
"tests/parquet/data/test_binary.parquet",
ParquetReadOptions::default(),
)
.await
Expand Down

0 comments on commit ebc279c

Please sign in to comment.