This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new b3ad9a89a5 [regression] Error with adaptive predicate pushdown: 
"Invalid offset in sparse column chunk data: 754, no matching page found." 
(#9301)
b3ad9a89a5 is described below

commit b3ad9a89a5f5b7a4ef0d4635425ec5dd4ac9621f
Author: Kosta Tarasov <[email protected]>
AuthorDate: Fri Jan 30 08:20:32 2026 -0500

    [regression] Error with adaptive predicate pushdown: "Invalid offset in 
sparse column chunk data: 754, no matching page found." (#9301)
    
    # Which issue does this PR close?
    
    <!--
    We generally require a GitHub issue to be filed for all bug fixes and
    enhancements and this helps us generate change logs for our releases.
    You can link an issue to this PR using the GitHub syntax.
    -->
    
    - Closes #9239.
    
    # Rationale for this change
    
    Check issue
    <!--
    Why are you proposing this change? If this is already explained clearly
    in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand
    your changes and offer better suggestions for fixes.
    -->
    
    # What changes are included in this PR?
    
    Added a copy of `override_selector_strategy_if_needed` to the filter
    application stage.
    
    Now if we use mask selection, and there are skipped pages in predicate
    projection we enforce RLE selection.
    <!--
    There is no need to duplicate the description in the issue here but it
    is sometimes worth providing a summary of the individual changes in this
    PR.
    -->
    
    # Are these changes tested?
    
    Yes, using #9243
    <!--
    We typically require tests for all PRs in order to:
    1. Prevent the code from being accidentally broken by subsequent changes
    2. Serve as another way to document the expected behavior of the code
    
    If tests are not included in your PR, please explain why (for example,
    are they covered by existing tests)?
    -->
    
    # Are there any user-facing changes?
    
    <!--
    If there are user-facing changes then we may require documentation to be
    updated before approving the PR.
    
    If there are any breaking changes to public APIs, please call them out.
    -->
    
    ---------
    
    Co-authored-by: Andrew Lamb <[email protected]>
---
 parquet/src/arrow/async_reader/mod.rs                |  2 --
 parquet/src/arrow/push_decoder/reader_builder/mod.rs | 10 ++++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/parquet/src/arrow/async_reader/mod.rs 
b/parquet/src/arrow/async_reader/mod.rs
index cce6c22c60..7aa1ea3b6f 100644
--- a/parquet/src/arrow/async_reader/mod.rs
+++ b/parquet/src/arrow/async_reader/mod.rs
@@ -2320,8 +2320,6 @@ mod tests {
     /// Regression test for adaptive predicate pushdown attempting to read 
skipped pages.
     /// Related issue: https://github.com/apache/arrow-rs/issues/9239
     #[tokio::test]
-    /// TODO: Remove should_panic once the bug is fixed
-    #[should_panic(expected = "Invalid offset in sparse column chunk data")]
     async fn test_predicate_pushdown_with_skipped_pages() {
         use arrow_array::TimestampNanosecondArray;
         use arrow_schema::TimeUnit;
diff --git a/parquet/src/arrow/push_decoder/reader_builder/mod.rs 
b/parquet/src/arrow/push_decoder/reader_builder/mod.rs
index 61a244589c..919f94c892 100644
--- a/parquet/src/arrow/push_decoder/reader_builder/mod.rs
+++ b/parquet/src/arrow/push_decoder/reader_builder/mod.rs
@@ -437,6 +437,16 @@ impl RowGroupReaderBuilder {
                     .with_parquet_metadata(&self.metadata)
                     .build_array_reader(self.fields.as_deref(), 
predicate.projection())?;
 
+                // Prepare to evaluate the filter.
+                // Note: first update the selection strategy to properly 
handle any pages
+                // pruned during fetch
+                plan_builder = override_selector_strategy_if_needed(
+                    plan_builder,
+                    predicate.projection(),
+                    self.row_group_offset_index(row_group_idx),
+                );
+                // `with_predicate` actually evaluates the filter
+
                 plan_builder =
                     plan_builder.with_predicate(array_reader, 
filter_info.current_mut())?;
 

Reply via email to