mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Add comment for visiting children of select in ApplyWithGlobalVisitor
This commit is contained in:
parent
dc2a90a344
commit
976a274f91
@ -96,6 +96,16 @@ void ApplyWithGlobalVisitor::visit(ASTPtr & ast)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to visit all children recursively because the WITH statement may appear in the subquery at the nested level.
|
||||
* Behavior of `WITH ... UNION ALL ...` should be the same at the top level and inside the subquery.
|
||||
*
|
||||
* For example:
|
||||
* SELECT * FROM (WITH (SELECT ... ) AS t SELECT ... UNION ALL SELECT ...)
|
||||
* ^^^^^^^^^^^^ should be visited ^^^^^^^^^^^^^^^^
|
||||
* or inside `WHERE .. IN` clause:
|
||||
* SELECT * FROM ... WHERE x IN (WITH (SELECT ... ) AS t SELECT ... UNION ALL SELECT ...)
|
||||
*/
|
||||
for (auto & child : node_union->list_of_selects->children)
|
||||
visit(child);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user