yashmayya opened a new pull request, #18995:
URL: https://github.com/apache/pinot/pull/18995

   On Calcite 1.40, a multistage query with mutually exclusive predicates on 
the same map key (e.g. `WHERE (attributes['k'] = 'a' OR attributes['k'] = 'b') 
AND attributes['k'] = 'c'`) failed at runtime with `Unsupported function: 
ITEM`. The contradictory predicates were only reduced to `false` in the 
post-logical phase (`FILTER_REDUCE_EXPRESSIONS`), after the prune rules had 
already run, so the plan retained a `LogicalProject` with `ITEM` calls on top 
of empty `LogicalValues` — and intermediate stage projections can't evaluate 
`ITEM`.
   
   The Calcite 1.42 upgrade (#18658) fixed this: the filter is now simplified 
early enough for `PruneEmptyProject` to remove the projection over the empty 
`Values`, so the query correctly returns an empty result. Verified by running 
this new test at the commit before #18658 (the MSE variant fails with 
`Unsupported function: ITEM`) and after it (passes).
   
   This adds regression coverage for the scenario in `MapFieldTypeTest`, on 
both query engines: OR + EQ, IN + EQ, an int map variant, and an unsatisfiable 
filter under a group-by over map subscripts. All variants assert an empty 
result with no exceptions.


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