danny0405 commented on a change in pull request #2203:
URL: https://github.com/apache/calcite/pull/2203#discussion_r502779921



##########
File path: core/src/test/java/org/apache/calcite/tools/PlannerTest.java
##########
@@ -147,6 +148,21 @@ private void checkParseAndConvert(String query,
         + 
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 from \"emps\"");
   }
 
+  @Test void testCurrentDatetime() throws Exception {
+    Planner planner = getPlanner(null,
+        SqlParser.config());
+    SqlNode node = planner.parse("select current_datetime");
+    planner.validate(node);
+  }
+
+  @Test void testNiladicForBigQuery() throws Exception {
+    Planner planner = getPlanner(null,
+        SqlParser.config().withConformance(SqlConformanceEnum.BIG_QUERY));
+    SqlNode node = planner.parse("select current_time, current_time(), 
current_date, "
+            + "current_date(), current_timestamp, current_timestamp(), 
current_datetime, current_datetime()");

Review comment:
       Maybe we should move the test to `SqlValidatorTest`

##########
File path: 
core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java
##########
@@ -1888,6 +1888,12 @@ public SqlSyntax getSyntax() {
   public static final SqlFunction CURRENT_TIMESTAMP =
       new SqlAbstractTimeFunction("CURRENT_TIMESTAMP", SqlTypeName.TIMESTAMP);
 
+  /**
+   * The <code>CURRENT_DATETIME [(<i>precision</i>)]</code> function.
+   */
+  public static final SqlFunction CURRENT_DATETIME =
+      new SqlAbstractTimeFunction("CURRENT_DATETIME", SqlTypeName.TIMESTAMP);
+

Review comment:
       Does `CURRENT_DATETIME` belong to the SQL standard ?




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


Reply via email to