LantaoJin opened a new pull request #31189: URL: https://github.com/apache/spark/pull/31189
### What changes were proposed in this pull request? To remove duplicated expressions in CaseWhen branches. ### Why are the changes needed? In a big query, the case when expressions may be written duplicated such like ``` SELECT CASE WHEN key = 1 THEN 1 WHEN key = 2 THEN 2 WHEN key = 1 THEN 1 ELSE 3 END FROM testData WHERE key = 1 group by key ``` The second `WHEN key = 1 THEN 1` could be removed. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Add UT. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
