[
https://issues.apache.org/jira/browse/CALCITE-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16825923#comment-16825923
]
Lai Zhou commented on CALCITE-2282:
-----------------------------------
[~zhztheplayer], It likes what I commented before,
{code:java}
/**since SqlOperator is identified by name and kind ,
see * {@link SqlOperator#equals(Object)} and * {@link SqlOperator#hashCode()},
we can override implementors of operators that declared in *
SqlStdOperatorTable *
*/
{code}
{code:java}
SqlOperator newOp = new HiveSqlFunction(functionInStd.getNameAsId(),
functionInStd.getKind(), HiveSqlUDFReturnTypeInference.INSTANCE,
functionInStd.getFunctionType());
register(newOp);
{code}
But DIVIDE can't be replaced correctly by this way. You will find that the
static built-in functions would not be looked up from customized
OperatorTable.
> 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)