yashmayya commented on PR #18941:
URL: https://github.com/apache/pinot/pull/18941#issuecomment-4920364867

   The Integration Test Set 1 failures 
(`testRegexpReplace`/`testRegexpReplaceVar` in the two MSE suites) were a 
latent bug in the broker-pruning routing-query path that this PR's default flip 
exposed — fixed in c4cb48d4fe.
   
   **Root cause**: queries with a boolean scalar function used directly as a 
predicate (e.g. `WHERE contains(regexpReplace(...), 'CTESTA')`) failed to plan 
with `No enum constant FilterKind.contains`. The routing query forwards the 
leaf filter to the segment pruners, which resolve operators via 
`FilterKind.valueOf` — but `ensureFilterIsFunctionExpression` only wrapped bare 
identifiers/literals, letting non-FilterKind functions through. The 
single-stage engine never hits this because `PredicateComparisonRewriter` 
canonicalizes such predicates to `EQUALS(fn, true)` at parse time. This was 
reachable since #18237 with `SET useBrokerPruning=true`; the default flip made 
it visible in CI.
   
   **Fix** (two layers):
   1. `ensureFilterIsFunctionExpression` now wraps non-FilterKind functions as 
`EQUALS(fn(...), true)`, mirroring `PredicateComparisonRewriter` — pruners 
handle the wrapped shape gracefully (function LHS ⇒ keep segment), so pruning 
on the remaining conjuncts still works. This fixes all three leaf routing paths 
at the shared source.
   2. Fail-open fallback: the non-partitioned and logical-table paths now catch 
routing failures and fall back to unfiltered routing (the partitioned path 
already did), so no pruner quirk can ever fail a query that would plan 
unpruned. The fail-open logs now carry the full stack trace.
   
   **Tests**: unit coverage for the wrapping (top-level / AND / OR / NOT 
shapes), an end-to-end `WHERE contains(...)` planning test asserting the 
canonicalized routing filter, fail-open fallback tests, and the mock routing 
managers now validate filters the same way real pruners do 
(`FilterKind.valueOf` walk), so any future non-canonical routing filter fails 
unit tests immediately. Verified the previously-failing IT methods pass locally 
with the fix.


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