You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Almog Gavra (Jira)" <ji...@apache.org> on 2022/10/01 15:05:00 UTC
[jira] [Commented] (CALCITE-5302) CalciteCatalogReader should support SqlSyntax other than FUNCTION
[ https://issues.apache.org/jira/browse/CALCITE-5302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17611920#comment-17611920 ]
Almog Gavra commented on CALCITE-5302:
--------------------------------------
Thanks [~julianhyde] - we'll look to contribute {{AT TIME ZONE}} back to Calcite then once we've stabilized things.
I'll close this ticket in favor of CALCITE-5301
> 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
> Priority: Major
>
> 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)