LuciferYang opened a new pull request, #13552:
URL: https://github.com/apache/gluten/pull/13552

   ## What changes are proposed in this pull request?
   
   `SparkExprToSubfieldFilterParser::leafCallToSubfieldFilter` only recognized 
a column on the left side of a comparison, so a predicate such as `100 > id` 
was never turned into a subfield filter and could not be used for row group 
pruning. Spark does not rewrite it, and Gluten passes the Catalyst filter to 
the native scan as is.
   
   When the left operand is not a column and the right one is, the comparison 
is now rewritten with the operands swapped and the operator mirrored (`100 > 
id` becomes `id < 100`) and handled as before. This covers `=`, `<`, `<=`, `>` 
and `>=`. Results do not change, since the predicate was already evaluated as a 
remaining filter.
   
   Fixes #13546.
   
   ## How was this patch tested?
   
   Added `Literal-on-left comparison prunes Parquet row groups` to 
`VeloxMetricsSuite`. It writes a sorted Parquet file with 10 row groups and 
checks that five literal-on-left predicates skip and read the same row groups 
as their mirrored forms. Before this change, `100 > id` read all 10 row groups 
while `id < 100` skipped 9.
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   Yes. Generated-by: Claude Opus.
   


-- 
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