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

   - Queries like `SELECT * FROM mytable WHERE ARRAY_TO_MV(CAST(mv_col AS 
BIGINT ARRAY)) = 0;` fail when run with the multi-stage query engine with an 
error like:
   ```
   Unable to execute query plan for request: 11345490000000000 on server: 
192.168.29.25@{61393,61394}, ERROR: java.util.concurrent.ExecutionException: 
java.lang.RuntimeException: Caught exception while submitting request: 
11345490000000000, stage: 1
   ...
   ...
   Caused by: java.lang.RuntimeException: Caught exception while submitting 
request: 11345490000000000, stage: 1
   ...
   ...
   Caused by: java.util.concurrent.ExecutionException: 
java.lang.IllegalArgumentException: No enum constant 
org.apache.pinot.spi.data.FieldSpec.DataType.LONG_ARRAY
   ...
        at 
org.apache.pinot.query.service.server.QueryServer.lambda$submit$1(QueryServer.java:141)
   ...
   
   Caused by: java.lang.IllegalArgumentException: No enum constant 
org.apache.pinot.spi.data.FieldSpec.DataType.LONG_ARRAY
        at java.base/java.lang.Enum.valueOf(Enum.java:273)
        at 
org.apache.pinot.spi.data.FieldSpec$DataType.valueOf(FieldSpec.java:474)
        at 
org.apache.pinot.core.query.optimizer.filter.NumericalFilterOptimizer.getDataType(NumericalFilterOptimizer.java:403)
        at 
org.apache.pinot.core.query.optimizer.filter.NumericalFilterOptimizer.optimizeChild(NumericalFilterOptimizer.java:88)
   
org.apache.pinot.query.service.dispatch.QueryDispatcher.submit(QueryDispatcher.java:198)
   
org.apache.pinot.query.service.dispatch.QueryDispatcher.submitAndReduce(QueryDispatcher.java:95)
   
org.apache.pinot.broker.requesthandler.MultiStageBrokerRequestHandler.handleRequest(MultiStageBrokerRequestHandler.java:216)
   
org.apache.pinot.broker.requesthandler.BaseBrokerRequestHandler.handleRequest(BaseBrokerRequestHandler.java:133)
   ```
   - That's because the 
[NumericalFilterOptimizer](https://github.com/apache/pinot/blob/99f6934166633308547d37cacc634e03c723ab17/pinot-core/src/main/java/org/apache/pinot/core/query/optimizer/filter/NumericalFilterOptimizer.java#L385)
 wasn't handling the `ARRAY` Calcite types that represent MV fields in the v2 
query engine.
   - Since MV columns aren't actual arrays and can be queried directly just 
like SV columns (where rows are matched if any value in the MV field matches 
the predicate) of the corresponding type, this bug can be fixed by simply 
stripping the `_ARRAY` suffix from the target type.


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