From d77d71ceb47726ebefec853b66514f92ad141fd2 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 1 Nov 2022 12:59:39 -0400 Subject: [PATCH] Test page index filtering in parquet integration test --- .../core/tests/parquet_filter_pushdown.rs | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/datafusion/core/tests/parquet_filter_pushdown.rs b/datafusion/core/tests/parquet_filter_pushdown.rs index cb3f427266e0..2c0d75cc20be 100644 --- a/datafusion/core/tests/parquet_filter_pushdown.rs +++ b/datafusion/core/tests/parquet_filter_pushdown.rs @@ -341,32 +341,33 @@ impl<'a> TestCase<'a> { assert_eq!(no_pushdown, pushdown_and_reordering); - // page index filtering is not correct: - // https://github.com/apache/arrow-datafusion/issues/4002 - // when it is fixed we can add these tests too - - // let page_index_only = self - // .read_with_options( - // ParquetScanOptions { - // pushdown_filters: false, - // reorder_filters: false, - // enable_page_index: true, - // }, - // ) - // .await; - //assert_eq!(no_pushdown, page_index_only); - - // let pushdown_reordering_and_page_index = self - // .read_with_options( - // ParquetScanOptions { - // pushdown_filters: false, - // reorder_filters: false, - // enable_page_index: true, - // }, - // ) - // .await; - - //assert_eq!(no_pushdown, pushdown_reordering_and_page_index); + let page_index_only = self + .read_with_options( + ParquetScanOptions { + pushdown_filters: false, + reorder_filters: false, + enable_page_index: true, + }, + // pushdown is off so no pushdown is expected + PushdownExpected::None, + filter, + ) + .await; + assert_eq!(no_pushdown, page_index_only); + + let pushdown_reordering_and_page_index = self + .read_with_options( + ParquetScanOptions { + pushdown_filters: true, + reorder_filters: true, + enable_page_index: true, + }, + self.pushdown_expected, + filter, + ) + .await; + + assert_eq!(no_pushdown, pushdown_reordering_and_page_index); } /// Reads data from a test parquet file using the specified scan options