mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
Add test for function empty support uuid
This commit is contained in:
parent
15a36af4d6
commit
faa174c6c4
@ -0,0 +1,3 @@
|
||||
1
|
||||
0
|
||||
2 1
|
@ -0,0 +1,28 @@
|
||||
SELECT empty(toUUID('00000000-0000-0000-0000-000000000000'));
|
||||
SELECT uniqIf(uuid, empty(uuid))
|
||||
FROM
|
||||
(
|
||||
SELECT toUUID('00000000-0000-0000-0000-000000000002') AS uuid
|
||||
UNION ALL
|
||||
SELECT toUUID('00000000-0000-0000-0000-000000000001') AS uuid
|
||||
);
|
||||
|
||||
CREATE DATABASE uuid_empty;
|
||||
CREATE TABLE uuid_empty.users (user_id UUID) ENGINE = Memory;
|
||||
CREATE TABLE uuid_empty.orders (order_id UUID, user_id UUID) ENGINE = Memory;
|
||||
INSERT INTO uuid_empty.users VALUES ('00000000-0000-0000-0000-000000000001');
|
||||
INSERT INTO uuid_empty.users VALUES ('00000000-0000-0000-0000-000000000002');
|
||||
INSERT INTO uuid_empty.orders VALUES ('00000000-0000-0000-0000-000000000003', '00000000-0000-0000-0000-000000000001');
|
||||
|
||||
SET joined_subquery_requires_alias = 0;
|
||||
SELECT
|
||||
uniq(user_id) AS users,
|
||||
uniqIf(order_id, notEmpty(order_id)) AS orders
|
||||
FROM
|
||||
(
|
||||
SELECT * FROM uuid_empty.users
|
||||
) ALL LEFT JOIN (
|
||||
SELECT * FROM uuid_empty.orders
|
||||
) USING (user_id);
|
||||
|
||||
DROP DATABASE uuid_empty;
|
Loading…
Reference in New Issue
Block a user