This is an automated email from the ASF dual-hosted git repository.

amaliujia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/master by this push:
     new 00f2dba  [CALCITE-4289] Fix wrong signature message in 
SqlTumbleWindowFunction
00f2dba is described below

commit 00f2dbacb7675b65fa19fe7cfe6f446687f92f8f
Author: davonliu <[email protected]>
AuthorDate: Mon Sep 28 12:55:18 2020 +0800

    [CALCITE-4289] Fix wrong signature message in SqlTumbleWindowFunction
---
 .../java/org/apache/calcite/sql/SqlTumbleTableFunction.java    |  2 +-
 .../test/java/org/apache/calcite/test/SqlValidatorTest.java    | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/core/src/main/java/org/apache/calcite/sql/SqlTumbleTableFunction.java 
b/core/src/main/java/org/apache/calcite/sql/SqlTumbleTableFunction.java
index 25a8574..58e2920 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlTumbleTableFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlTumbleTableFunction.java
@@ -59,7 +59,7 @@ public class SqlTumbleTableFunction extends 
SqlWindowTableFunction {
     }
 
     @Override public String getAllowedSignatures(SqlOperator op, String 
opName) {
-      return opName + "(TABLE table_name, DESCRIPTOR(col1, col2 ...), datetime 
interval"
+      return opName + "(TABLE table_name, DESCRIPTOR(timecol), datetime 
interval"
           + "[, datetime interval])";
     }
   }
diff --git a/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java 
b/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
index 8b1fdb0..96a7d40 100644
--- a/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
+++ b/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
@@ -10398,7 +10398,7 @@ public class SqlValidatorTest extends 
SqlValidatorTestCase {
         .fails("Cannot apply 'TUMBLE' to arguments of type 
'TUMBLE\\(<RECORDTYPE\\"
             + "(TIMESTAMP\\(0\\) ROWTIME, INTEGER PRODUCTID, INTEGER 
ORDERID\\)>, <COLUMN_LIST>, "
             + "<INTERVAL HOUR>\\)'\\. Supported form\\(s\\): TUMBLE\\(TABLE 
table_name, "
-            + "DESCRIPTOR\\(col1, col2 \\.\\.\\.\\), datetime interval\\[, 
datetime interval\\]\\)");
+            + "DESCRIPTOR\\(timecol\\), datetime interval\\[, datetime 
interval\\]\\)");
     sql("select rowtime, productid, orderid, 'window_start', 'window_end'\n"
         + "from table(\n"
         + "^tumble(\n"
@@ -10408,7 +10408,7 @@ public class SqlValidatorTest extends 
SqlValidatorTestCase {
         .fails("Cannot apply 'TUMBLE' to arguments of type 
'TUMBLE\\(<RECORDTYPE\\"
             + "(TIMESTAMP\\(0\\) ROWTIME, INTEGER PRODUCTID, INTEGER 
ORDERID\\)>, <COLUMN_LIST>, "
             + "<INTERVAL HOUR>\\)'\\. Supported form\\(s\\): TUMBLE\\(TABLE 
table_name, "
-            + "DESCRIPTOR\\(col1, col2 \\.\\.\\.\\), datetime interval\\[, 
datetime interval\\]\\)");
+            + "DESCRIPTOR\\(timecol\\), datetime interval\\[, datetime 
interval\\]\\)");
     sql("select rowtime, productid, orderid, 'window_start', 'window_end'\n"
         + "from table(\n"
         + "tumble(\n"
@@ -10430,21 +10430,21 @@ public class SqlValidatorTest extends 
SqlValidatorTestCase {
         .fails("Cannot apply 'TUMBLE' to arguments of type 
'TUMBLE\\(<RECORDTYPE\\"
             + "(TIMESTAMP\\(0\\) ROWTIME, INTEGER PRODUCTID, INTEGER 
ORDERID\\)>, <COLUMN_LIST>,"
             + " <CHAR\\(4\\)>\\)'\\. Supported form\\(s\\): TUMBLE\\(TABLE "
-            + "table_name, DESCRIPTOR\\(col1, col2 \\.\\.\\.\\), datetime 
interval"
+            + "table_name, DESCRIPTOR\\(timecol\\), datetime interval"
             + "\\[, datetime interval\\]\\)");
     sql("select * from table(\n"
         + "^tumble(table orders, 'test', interval '2' hour)^)")
         .fails("Cannot apply 'TUMBLE' to arguments of type 
'TUMBLE\\(<RECORDTYPE\\"
             + "(TIMESTAMP\\(0\\) ROWTIME, INTEGER PRODUCTID, INTEGER 
ORDERID\\)>, <CHAR\\"
             + "(4\\)>, <INTERVAL HOUR>\\)'\\. Supported form\\(s\\): 
TUMBLE\\(TABLE "
-            + "table_name, DESCRIPTOR\\(col1, col2 \\.\\.\\.\\), datetime 
interval"
+            + "table_name, DESCRIPTOR\\(timecol\\), datetime interval"
             + "\\[, datetime interval\\]\\)");
     sql("select rowtime, productid, orderid, 'window_start', 'window_end' from 
table(\n"
         + "^tumble(table orders, descriptor(rowtime), interval '2' hour, 
'test')^)")
         .fails("Cannot apply 'TUMBLE' to arguments of type 
'TUMBLE\\(<RECORDTYPE\\"
             + "(TIMESTAMP\\(0\\) ROWTIME, INTEGER PRODUCTID, INTEGER 
ORDERID\\)>, <COLUMN_LIST>,"
             + " <INTERVAL HOUR>, <CHAR\\(4\\)>\\)'\\. Supported form\\(s\\): 
TUMBLE\\(TABLE "
-            + "table_name, DESCRIPTOR\\(col1, col2 \\.\\.\\.\\), datetime 
interval"
+            + "table_name, DESCRIPTOR\\(timecol\\), datetime interval"
             + "\\[, datetime interval\\]\\)");
     sql("select * from table(\n"
         + "tumble(TABLE ^tabler_not_exist^, descriptor(rowtime), interval '2' 
hour))")

Reply via email to