Mihai Budiu created CALCITE-6753:
------------------------------------
Summary: 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
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)