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

   `QueryFingerprintVisitor` extends `SqlShuttle` but breaks its non-mutating 
contract: most visit methods (`visitSelect`, `visitJoin`, `visitWith`, 
`visitWithItem`, `visitCase`, the `OVER`/`IN`/`NOT_IN` branches) call 
`setOperand` on the input node, replacing data literals with `SqlDynamicParam` 
in place.
   
   The broker reuses the same `SqlNodeAndOptions` to compile the `PinotQuery` 
after calling `QueryFingerprintUtils.generateFingerprint(...)`. So when 
`pinot.broker.enable.query.fingerprinting=true`, any query with literals in 
`WHERE`/`JOIN`/`IN`/`CASE`/`CTE`/etc. sees a poisoned tree and fails 
compilation:
   
   - SSE: throws and falls back to the MSE-suggestion error path, surfacing as 
`errorCode 150 / "only supported by the multi-stage query engine"` even for 
perfectly-SSE-compatible queries.
   - MSE: `RexExpressionUtils.fromRexNode` throws `Unsupported RexNode type 
with SqlKind: DYNAMIC_PARAM` during physical optimization.
   
   The fix makes every visit method honor `SqlShuttle`'s contract by rebuilding 
the call via `getOperator().createCall(...)`, mirroring Calcite's own 
`CallCopyingArgHandler.result()`. Regression tests assert that the input 
`SqlNode` is unchanged after `generateFingerprint` runs, and that the same 
`SqlNodeAndOptions` still compiles to a `PinotQuery` afterwards.


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