Description
Both core and babel will parse fail.
FrameworkConfig coreConfig = Frameworks.newConfigBuilder().build(); Planner corePlanner = Frameworks.getPlanner(coreConfig); corePlanner.parse("SELECT TIMESTAMP('2022-05-21 08:00:00'"); // Caused by: org.apache.calcite.sql.parser.babel.ParseException: Incorrect syntax near the keyword 'TIMESTAMP' at line 1, column 8. FrameworkConfig babelConfig = Frameworks.newConfigBuilder() .parserConfig(SqlParser.Config.DEFAULT.withParserFactory( SqlBabelParserImpl.FACTORY)) .build(); Planner babelPlanner = Frameworks.getPlanner(babelConfig); babelPlanner.parse("SELECT TIMESTAMP('2022-05-21 08:00:00'"); // Caused by: org.apache.calcite.sql.parser.babel.ParseException: Incorrect syntax near the keyword 'TIMESTAMP' at line 1, column 8
Here are some databases that support TIMESTAMP function.
select timestamp('2022-05-21 08:00:00') // result timestamp('2022-05-21 08:00:00') 2022-05-21 08:00:00
Also, here are some databases that not support TIMESTAMP function:
select timestamp('2022-05-21 08:00:00') //ORA-00923: FROM keyword not found where expected
select timestamp('2022-05-21 08:00:00') // Msg 195 Level 15 State 10 Line 1 // 'timestamp' is not a recognized built-in function name.
Is it necessary for us to support it in babel module?
Attachments
Issue Links
- duplicates
-
CALCITE-5508 Add constructor functions for DATE, TIME, TIMESTAMP, DATETIME
- Closed
- relates to
-
CALCITE-5135 Planner#parse can't parse DAY() function
- Open