[
https://issues.apache.org/jira/browse/CALCITE-2823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16781102#comment-16781102
]
Laurent Goujon commented on CALCITE-2823:
-----------------------------------------
Is RAND() deterministic? no, because it returns a different value each time the
function is called. But there are several places in Calcite when RexNodeA ==
RexNodeB is tested, and that equality is of the result is assumed because
expressions are equals.
The same issue is also present in linq4j, unfortunately, I'm not really
knowledgeable about that part of the code, and not sure how to address it.
> Prevent optimization of non-deterministic functions
> ---------------------------------------------------
>
> Key: CALCITE-2823
> URL: https://issues.apache.org/jira/browse/CALCITE-2823
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Siddharth Teotia
> Priority: Major
>
> RexSimplify and RexProgram optimize expressions like A() = A() to true, but
> if A() is a non-deterministic expression, this optimization is invalid.
> Change RexSimplify and RexProgram to check if expression is deterministic or
> not, in order to decide about the optimization.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)