Maksim Zhuravkov created IGNITE-27395:
-----------------------------------------

             Summary: Sql. Expressions with dynamic parameters and NULL (e.g. 
NULL + ?) are not simplified to NULL after calcite 1.41
                 Key: IGNITE-27395
                 URL: https://issues.apache.org/jira/browse/IGNITE-27395
             Project: Ignite
          Issue Type: Improvement
          Components: sql ai3
            Reporter: Maksim Zhuravkov


Calcite 1.41 made some changes related to expression simplification. 
For example (NULL + ?) expression, that is successfully simplified in calcite 
1.40, is no longer simplified to NULL, because this code no calls 
isSafeExpression(e) that is false for (NULL + ?) so the branch with 
simplification code is not taken.

{noformat} Calcite 1.41 

RexNode simplify(RexNode e, RexUnknownAs unknownAs) {
    if (isSafeExpression(e) && STRONG.isNull(e)) {
     ...
    }
} 
{noformat}

In calcite 1.40  `isSafeExpression(e)` is also returns `false`, but `simplify` 
does not perform `isSafeExpression(e)` check.



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

Reply via email to