Description
1. config
I use SqlBabelParserImpl.FACTORY, and create SqlCustomOperatorTable.java which extends org.apache.calcite.sql.fun.SqlStdOperatorTable.
Frameworks.newConfigBuilder()
.parserConfig(SqlParser.config()
.withLex(Lex.MYSQL)
.withCaseSensitive(false)
.withConformance(SqlConformanceEnum.MYSQL_5)
.withParserFactory(SqlBabelParserImpl.FACTORY)
)
.operatorTable(SqlCustomOperatorTable.instance())
In my SqlCustomOperatorTable, I define my custom function named with 'DATEADD'.
2. error
When i try the sql below, i got error as follows.
select dateadd(1698389166000, interval 1 year)
Encountered "1698389166000" at line 1, column 16.
Was expecting one of:
<IDENTIFIER> ...
<HYPHENATED_IDENTIFIER> ...
<QUOTED_IDENTIFIER> ...
<BACK_QUOTED_IDENTIFIER> ...
<BIG_QUERY_BACK_QUOTED_IDENTIFIER> ...
<BRACKET_QUOTED_IDENTIFIER> ...
<UNICODE_QUOTED_IDENTIFIER> ...
Is 'DATEADD' a reserved word? Is there any method to let me create a custom function with name 'DATEADD'?
Thanks for your help.