Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-46632][SQL] Fix subexpression elimination when equivalent tern…
…ary expressions have different children ### What changes were proposed in this pull request? Remove unexpected exception thrown in `EquivalentExpressions.updateExprInMap()`. Equivalent expressions may contain different children, it should happen expression not in map and `useCount` is -1. For example, before this PR will throw IllegalStateException ``` Seq((1, 2, 3), (2, 3, 4)).toDF("a", "b", "c") .selectExpr("case when a + b + c>3 then 1 when c + a + b>0 then 2 else 0 end as d").show() ``` ### Why are the changes needed? Bug fix. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? New unit test, before this PR will throw IllegalStateException: *** with use count: -1 ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#46135 from zml1206/SPARK-46632. Authored-by: zml1206 <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
- Loading branch information