Almog Gavra created CALCITE-5302:
------------------------------------
Summary: CalciteCatalogReader should support SqlSyntax other than
FUNCTION
Key: CALCITE-5302
URL: https://issues.apache.org/jira/browse/CALCITE-5302
Project: Calcite
Issue Type: Bug
Reporter: Almog Gavra
As part of an effort to implement {{AT TIME ZONE}} functionality in a project
using a customer parser, I noticed that {{CalciteCatalogReader}} only allows
looking up operators that use {{{}SqlSyntax.FUNCTION{}}}:
[https://github.com/apache/calcite/blob/b16df019ed9fc7dba7392be9b758358c5a4e927b/core/src/main/java/org/apache/calcite/prepare/CalciteCatalogReader.java#L250-L257]
{noformat}
@Override public void lookupOperatorOverloads(final SqlIdentifier opName,
@Nullable SqlFunctionCategory category,
SqlSyntax syntax,
List<SqlOperator> operatorList,
SqlNameMatcher nameMatcher) {
if (syntax != SqlSyntax.FUNCTION) {
return;
}{noformat}
This means that if we want to implement a different kind of syntax (e.g. in the
case of {{{}AT TIME ZONE{}}}, a SqlSyntax.BINARY) we cannot add that to the
reader and instead use {{{}ListSqlOperatorTable{}}}.
I wanted to double check here and see whether that limitation is intentional
(and if so, what a suggested workaround is), or whether it's a bug that should
be fixed - which I'm happy to contribute.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)