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

Rui Wang commented on CALCITE-3382:
-----------------------------------

Thanks for Julian. I am trying to build table function TUMBLE on top of this 
JIRA and found that function overloading problem is not fully solved. 

To conclude a bit: because for old TUMBLE,  we will still return "TUMBLE" when 
called getName(), it will still go to the function overloading case in 
SqlFunction.deriveType. In SqlFunction.dervieType, even though the operator in 
GROUP clause is recognized, it will still try to lookup operator by name. And 
to remind, SqlFunction.deriveType is not favor of function overloading, thus it 
still leads a cannot match/match a wrong operator case.

So until now I am thinking two ways to solve it:

option one: overrite SqlFunction.dervieType in SqlGroupedWindowFunction so it 
skip the operator lookup for the old TUMBLE operator.

option two: Make old TUMBLE return "$TUMBLE".


The option two is more like a breaking change and I am leaning to option one. 
What do you think?





> Rename current TUMBLE to "$TUMBLE" and add TUMBLE to Parser
> -----------------------------------------------------------
>
>                 Key: CALCITE-3382
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3382
>             Project: Calcite
>          Issue Type: Sub-task
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.22.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Per discussion in https://github.com/apache/calcite/pull/1457, we should add 
> TUMBLE to parser and rename it to "$TUMBLE".
> "TUMBLE" as an operator name will be left for table-value function TUMBLE.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to