Skip to content

Commit e9ab8e8

Browse files
committed
update comment to check_nested_column_not_in_using
1 parent 2c68bde commit e9ab8e8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Analyzer/Passes/QueryAnalysisPass.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3149,6 +3149,17 @@ QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromJoin(const IdentifierLoo
31493149
* So, `t` in USING list is resolved from JOIN itself and has supertype of columns from left and right table.
31503150
* But `t` in `getSubcolumn` argument is still resolved from table and we need to update its type.
31513151
*
3152+
* Example:
3153+
*
3154+
* SELECT t.t FROM (
3155+
* SELECT ((1, 's'), 's') :: Tuple(t Tuple(t UInt32, s1 String), s1 String) as t
3156+
* ) AS a FULL JOIN (
3157+
* SELECT ((1, 's'), 's') :: Tuple(t Tuple(t Int32, s2 String), s2 String) as t
3158+
* ) AS b USING t;
3159+
*
3160+
* Result type of `t` is `Tuple(Tuple(Int64, String), String)` (different type and no names for subcolumns),
3161+
* so it may be tricky to have a correct type for `t.t` that is resolved into getSubcolumn(t, 't').
3162+
*
31523163
* It can be more complicated in case of Nested subcolumns, in that case in query:
31533164
* SELECT t FROM ... JOIN ... USING (t.t)
31543165
* Here, `t` is resolved into function `nested(['t', 's'], t.t, t.s) so, `t.t` should be from JOIN and `t.s` should be from table.

0 commit comments

Comments
 (0)