kosiew commented on code in PR #16696:
URL: https://github.com/apache/datafusion/pull/16696#discussion_r2389738507


##########
datafusion/optimizer/src/optimize_projections/mod.rs:
##########
@@ -819,6 +843,45 @@ pub fn is_projection_unnecessary(
     ))
 }
 
+fn plan_contains_non_cte_subquery(plan: &LogicalPlan, cte_name: &str) -> bool {

Review Comment:
   Your reading is correct: the helper flags any SubqueryAlias whose name 
differs from the recursive CTE, and then also scans expressions for 
scalar/EXISTS subqueries, so it does catch more than “non-CTE subqueries” in 
the narrow sense. I’ll rename it to plan_contains_other_subqueries (or similar) 
and document that it treats other aliases as blockers so the behaviour matches 
the name.



-- 
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]

Reply via email to