mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 12:22:12 +00:00
Merge pull request #66613 from ClickHouse/backport/24.6/66400
Backport #66400 to 24.6: Do not check parent scope for group_by_use_nulls outside of subquery.
This commit is contained in:
commit
754d0d94e1
@ -3823,6 +3823,10 @@ ProjectionNames QueryAnalyzer::resolveExpressionNode(QueryTreeNodePtr & node, Id
|
||||
node->convertToNullable();
|
||||
break;
|
||||
}
|
||||
|
||||
/// Check parent scopes until find current query scope.
|
||||
if (scope_ptr->scope_node->getNodeType() == QueryTreeNodeType::QUERY)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -264,3 +264,44 @@ SETTINGS group_by_use_nulls = 1, max_bytes_before_external_sort=10;
|
||||
9 \N 9
|
||||
\N 0 20
|
||||
\N 1 25
|
||||
CREATE TABLE test
|
||||
ENGINE = ReplacingMergeTree
|
||||
PRIMARY KEY id
|
||||
AS SELECT number AS id FROM numbers(100);
|
||||
SELECT id
|
||||
FROM test
|
||||
GROUP BY id
|
||||
WITH CUBE
|
||||
HAVING id IN (
|
||||
SELECT id
|
||||
FROM test
|
||||
)
|
||||
FORMAT `NUll`
|
||||
SETTINGS allow_experimental_analyzer = 1, group_by_use_nulls = true;
|
||||
SELECT id
|
||||
FROM test
|
||||
FINAL
|
||||
GROUP BY id
|
||||
WITH CUBE
|
||||
HAVING id IN (
|
||||
SELECT DISTINCT id
|
||||
FROM test
|
||||
FINAL
|
||||
)
|
||||
FORMAT `NUll`
|
||||
SETTINGS allow_experimental_analyzer = 1, group_by_use_nulls = true;
|
||||
SELECT id
|
||||
FROM test
|
||||
FINAL
|
||||
GROUP BY
|
||||
GROUPING SETS ((id))
|
||||
ORDER BY
|
||||
id IN (
|
||||
SELECT DISTINCT id
|
||||
FROM test
|
||||
FINAL
|
||||
LIMIT 4
|
||||
) ASC
|
||||
LIMIT 256 BY id
|
||||
FORMAT `NUll`
|
||||
SETTINGS allow_experimental_analyzer = 1, group_by_use_nulls=true;
|
||||
|
@ -83,3 +83,48 @@ GROUP BY
|
||||
)
|
||||
ORDER BY 1, tuple(val)
|
||||
SETTINGS group_by_use_nulls = 1, max_bytes_before_external_sort=10;
|
||||
|
||||
CREATE TABLE test
|
||||
ENGINE = ReplacingMergeTree
|
||||
PRIMARY KEY id
|
||||
AS SELECT number AS id FROM numbers(100);
|
||||
|
||||
SELECT id
|
||||
FROM test
|
||||
GROUP BY id
|
||||
WITH CUBE
|
||||
HAVING id IN (
|
||||
SELECT id
|
||||
FROM test
|
||||
)
|
||||
FORMAT `NUll`
|
||||
SETTINGS allow_experimental_analyzer = 1, group_by_use_nulls = true;
|
||||
|
||||
SELECT id
|
||||
FROM test
|
||||
FINAL
|
||||
GROUP BY id
|
||||
WITH CUBE
|
||||
HAVING id IN (
|
||||
SELECT DISTINCT id
|
||||
FROM test
|
||||
FINAL
|
||||
)
|
||||
FORMAT `NUll`
|
||||
SETTINGS allow_experimental_analyzer = 1, group_by_use_nulls = true;
|
||||
|
||||
SELECT id
|
||||
FROM test
|
||||
FINAL
|
||||
GROUP BY
|
||||
GROUPING SETS ((id))
|
||||
ORDER BY
|
||||
id IN (
|
||||
SELECT DISTINCT id
|
||||
FROM test
|
||||
FINAL
|
||||
LIMIT 4
|
||||
) ASC
|
||||
LIMIT 256 BY id
|
||||
FORMAT `NUll`
|
||||
SETTINGS allow_experimental_analyzer = 1, group_by_use_nulls=true;
|
||||
|
Loading…
Reference in New Issue
Block a user