XiDuo You created SPARK-39106:
---------------------------------

             Summary: Correct conditional expression constant folding
                 Key: SPARK-39106
                 URL: https://issues.apache.org/jira/browse/SPARK-39106
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.4.0
            Reporter: XiDuo You


For a conditional expression, we can not partially fold the constant inside 
it's children. For example if c1 or c2 is not null, the last branch should be 
never hit.
{code:java}
SELECT COALESCE(c1, c2, 1/0);
{code}
Besides, for CaseWhen and If, we should mark it as foldable if it's children 
are foldable. It is safe since the both non-codegen and codegen code path have 
already respected the evaluation order.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to