somandal opened a new pull request, #9078: URL: https://github.com/apache/pinot/pull/9078
Today MV columns as the first expression in a Selection Order By query fails during query execution. The error seen today is: ``` 18:25:22.961 BaseCombineOperator - Caught exception while processing query: QueryContext{_tableName='testTable', _subquery=null, _selectExpressions=[mvFloatCol], _aliasList=[null], _filter=mvFloatCol < '5', _groupByExpressions=null, _havingFilter=null, _orderByExpressions=[mvFloatCol ASC], _limit=10, _offset=0, _queryOptions={}, _expressionOverrideHints={}, _explain=false} java.lang.ClassCastException: class [F cannot be cast to class java.lang.Comparable ([F and java.lang.Comparable are in module java.base of loader 'bootstrap') at org.apache.pinot.core.operator.combine.MinMaxValueBasedSelectionOrderByCombineOperator.processSegments(MinMaxValueBasedSelectionOrderByCombineOperator.java:210) ~[classes/:?] at org.apache.pinot.core.operator.combine.BaseCombineOperator$1.runJob(BaseCombineOperator.java:101) ~[classes/:?] at org.apache.pinot.core.util.trace.TraceRunnable.run(TraceRunnable.java:40) ~[classes/:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?] at java.lang.Thread.run(Thread.java:834) [?:?] ``` This PR throws an `UnsupportedOperationException` during the server side planning phase when it identifies a MV column as the first expression in the selection order-by query to provide users with a better message about why the query fails. Note that this PR only errors out the scenario when the MV column is the first expression in the order-by expression list rather than erroring out whenever any MV column is present in the order-by expression list. The reason for this is to maintain backward incompatibility. Today if a mix of SV and MV columns are present in a selection order-by query, and if the first expression is a SV column then the query execution completes successfully. The query execution failure only occurs when the MV column is the first expression. Selection order-by on MV columns don't make sense semantically which is why it is better to error out in a meaningful way as the error thrown on the query execution failure requires debugging to understand why it failed. cc @siddharthteotia -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org