snuyanzin commented on code in PR #24255:
URL: https://github.com/apache/flink/pull/24255#discussion_r1840506133


##########
flink-table/flink-sql-parser/src/main/codegen/templates/Parser.jj:
##########
@@ -4581,15 +4608,24 @@ SqlLiteral DateTimeLiteral() :
     }
 |
     <DATE> { s = span(); } p = SimpleStringLiteral() {
-      return SqlParserUtil.parseDateLiteral(p, s.end(this));
+      return SqlLiteral.createUnknown("DATE", p, s.end(this));
+    }
+|
+    <DATETIME> { s = span(); } p = SimpleStringLiteral() {
+        return SqlLiteral.createUnknown("DATETIME", p, s.end(this));
     }
 |
     <TIME> { s = span(); } p = SimpleStringLiteral() {
-        return SqlParserUtil.parseTimeLiteral(p, s.end(this));
+      return SqlLiteral.createUnknown("TIME", p, s.end(this));
     }
 |
+    LOOKAHEAD(2)
     <TIMESTAMP> { s = span(); } p = SimpleStringLiteral() {
-        return SqlParserUtil.parseTimestampLiteral(p, s.end(this));
+        return SqlLiteral.createUnknown("TIMESTAMP", p, s.end(this));
+    }
+|
+    <TIMESTAMP> { s = span(); } <WITH> <LOCAL> <TIME> <ZONE> p = 
SimpleStringLiteral() {

Review Comment:
   It passes parser however fails during planning, so probably need a follow-up 
task to have it fully supported in Flink
   ```
   [ERROR] Could not execute SQL statement. Reason:
   java.lang.AssertionError: Was not expecting value 
'TIMESTAMP_WITH_LOCAL_TIME_ZONE' for enumeration 
'org.apache.calcite.sql.type.SqlTypeName' in this context
   ```



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to