[ 
https://issues.apache.org/jira/browse/CALCITE-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16824786#comment-16824786
 ] 

Danny Chan edited comment on CALCITE-2282 at 4/24/19 3:50 AM:
--------------------------------------------------------------

[~julianhyde] We did have an identifier in sql call[1], now we have the 
function qualifier, the parse position and the operands, but the question is we 
do not know how to unparse the call if we don't know which kind of call it is, 
like a VALUES operator or a CASE WHEN operator, they have special function 
formula and not the common like "func(operand1, operand2)".

Like a case when clause would be unparsed to:
{code:java}
SELECT (CASE WHEN (1 > 0) THEN TRUE ELSE FALSE END), `EMPNO`
FROM `EMP`
HAVING (`COUNT`(*) > 5)
{code}
[1] 
[https://github.com/apache/calcite/blob/986a2d579c8f9b9f08aa9bbbfe11efc4e7bb0809/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java#L411]


was (Author: danny0405):
[~julianhyde] We did have an identifier in sql call[1], now we have the 
function qualifier, the parse position and the operands, but the question is we 
do not know how to unparse the call if we don't know which kind of call it is, 
like a VALUES operator or a CASE WHEN operator, they have special function 
formula and not the common like "func(operand1, operand2)".

 

[1] 
https://github.com/apache/calcite/blob/986a2d579c8f9b9f08aa9bbbfe11efc4e7bb0809/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java#L411

> 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)

Reply via email to