mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 20:32:43 +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();
|
node->convertToNullable();
|
||||||
break;
|
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
|
9 \N 9
|
||||||
\N 0 20
|
\N 0 20
|
||||||
\N 1 25
|
\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)
|
ORDER BY 1, tuple(val)
|
||||||
SETTINGS group_by_use_nulls = 1, max_bytes_before_external_sort=10;
|
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