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

 ##########
 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:
   Thanks, I have addressed.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to