You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "XiDuo You (Jira)" <ji...@apache.org> on 2022/05/05 11:51:00 UTC

[jira] [Created] (SPARK-39106) Correct conditional expression constant folding

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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org