fpetkovski opened a new pull request, #27421:
URL: https://github.com/apache/datafusion/pull/27421

   ## Which issue does this PR close?
   
   No existing issue. Related to the field-aware schema adaptation introduced 
in #20269.
   
   ## Rationale for this change
   
   Parquet scans can lose Bloom-filter pruning when a non-nullable dictionary 
column is exposed through a nullable table schema. Schema adaptation correctly 
inserts a cast, but comparison simplification cannot remove it when the literal 
already has the same dictionary type. Bloom-filter predicate extraction then 
fails to recognize the column equality, leaving otherwise prunable row groups 
to be read and filtered.
   
   ## What changes are included in this PR?
   
   Accept dictionary literals unchanged when the requested type is identical, 
allowing the existing comparison simplifier to remove the value-preserving 
cast. This does not revert field-aware schema adaptation or change projected 
nullability. Other dictionary conversions are unchanged.
   
   ## What is the testing strategy for this PR?
   
   - A literal-conversion test covers dictionary key widths, string/integer 
values, and nulls, checking results against Arrow's cast kernel.
   - A Parquet scan regression test covers matching and differing schema 
nullability, present and absent values, Bloom pruning counters, and 
preservation of the output schema. Statistics are disabled to isolate Bloom 
pruning.
   
   Both new tests fail without the fix. All 552 library tests in 
`datafusion-expr-common` and `datafusion-datasource-parquet` pass with it. 
Full-workspace Clippy passes with warnings denied. The extended workspace test 
build exhausted local disk space; full-suite validation is deferred to CI.
   
   ## Are there any user-facing changes?
   
   Restores Bloom-filter pruning for affected dictionary equality predicates. 
Query results and output schemas are unchanged; no API changes.
   
   AI-assisted implementation and testing; opened as a draft for author review.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to