From a83915b62cc0783455c4cc46fec9b73b1b793a9e Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 19 Jun 2014 23:11:42 +0400 Subject: [PATCH] dbms: JOINs: more tests [#METR-11370]. --- .../0_stateless/00054_join_string.reference | 15 +++++++++++++++ .../queries/0_stateless/00054_join_string.sql | 9 +++++++++ .../0_stateless/00055_join_two_numbers.reference | 13 +++++++++++++ .../0_stateless/00055_join_two_numbers.sql | 9 +++++++++ .../00056_join_number_string.reference | 13 +++++++++++++ .../0_stateless/00056_join_number_string.sql | 9 +++++++++ 6 files changed, 68 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00054_join_string.reference create mode 100644 dbms/tests/queries/0_stateless/00054_join_string.sql create mode 100644 dbms/tests/queries/0_stateless/00055_join_two_numbers.reference create mode 100644 dbms/tests/queries/0_stateless/00055_join_two_numbers.sql create mode 100644 dbms/tests/queries/0_stateless/00056_join_number_string.reference create mode 100644 dbms/tests/queries/0_stateless/00056_join_number_string.sql diff --git a/dbms/tests/queries/0_stateless/00054_join_string.reference b/dbms/tests/queries/0_stateless/00054_join_string.reference new file mode 100644 index 00000000000..75a0a5bc5fc --- /dev/null +++ b/dbms/tests/queries/0_stateless/00054_join_string.reference @@ -0,0 +1,15 @@ +A 0 +A 1 +B 2 +B 3 +C 4 +C 5 +D 6 +D 7 +E 8 +E 9 +F 0 +G 0 +H 0 +I 0 +J 0 diff --git a/dbms/tests/queries/0_stateless/00054_join_string.sql b/dbms/tests/queries/0_stateless/00054_join_string.sql new file mode 100644 index 00000000000..ecb6d4af84f --- /dev/null +++ b/dbms/tests/queries/0_stateless/00054_join_string.sql @@ -0,0 +1,9 @@ +SELECT *, joined FROM +( + SELECT reinterpretAsString(number + reinterpretAsUInt8('A')) AS k FROM system.numbers LIMIT 10 +) +ALL LEFT JOIN +( + SELECT reinterpretAsString(intDiv(number, 2) + reinterpretAsUInt8('A')) AS k, number AS joined FROM system.numbers LIMIT 10 +) +USING k; diff --git a/dbms/tests/queries/0_stateless/00055_join_two_numbers.reference b/dbms/tests/queries/0_stateless/00055_join_two_numbers.reference new file mode 100644 index 00000000000..b16ad82a781 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00055_join_two_numbers.reference @@ -0,0 +1,13 @@ +0 0 +0 6 +1 1 +1 7 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 2 +8 8 +9 0 diff --git a/dbms/tests/queries/0_stateless/00055_join_two_numbers.sql b/dbms/tests/queries/0_stateless/00055_join_two_numbers.sql new file mode 100644 index 00000000000..2161b1af92a --- /dev/null +++ b/dbms/tests/queries/0_stateless/00055_join_two_numbers.sql @@ -0,0 +1,9 @@ +SELECT left, right FROM +( + SELECT number % 4 AS k1, number % 3 AS k2, number AS left FROM system.numbers LIMIT 10 +) +ALL LEFT JOIN +( + SELECT number % 2 AS k1, number % 6 AS k2, number AS right FROM system.numbers LIMIT 10 +) +USING k1, k2; diff --git a/dbms/tests/queries/0_stateless/00056_join_number_string.reference b/dbms/tests/queries/0_stateless/00056_join_number_string.reference new file mode 100644 index 00000000000..b16ad82a781 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00056_join_number_string.reference @@ -0,0 +1,13 @@ +0 0 +0 6 +1 1 +1 7 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 2 +8 8 +9 0 diff --git a/dbms/tests/queries/0_stateless/00056_join_number_string.sql b/dbms/tests/queries/0_stateless/00056_join_number_string.sql new file mode 100644 index 00000000000..9b88025f7aa --- /dev/null +++ b/dbms/tests/queries/0_stateless/00056_join_number_string.sql @@ -0,0 +1,9 @@ +SELECT left, right FROM +( + SELECT number % 4 AS k1, toString(number % 3) AS k2, number AS left FROM system.numbers LIMIT 10 +) +ALL LEFT JOIN +( + SELECT number % 2 AS k1, toString(number % 6) AS k2, number AS right FROM system.numbers LIMIT 10 +) +USING k1, k2;