You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2023/01/09 19:31:17 UTC

[GitHub] [calcite] julianhyde commented on a diff in pull request #3022: [CALCITE-5468] SqlToRelConverter should register sub-queries inside ORDER BY clause for queries without aggregation

julianhyde commented on code in PR #3022:
URL: https://github.com/apache/calcite/pull/3022#discussion_r1065030991


##########
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:
   Don't put stuff on the end. It causes merge conflicts. Put it in the most logical place.



-- 
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-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org