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

Mihai Budiu resolved CALCITE-6775.
----------------------------------
    Resolution: Fixed

Fixed in 
[https://github.com/apache/calcite/commit/4d9e2a4078d04bd72e9affa0766dd1e84a56dd51]

Thank you for the contribution [~rubenql] 

Thank you for the review [~asolimando] 

> ToChar and ToTimestamp PG implementors should use translator's root instead 
> of creating a new root expression
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-6775
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6775
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.38.0
>            Reporter: Ruben Q L
>            Assignee: Ruben Q L
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.39.0
>
>
> ToChar and ToTimestamp PG implementors should use translator's root instead 
> of creating a new root expression.
> This issue can go easily under the radar because it seems it's only 
> problematic on constant folding execution via RexExecutor (which in turn is 
> executed within a try-catch, so no apparent problem would reach the surface).
> These PG implementors create new expressions for the "root" DataContext, but 
> they should take this expression from the translator itself. The problem is 
> that, during RexToLix translation, while generating the dynamic code, there 
> are some optimizations to remove unused variables, and with the existing code 
> the root expression can be incorrectly detected as unused and removed 
> (because the optimization process uses identity equalities), leading to 
> compilation errors on the dynamic code.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to