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 2020/11/21 08:25:43 UTC

[GitHub] [calcite] Aaaaaaron commented on a change in pull request #2274: [CALCITE-4411] RelNode to SQL lost the distinct when doing window aggregation (Jiatao Tao)

Aaaaaaron commented on a change in pull request #2274:
URL: https://github.com/apache/calcite/pull/2274#discussion_r528161413



##########
File path: core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
##########
@@ -3008,6 +3008,12 @@ private void checkLiteral2(String expression, String expected) {
             + "OVER (PARTITION BY \"hire_date\" ORDER BY \"employee_id\"), \"hire_date\"\n"
             + "FROM \"foodmart\".\"employee\"\n"
             + "GROUP BY \"hire_date\", \"employee_id\"";
+    String query7 = "SELECT "
+        + "count(distinct \"employee_id\") over (order by \"hire_date\") FROM \"employee\"";
+    String expected7 = "SELECT "
+        + "COUNT(DISTINCT \"employee_id\") "
+        + "OVER (ORDER BY \"hire_date\" RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"$0\""
+        + "\nFROM \"foodmart\".\"employee\"";

Review comment:
       Sorry don't get your opinion @zabetak , if you just run the test without my modification, it'll fail, the distinct is lost, more details can be seen in JIRS




----------------------------------------------------------------
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