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 2019/06/17 21:46:12 UTC

[GitHub] [calcite] hsyuan commented on a change in pull request #1271: [CALCITE-3112]Support Window in RelToSqlConverter.

hsyuan commented on a change in pull request #1271: [CALCITE-3112]Support Window in RelToSqlConverter.
URL: https://github.com/apache/calcite/pull/1271#discussion_r294531247
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
 ##########
 @@ -1654,6 +1675,19 @@ private void checkLiteral2(String expression, String expected) {
     sql(query).ok(expected);
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-3112">[CALCITE-3112]
+   * Support Window in RelToSqlConverter</a>. */
+  @Test public void testLeadFunctionForPrintingOfFrameBoundaryWithWindow() {
+    String query = "SELECT lead(\"employee_id\",1,'NA') over "
+            + "(partition by \"hire_date\" order by \"employee_id\") FROM \"employee\"";
+    String expected = "SELECT LEAD(\"employee_id\", 1, 'NA') OVER "
+            + "(PARTITION BY \"hire_date\" "
+            + "ORDER BY \"employee_id\") AS \"$0\"\n"
+            + "FROM \"foodmart\".\"employee\"";
+    sql(query).includeWindow(true).ok(expected);
+  }
+
 
 Review comment:
   You can put these test cases together, so that you don't need to repeat the comments and JIRA link many times.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services