Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.32.0, 1.33.0
Description
At the moment the following query throws exception:
@Test void testOrderByWithSubQuery() { String sql = "SELECT empno\n" + "FROM emp\n" + "ORDER BY\n" + "CASE WHEN empno IN (1,2) THEN 0 ELSE 1 END"; sql(sql).ok(); }
while converting CASE WHEN `EMP`.`EMPNO` IN (1, 2) THEN 0 ELSE 1 END java.lang.RuntimeException: while converting CASE WHEN `EMP`.`EMPNO` IN (1, 2) THEN 0 ELSE 1 END at org.apache.calcite.sql2rel.ReflectiveConvertletTable.lambda$registerNodeTypeMethod$1(ReflectiveConvertletTable.java:98)
It happens because SqlToRelConverter does not register sub-query inside ORDER BY if query does not have aggregation
Attachments
Issue Links
- links to