julianhyde commented on code in PR #3022:
URL: https://github.com/apache/calcite/pull/3022#discussion_r1065031655
##########
core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java:
##########
@@ -4769,4 +4769,18 @@ void checkUserDefinedOrderByOver(NullCollation
nullCollation) {
String sql = "SELECT CAST(CAST(? AS INTEGER) AS CHAR)";
sql(sql).ok();
}
+
+ /**
+ * Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-5468">[CALCITE-5468]
+ * SqlToRelConverter should register sub-queries inside ORDER BY clause
+ * for queries without aggregation</a>.
+ */
+ @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();
+ }
Review Comment:
This IN is not a subquery. Can you rename this test, and add a test for a
subquery?
--
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]