[
https://issues.apache.org/jira/browse/CALCITE-7427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18062761#comment-18062761
]
Julian Hyde commented on CALCITE-7427:
--------------------------------------
One fix is to apply the rule that removes all sort expressions that are
constant. But we want to be able to execute the query even if that rule is not
enabled. I saw your fix to skip all Java expressions of type Void. Looks good.
> Query with "ORDER BY NULL" throws "NoSuchMethodException: compareNullsLast"
> ---------------------------------------------------------------------------
>
> Key: CALCITE-7427
> URL: https://issues.apache.org/jira/browse/CALCITE-7427
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Assignee: Zhen Chen
> Priority: Major
> Labels: pull-request-available
>
> A query with the NULL literal in its ORDER BY clause throws. For example,
> {{{}dummy.iq{}}}:
> {noformat}
> !use scott
> SELECT * FROM emp ORDER BY deptno, null, empno;
> !ok {noformat}
> gives error
> {noformat}
> java.sql.SQLException: Error while executing SQL "SELECT * FROM emp ORDER BY
> deptno, null, empno": Unable to implement EnumerableCalc
> ...
> Caused by: java.lang.NoSuchMethodException:
> org.apache.calcite.runtime.Utilities.compareNullsLast(java.lang.Void,java.lang.Void)
> at java.base/java.lang.Class.getMethod(Class.java:2395)
> at
> org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:288){noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)