ClickHouse/tests/queries/0_stateless/01651_group_uniq_array_enum.sql
Alexey Milovidov d27e04997d More tests
2021-01-13 21:13:52 +03:00

14 lines
524 B
SQL

SELECT arraySort(groupUniqArray(x)) FROM (SELECT CAST(arrayJoin([1, 2, 3, 2, 3, 3]) AS Enum('Hello' = 1, 'World' = 2, 'Упячка' = 3)) AS x);
SELECT arraySort(groupArray(x)) FROM (SELECT CAST(arrayJoin([1, 2, 3, 2, 3, 3]) AS Enum('Hello' = 1, 'World' = 2, 'Упячка' = 3)) AS x);
SELECT
arraySort(groupUniqArray(val)) AS uniq,
toTypeName(uniq),
arraySort(groupArray(val)) AS arr,
toTypeName(arr)
FROM
(
SELECT CAST(number % 2, 'Enum(\'hello\' = 1, \'world\' = 0)') AS val
FROM numbers(2)
);