[
https://issues.apache.org/jira/browse/CALCITE-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16823413#comment-16823413
]
Julian Hyde commented on CALCITE-2282:
--------------------------------------
The {{opTab}} field is only used in one place:
{code}
// First, try a half-hearted resolution as a builtin function.
// If we find one, use it; this will guarantee that we
// preserve the correct syntax (i.e. don't quote builtin function
/// name when regenerating SQL).
if (funName.isSimple()) {
final List<SqlOperator> list = new ArrayList<>();
opTab.lookupOperatorOverloads(funName, funcType, SqlSyntax.FUNCTION, list,
SqlNameMatchers.withCaseSensitive(funName.isComponentQuoted(0)));
if (list.size() == 1) {
fun = list.get(0);
}
}
{code}
Can we eliminate that code, and therefore remove the {{opTab}} field from the
parser? We've improved how we quote functions (including built-in functions)
recently.
> Allow OperatorTable to be pluggable in the parser
> -------------------------------------------------
>
> Key: CALCITE-2282
> URL: https://issues.apache.org/jira/browse/CALCITE-2282
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Sudheesh Katkam
> Priority: Major
> Attachments: CALCITE-2282.patch.txt
>
>
> SqlAbstractParserImpl [hardcodes OperatorTable to
> SqlStdOperatorTable|https://github.com/apache/calcite/blob/8327e674e7f0a768d124fa37fd75cda4b8a35bb6/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java#L334|https://github.com/apache/calcite/blob/8327e674e7f0a768d124fa37fd75cda4b8a35bb6/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java#L334].
> Make this pluggable via a protected method.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)