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

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

    [ https://issues.apache.org/jira/browse/SPARK-39106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17532767#comment-17532767 ] 

Apache Spark commented on SPARK-39106:
--------------------------------------

User 'ulysses-you' has created a pull request for this issue:
https://github.com/apache/spark/pull/36468

> 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
>            Priority: Major
>
> 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