[
https://issues.apache.org/jira/browse/CALCITE-6753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-6753.
----------------------------------
Fix Version/s: 1.43.0
Assignee: Mihai Budiu
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/43f94f47efbdba7ac4176a842868094d3741d93a]
Thank you for the review [~jensen]
> DeterministicCodeOptimizer may lift method calls out of try-catch blocks
> ------------------------------------------------------------------------
>
> Key: CALCITE-6753
> URL: https://issues.apache.org/jira/browse/CALCITE-6753
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.38.0
> Reporter: Mihai Budiu
> Assignee: Mihai Budiu
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.43.0
>
>
> The DeterministicCodeOptimizer tries to optimize the generated Java code.
> One of the things it does is to lift constant expressions into static
> variables.
> However, it does this regardless if a method call is within a try-catch block.
> For example, it may convert a safe cast into an unsafe cast.
> Unfortunately there is no easy way to check the context of the shuttle while
> optimizing an expression (i.e., whether an expression is within a try-catch
> block), since the accept calls of Expression objects are not
> doubly-dispatched.
> The only tool that is currently available to inhibit this optimization is to
> mark a function as non-deterministic.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)