[ 
https://issues.apache.org/jira/browse/CALCITE-2645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rui Wang updated CALCITE-2645:
------------------------------
    Description: 
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql2rel/AuxiliaryConverter.java#L56

In the AuxiliaryConverter implementation, SESSION_END() is transformed to a 
RexInputRef, as the same as SESSION_START(). By doing so, it cannot restored 
when generating physical plan because it cannot be differentiated which 
RexInputRef is session start, and which RexInputRef is session end. 

Ideally, during toRel, SESSION_END can be kept as a RexCall with function 
information in it. So in the following step, the RexCall can be replaced as a 
correct input reference to GROUP BY's field.

  was:
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql2rel/AuxiliaryConverter.java#L57

In the AuxiliaryConverter implementation, SESSION_END() is transformed to a 
RexInputRef, as the same as SESSION_START(). By doing so, it cannot restored 
when generating physical plan because which RexInputRef is start, and which 
RexInputRef is end cannot be differentiated. 

Ideally, during toRel, SESSION_END can be kept as a RexCall with function 
information in it. So in the following step, the RexCall can be replaced as a 
input reference.


> SESSION_END() is transformed to RexInputRef, which is always equal to 
> SESSION_START()
> -------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2645
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2645
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Rui Wang
>            Assignee: Julian Hyde
>            Priority: Major
>
> https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql2rel/AuxiliaryConverter.java#L56
> In the AuxiliaryConverter implementation, SESSION_END() is transformed to a 
> RexInputRef, as the same as SESSION_START(). By doing so, it cannot restored 
> when generating physical plan because it cannot be differentiated which 
> RexInputRef is session start, and which RexInputRef is session end. 
> Ideally, during toRel, SESSION_END can be kept as a RexCall with function 
> information in it. So in the following step, the RexCall can be replaced as a 
> correct input reference to GROUP BY's field.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to