Skip to content

Fix test reference files for join using nullable column#48893

Merged
vdimir merged 1 commit intomasterfrom
vdimir/analyzer_join_using_tests
Apr 26, 2023
Merged

Fix test reference files for join using nullable column#48893
vdimir merged 1 commit intomasterfrom
vdimir/analyzer_join_using_tests

Conversation

@vdimir
Copy link
Copy Markdown
Member

@vdimir vdimir commented Apr 18, 2023

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

...

Tests fixed in this PR related to result column type after JOIN .. USING. We expect the column under USING to have a result type which is a super-type of the column from the left and right tables:

SELECT throwIf('Int64' != any(toTypeName(s))) FROM (
    SELECT materialize(1 :: Int32) as s
) t1 FULL JOIN (
    SELECT materialize(2 :: UInt32) as s
) t2 USING (s);

But in the current interpreter it works sometime unexpected for LowCardinality and Nullable types.

This PR covers the cases like:

-- Current : LowCardinality(String)
-- Analyzer: String
SELECT any(toTypeName(s)) FROM (SELECT materialize('a' :: LowCardinality(String)) as s) t1 FULL JOIN (SELECT materialize('b' :: String) as s) t2 USING (s);
-- Current : String
-- Analyzer: String
SELECT any(toTypeName(s)) FROM (SELECT materialize('a' :: String) as s) t1 FULL JOIN (SELECT materialize('b' :: LowCardinality(String)) as s) t2 USING (s);
-- Current : Nullable(String)
-- Analyzer: Nullable(String)
SELECT any(toTypeName(s)) FROM (SELECT materialize('a' :: Nullable(String)) as s) t1 FULL JOIN (SELECT materialize('b' :: LowCardinality(String)) as s) t2 USING (s);
-- Current : LowCardinality(String)
-- Analyzer: Nullable(String)
SELECT any(toTypeName(s)) FROM (SELECT materialize('a' :: LowCardinality(String)) as s) t1 FULL JOIN (SELECT materialize('b' :: Nullable(String)) as s) t2 USING (s);
-- Current : LowCardinality(Nullable(String))
-- Analyzer: LowCardinality(Nullable(String))
SELECT any(toTypeName(s)) FROM (SELECT materialize('a' :: LowCardinality(Nullable(String))) as s) t1 FULL JOIN (SELECT materialize('b' :: LowCardinality(String)) as s) t2 USING (s);
-- Current : LowCardinality(String)
-- Analyzer: LowCardinality(Nullable(String))
SELECT any(toTypeName(s)) FROM (SELECT materialize('a' :: LowCardinality(String)) as s) t1 FULL JOIN (SELECT materialize('b' :: LowCardinality(Nullable(String))) as s) t2 USING (s);

@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Apr 18, 2023
@novikd novikd self-assigned this Apr 18, 2023
@vdimir vdimir merged commit 75f9a7f into master Apr 26, 2023
@vdimir vdimir deleted the vdimir/analyzer_join_using_tests branch April 26, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants