You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Rui Wang (Jira)" <ji...@apache.org> on 2019/10/14 19:38:00 UTC

[jira] [Comment Edited] (CALCITE-3382) Rename current TUMBLE to "$TUMBLE" and add TUMBLE to Parser

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

Rui Wang edited comment on CALCITE-3382 at 10/14/19 7:37 PM:
-------------------------------------------------------------

Thanks 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?






was (Author: amaliujia):
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)