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

   The multi-stage planner reduces constant expressions through Calcite's 
`RexExecutorImpl`, which compiles a Java class with Janino for each batch. A 
query vector such as `ARRAY[0.12, -0.03, ...]` with 768 elements reaches the 
executor as 768 `CAST(<literal> AS REAL/DOUBLE)` expressions, or as an array 
constructor of literals, and compiling them took about 200 ms per query.
   
   `PinotRexExecutor` now handles both shapes directly:
   - an `ARRAY[...]` of non-null literals is already reduced, so it is returned 
as is;
   - `CAST(<numeric literal> AS DOUBLE | FLOAT | REAL)` is rounded the way the 
cast would round it (single precision for `REAL`, double precision for `FLOAT` 
and `DOUBLE`, as in Calcite).
   
   A cast that would overflow to infinity still goes to the fallback, so the 
result matches Calcite in every case.
   
   **Tests**: `PinotRexExecutorTest` compares the result with Calcite's 
executor for exact and approximate sources, all three targets, small, large and 
overflowing values. It also checks that a 768-element query vector, in either 
shape, is reduced without the fallback.
   


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