Github user viirya commented on the issue:
https://github.com/apache/spark/pull/14452
@hvanhovell Thanks for looking at this.
The first attempt of this PR is to address all `SubqueryAlias`. But looks
like we use `SubqueryAlias` plan in many places. To de-duplicating all of them
causes the query plan weird and fails some tests as I remember. So I turn to
only address the subqueries in CTE.
I have no cue about the exchange reuse, is it about broadcast exchange? If
so, I think not all subqueries are able for broadcasting? Our initial test
shows that de-duplicating the CTE subqueries can save half of the execution
time for query 64.
BTW, the CTE is the motivation of this PR. We found the duplicate
materialization of CTE subqueries in TPC-DS queries (for example, query 64)
degrades the performance.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]