dang-stripe opened a new pull request, #18064:
URL: https://github.com/apache/pinot/pull/18064

   This fixes https://github.com/apache/pinot/issues/17960.
   
   ## Problem
   
   When using the physical optimizer, queries with boolean column filters 
(`WHERE is_active=true`) or constant folded predicates (`WHERE 1=1`) produce 
`IDENTIFIER` or `LITERAL` expressions with a null `functionCall`. This causes 
the query to fail with this when it is processed by segment pruners:
   
   ```
   Cannot invoke "org.apache.pinot.common.request.Function.getOperator()" 
because "function" is null. Cannot invoke 
"org.apache.pinot.common.request.Function.getOperator()" because "function" is 
null
   ```
   
   ## Solution
   
   This adds a new method to normalize the filter tree before it reaches the 
pruners:
   - Wraps bare `IDENTIFIER` as `EQUALS(col, true)`
   - Drops `LITERAL` expressions (constant-folded, don't constrain routing)
   - Recursively fixes `AND`/`OR`/`NOT` operands
   
   This only affects physical optimizer code and does not affect segment 
pruners or existing MSE code paths.
   
   ## Testing
   
   This has been deployed to our internal test clusters where I've compared 
results between regular MSE and MSE with physical optimizer to ensure queries 
no longer fail and results are the same.
   
   Test cases include:
   * Normal equals filter: `WHERE status = 'succeeded'`
   * Literal filters `WHERE 1=1`, `WHERE 1=0`
   * Combination of filters with AND, OR, and NOT
   
   cc @ankitsultana @shauryachats 


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