mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
17b27b6c28
Otherwise the following query will be optimized incorrectly: SELECT *, any(arrayJoin([[], []])) FROM numbers(1) GROUP BY number And the result will be: ┌─number─┬─arrayJoin(array(array(), array()))─┐ │ 0 │ [] │ │ 0 │ [] │ └────────┴────────────────────────────────────┘ While should be: ┌─number─┬─any(arrayJoin(array(array(), array())))─┐ │ 0 │ [] │ └────────┴─────────────────────────────────────────┘
33 lines
503 B
Plaintext
33 lines
503 B
Plaintext
SELECT any(number) + (any(number) * 2)
|
|
FROM numbers(1, 2)
|
|
3
|
|
SELECT anyLast(number) + (anyLast(number) * 2)
|
|
FROM numbers(1, 2)
|
|
6
|
|
WITH any(number) * 3 AS x
|
|
SELECT x
|
|
FROM numbers(1, 2)
|
|
3
|
|
SELECT
|
|
anyLast(number) * 3 AS x,
|
|
x
|
|
FROM numbers(1, 2)
|
|
6 6
|
|
SELECT any(number + (number * 2))
|
|
FROM numbers(1, 2)
|
|
3
|
|
SELECT anyLast(number + (number * 2))
|
|
FROM numbers(1, 2)
|
|
6
|
|
WITH any(number * 3) AS x
|
|
SELECT x
|
|
FROM numbers(1, 2)
|
|
3
|
|
SELECT
|
|
anyLast(number * 3) AS x,
|
|
x
|
|
FROM numbers(1, 2)
|
|
6 6
|
|
arrayJoin
|
|
0 []
|