Analyzer: Fix resolving subcolumns in JOIN#49703
Conversation
|
This is an automated comment for commit e9ab8e8 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page Successful checks
|
ea7989f to
4b671f6
Compare
205e0b4 to
acd9013
Compare
acd9013 to
b246070
Compare
b246070 to
25268fb
Compare
CREATE table ttta (x Int32, t Tuple(t Tuple(t UInt32, s String), s String)) ENGINE = MergeTree ORDER BY x;
INSERT INTO ttta VALUES (1, ((1, 's'), 's'));
CREATE table tttb (x Int32, t Tuple(t Tuple(t Int32, s String), s String)) ENGINE = MergeTree ORDER BY x;
INSERT INTO tttb VALUES (1, ((1, 's'), 's'));
-- ((1,'s'),'s') (1,'s') Tuple(\n t Tuple(\n t UInt32,\n s String),\n s String) Tuple(Int64, String)
SELECT t, t.t, toTypeName(t), toTypeName(t.t) FROM ttta AS a FULL OUTER JOIN tttb AS b USING t.t;It's happening because we select While with subquery we resolve SELECT t.t.t FROM (
SELECT ((1, 's'), 's') :: Tuple(t Tuple(t UInt32, s String), s String) as t
) t1 FULL JOIN (
SELECT ((1, 's'), 's') :: Tuple(t Tuple(t Int32, s String), s String) as t
) t2 USING (t); |
dfea151 to
2c68bde
Compare
|
Added comment to code, probably we can go with it, providing best-effort result while selecting sub/super-columns and having them in USING list. When an identifier is resolved into the function With current implementation, at least we do not have LOGICAL_ERRORS or type mismatches. (I added test with different subcolumn levels in select and using list, maybe it can be even more complex, e.g Tuples in Nested or several different columns in using list ? 😵💫) @novikd you may check the PR |
novikd
left a comment
There was a problem hiding this comment.
LGTM, let's see if CI finds any problem
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
...
TODO: