[
https://issues.apache.org/jira/browse/CALCITE-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16826328#comment-16826328
]
Julian Hyde commented on CALCITE-2282:
--------------------------------------
Regarding DIVIDE. I'm trying to choose the lesser evil here. I don't deny that
there are times when it is convenient to be able to customize the built-in
operators without re-building the parser, and DIVIDE is a good example.
However, there is a constant temptation for developers to try to put too much
functionality into the parser. Functionality that should be in the validator,
or planner rules, or elsewhere. Leaving the operator table out of the parser
tends to force people onto the right path.
There are other ways to customize DIVIDE. In fact, DIVIDE already does some of
them: it uses the {{createDecimalQuotient}} method, which calls some methods in
{{RelDataTypeSystem}}. Another technique could be a visitor that walks over
expressions and replaces Calcite's DIVIDE with Hive's DIVIDE.
> Allow OperatorTable to be pluggable in the parser
> -------------------------------------------------
>
> Key: CALCITE-2282
> URL: https://issues.apache.org/jira/browse/CALCITE-2282
> Project: Calcite
> Issue Type: Improvement
> 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)