wangyum opened a new pull request, #40177: URL: https://github.com/apache/spark/pull/40177
### What changes were proposed in this pull request? Enhance `EliminateOuterJoin` by removing the outer join if they are all distinct aggregate functions. For example: ```sql SELECT t1.c1, sum(DISTINCT t1.c2) FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 GROUP BY t1.c1 ==> SELECT t1.c1, sum(DISTINCT t1.c2) FROM t1 GROUP BY t1.c1 ``` ### Why are the changes needed? Improve query performance. TiDB supports this optimization: <img width="896" alt="image" src="https://user-images.githubusercontent.com/5399861/221414239-ccd73fed-df38-4b76-9345-9ff0f5e6a478.png"> ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Unit test. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
