cloud-fan commented on code in PR #40662:
URL: https://github.com/apache/spark/pull/40662#discussion_r1157965959
##########
sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-with-cte.sql.out:
##########
@@ -198,23 +198,20 @@ WithCTE
: : : : +- Filter (cast(t1b#x as int) > 0)
: : : : +- SubqueryAlias cte1
: : : : +- CTERelationRef xxxx, true, [t1a#x,
t1b#x]
- : : : +- Project [t1b#x AS t1b#x]
- : : : +- Project [t1b#x]
- : : : +- Filter (cast(t1b#x as int) > 5)
- : : : +- SubqueryAlias cte1
- : : : +- CTERelationRef xxxx, true, [t1a#x,
t1b#x]
- : : +- Project [t1b#x AS t1b#x]
- : : +- Intersect false
- : : :- Project [t1b#x]
- : : : +- SubqueryAlias cte1
- : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x]
- : : +- Project [t1b#x]
- : : +- SubqueryAlias cte1
- : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x]
- : +- Project [t1b#x AS t1b#x]
- : +- Project [t1b#x]
- : +- SubqueryAlias cte1
- : +- CTERelationRef xxxx, true, [t1a#x, t1b#x]
+ : : : +- Project [t1b#x]
+ : : : +- Filter (cast(t1b#x as int) > 5)
+ : : : +- SubqueryAlias cte1
+ : : : +- CTERelationRef xxxx, true, [t1a#x,
t1b#x]
Review Comment:
@dtenedor This PR exposes an issue that `DeduplicateRelations` never worked
for the CTE ref node, as it's always a new instance and `DeduplicateRelations`
can't detect its duplication.
I think the plan change is reasonable as we now deduplicate CTE ref nodes
and save one `Project` node.
--
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]