diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index 60d66269645..1bfd91ab468 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -5,7 +5,7 @@ # Результаты сравниваются с эталонами. QUERIES_DIR="./queries" -CLIENT_PROGRAM="clickhouse-client" +CLIENT_PROGRAM="curl -sS http://localhost:8123/ --data-binary @-" COLOR_RESET="\033[0m" @@ -50,6 +50,10 @@ do ERRORS=$(($ERRORS + 1)) echo -e "$MSG_FAIL - having stderror:" cat $error_file + elif grep -q "Exception" $result_file; then + ERRORS=$(($ERRORS + 1)) + echo -e "$MSG_FAIL - having exception:" + cat $result_file elif [ ! -e "$reference_file" ]; then # надо сгенерировать эталонный результат if [ "$1" == "--generate" ]; then diff --git a/dbms/tests/queries/00005_format_ast_and_remote_table_lambda.reference b/dbms/tests/queries/00005_format_ast_and_remote_table_lambda.reference new file mode 100644 index 00000000000..0cfbf08886f --- /dev/null +++ b/dbms/tests/queries/00005_format_ast_and_remote_table_lambda.reference @@ -0,0 +1 @@ +2 diff --git a/dbms/tests/queries/00005_format_ast_and_remote_table_lambda.sql b/dbms/tests/queries/00005_format_ast_and_remote_table_lambda.sql new file mode 100644 index 00000000000..fb401df5184 --- /dev/null +++ b/dbms/tests/queries/00005_format_ast_and_remote_table_lambda.sql @@ -0,0 +1 @@ +SELECT count() FROM remote('127.0.0.{1,2}', system, one) WHERE arrayExists((x) -> x = 1, [1, 2, 3]) diff --git a/dbms/tests/queries/00006_1_set_extremes.reference b/dbms/tests/queries/00006_1_set_extremes.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/queries/00006_1_set_extremes.sql b/dbms/tests/queries/00006_1_set_extremes.sql new file mode 100644 index 00000000000..53bd0c96ce2 --- /dev/null +++ b/dbms/tests/queries/00006_1_set_extremes.sql @@ -0,0 +1 @@ +SET GLOBAL extremes = 1 diff --git a/dbms/tests/queries/00006_2_extremes_and_subquery_from.reference b/dbms/tests/queries/00006_2_extremes_and_subquery_from.reference new file mode 100644 index 00000000000..841ae17708f --- /dev/null +++ b/dbms/tests/queries/00006_2_extremes_and_subquery_from.reference @@ -0,0 +1,18 @@ +{ + "meta": + [ + { + "name": "'Hello, world'", + "type": "String" + } + ], + + "data": + [ + + ], + + "rows": 0, + + "rows_before_limit_at_least": 10 +} diff --git a/dbms/tests/queries/00006_2_extremes_and_subquery_from.sql b/dbms/tests/queries/00006_2_extremes_and_subquery_from.sql new file mode 100644 index 00000000000..c8e1e1bf66f --- /dev/null +++ b/dbms/tests/queries/00006_2_extremes_and_subquery_from.sql @@ -0,0 +1,2 @@ +SELECT 'Hello, world' FROM (SELECT number FROM system.numbers LIMIT 10) WHERE number < 0 +FORMAT JSONCompact \ No newline at end of file diff --git a/dbms/tests/queries/00006_3_unset_extremes.reference b/dbms/tests/queries/00006_3_unset_extremes.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/queries/00006_3_unset_extremes.sql b/dbms/tests/queries/00006_3_unset_extremes.sql new file mode 100644 index 00000000000..31e8a97da82 --- /dev/null +++ b/dbms/tests/queries/00006_3_unset_extremes.sql @@ -0,0 +1 @@ +SET GLOBAL extremes = 0 diff --git a/dbms/tests/queries/00007_array.reference b/dbms/tests/queries/00007_array.reference new file mode 100644 index 00000000000..2a64c8ea7b2 --- /dev/null +++ b/dbms/tests/queries/00007_array.reference @@ -0,0 +1 @@ +['Hello','Goodbye'] diff --git a/dbms/tests/queries/00007_array.sql b/dbms/tests/queries/00007_array.sql new file mode 100644 index 00000000000..7c1f27f1978 --- /dev/null +++ b/dbms/tests/queries/00007_array.sql @@ -0,0 +1 @@ +SELECT ['Hello', 'Goodbye'] diff --git a/dbms/tests/queries/00008_array_join.reference b/dbms/tests/queries/00008_array_join.reference new file mode 100644 index 00000000000..c86756d1938 --- /dev/null +++ b/dbms/tests/queries/00008_array_join.reference @@ -0,0 +1,2 @@ +Hello +Goodbye diff --git a/dbms/tests/queries/00008_array_join.sql b/dbms/tests/queries/00008_array_join.sql new file mode 100644 index 00000000000..abb35cbbfc8 --- /dev/null +++ b/dbms/tests/queries/00008_array_join.sql @@ -0,0 +1 @@ +SELECT arrayJoin(['Hello', 'Goodbye']) diff --git a/dbms/tests/queries/00009_array_join_subquery.reference b/dbms/tests/queries/00009_array_join_subquery.reference new file mode 100644 index 00000000000..c86756d1938 --- /dev/null +++ b/dbms/tests/queries/00009_array_join_subquery.reference @@ -0,0 +1,2 @@ +Hello +Goodbye diff --git a/dbms/tests/queries/00009_array_join_subquery.sql b/dbms/tests/queries/00009_array_join_subquery.sql new file mode 100644 index 00000000000..378baadd026 --- /dev/null +++ b/dbms/tests/queries/00009_array_join_subquery.sql @@ -0,0 +1 @@ +SELECT x FROM (SELECT arrayJoin(['Hello', 'Goodbye']) AS x) diff --git a/dbms/tests/queries/00010_big_array_join.reference b/dbms/tests/queries/00010_big_array_join.reference new file mode 100644 index 00000000000..e9c80bae6d0 --- /dev/null +++ b/dbms/tests/queries/00010_big_array_join.reference @@ -0,0 +1,6 @@ +Hello +Hello +Hello +Goodbye +Goodbye +Goodbye diff --git a/dbms/tests/queries/00010_big_array_join.sql b/dbms/tests/queries/00010_big_array_join.sql new file mode 100644 index 00000000000..f7b9160b578 --- /dev/null +++ b/dbms/tests/queries/00010_big_array_join.sql @@ -0,0 +1 @@ +SELECT x FROM (SELECT arrayJoin(['Hello', 'Goodbye']) AS x, [1, 2, 3] AS arr) ARRAY JOIN arr diff --git a/dbms/tests/queries/00011_array_join_alias.reference b/dbms/tests/queries/00011_array_join_alias.reference new file mode 100644 index 00000000000..ff5ad16d763 --- /dev/null +++ b/dbms/tests/queries/00011_array_join_alias.reference @@ -0,0 +1,6 @@ +Hello 1 +Hello 2 +Hello 3 +Goodbye 1 +Goodbye 2 +Goodbye 3 diff --git a/dbms/tests/queries/00011_array_join_alias.sql b/dbms/tests/queries/00011_array_join_alias.sql new file mode 100644 index 00000000000..228038c1509 --- /dev/null +++ b/dbms/tests/queries/00011_array_join_alias.sql @@ -0,0 +1 @@ +SELECT x, a FROM (SELECT arrayJoin(['Hello', 'Goodbye']) AS x, [1, 2, 3] AS arr) ARRAY JOIN arr AS a diff --git a/dbms/tests/queries/00012_array_join_alias_2.reference b/dbms/tests/queries/00012_array_join_alias_2.reference new file mode 100644 index 00000000000..ebad7b98d93 --- /dev/null +++ b/dbms/tests/queries/00012_array_join_alias_2.reference @@ -0,0 +1,6 @@ +Hello 1 [1,2,3] +Hello 2 [1,2,3] +Hello 3 [1,2,3] +Goodbye 1 [1,2,3] +Goodbye 2 [1,2,3] +Goodbye 3 [1,2,3] diff --git a/dbms/tests/queries/00012_array_join_alias_2.sql b/dbms/tests/queries/00012_array_join_alias_2.sql new file mode 100644 index 00000000000..a45cf2d87b8 --- /dev/null +++ b/dbms/tests/queries/00012_array_join_alias_2.sql @@ -0,0 +1 @@ +SELECT x, a, arr FROM (SELECT arrayJoin(['Hello', 'Goodbye']) AS x, [1, 2, 3] AS arr) ARRAY JOIN arr AS a diff --git a/dbms/tests/queries/00013_1_drop_if_exists_table_with_arrays.reference b/dbms/tests/queries/00013_1_drop_if_exists_table_with_arrays.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/queries/00013_1_drop_if_exists_table_with_arrays.sql b/dbms/tests/queries/00013_1_drop_if_exists_table_with_arrays.sql new file mode 100644 index 00000000000..8dbef3a0abb --- /dev/null +++ b/dbms/tests/queries/00013_1_drop_if_exists_table_with_arrays.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS arrays_test diff --git a/dbms/tests/queries/00013_2_create_table_with_arrays.reference b/dbms/tests/queries/00013_2_create_table_with_arrays.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/queries/00013_2_create_table_with_arrays.sql b/dbms/tests/queries/00013_2_create_table_with_arrays.sql new file mode 100644 index 00000000000..8585ba14140 --- /dev/null +++ b/dbms/tests/queries/00013_2_create_table_with_arrays.sql @@ -0,0 +1 @@ +CREATE TABLE arrays_test (s String, arr Array(UInt8)) ENGINE = Memory diff --git a/dbms/tests/queries/00013_3_insert_into_table_with_arrays.reference b/dbms/tests/queries/00013_3_insert_into_table_with_arrays.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/queries/00013_3_insert_into_table_with_arrays.sql b/dbms/tests/queries/00013_3_insert_into_table_with_arrays.sql new file mode 100644 index 00000000000..5b41e56db66 --- /dev/null +++ b/dbms/tests/queries/00013_3_insert_into_table_with_arrays.sql @@ -0,0 +1 @@ +INSERT INTO arrays_test VALUES ('Hello', [1,2]), ('World', [3,4,5]), ('Goodbye', []) diff --git a/dbms/tests/queries/00013_4_select_from_table_with_arrays.reference b/dbms/tests/queries/00013_4_select_from_table_with_arrays.reference new file mode 100644 index 00000000000..5a5af40fc00 --- /dev/null +++ b/dbms/tests/queries/00013_4_select_from_table_with_arrays.reference @@ -0,0 +1,3 @@ +Hello [1,2] +World [3,4,5] +Goodbye [] diff --git a/dbms/tests/queries/00013_4_select_from_table_with_arrays.sql b/dbms/tests/queries/00013_4_select_from_table_with_arrays.sql new file mode 100644 index 00000000000..af4b5dd8538 --- /dev/null +++ b/dbms/tests/queries/00013_4_select_from_table_with_arrays.sql @@ -0,0 +1 @@ +SELECT * FROM arrays_test diff --git a/dbms/tests/queries/00013_5_select_from_table_with_arrays.reference b/dbms/tests/queries/00013_5_select_from_table_with_arrays.reference new file mode 100644 index 00000000000..02ff6407fd6 --- /dev/null +++ b/dbms/tests/queries/00013_5_select_from_table_with_arrays.reference @@ -0,0 +1,5 @@ +Hello 1 +Hello 2 +World 3 +World 4 +World 5 diff --git a/dbms/tests/queries/00013_5_select_from_table_with_arrays.sql b/dbms/tests/queries/00013_5_select_from_table_with_arrays.sql new file mode 100644 index 00000000000..238f888202d --- /dev/null +++ b/dbms/tests/queries/00013_5_select_from_table_with_arrays.sql @@ -0,0 +1 @@ +SELECT s, arr FROM arrays_test ARRAY JOIN arr diff --git a/dbms/tests/queries/00013_6_select_from_table_with_arrays.reference b/dbms/tests/queries/00013_6_select_from_table_with_arrays.reference new file mode 100644 index 00000000000..45d362a350e --- /dev/null +++ b/dbms/tests/queries/00013_6_select_from_table_with_arrays.reference @@ -0,0 +1,5 @@ +Hello [1,2] 1 +Hello [1,2] 2 +World [3,4,5] 3 +World [3,4,5] 4 +World [3,4,5] 5 diff --git a/dbms/tests/queries/00013_6_select_from_table_with_arrays.sql b/dbms/tests/queries/00013_6_select_from_table_with_arrays.sql new file mode 100644 index 00000000000..d1c9936af30 --- /dev/null +++ b/dbms/tests/queries/00013_6_select_from_table_with_arrays.sql @@ -0,0 +1 @@ +SELECT s, arr, a FROM arrays_test ARRAY JOIN arr AS a \ No newline at end of file diff --git a/dbms/tests/queries/00013_7_select_from_table_with_arrays.reference b/dbms/tests/queries/00013_7_select_from_table_with_arrays.reference new file mode 100644 index 00000000000..577260f94f0 --- /dev/null +++ b/dbms/tests/queries/00013_7_select_from_table_with_arrays.reference @@ -0,0 +1,5 @@ +Hello [1,2] 1 1 +Hello [1,2] 2 2 +World [3,4,5] 3 1 +World [3,4,5] 4 2 +World [3,4,5] 5 3 diff --git a/dbms/tests/queries/00013_7_select_from_table_with_arrays.sql b/dbms/tests/queries/00013_7_select_from_table_with_arrays.sql new file mode 100644 index 00000000000..a75b97e6faa --- /dev/null +++ b/dbms/tests/queries/00013_7_select_from_table_with_arrays.sql @@ -0,0 +1 @@ +SELECT s, arr, a, num FROM arrays_test ARRAY JOIN arr AS a, arrayEnumerate(arr) AS num \ No newline at end of file diff --git a/dbms/tests/queries/00013_8_select_from_table_with_arrays.reference b/dbms/tests/queries/00013_8_select_from_table_with_arrays.reference new file mode 100644 index 00000000000..e29fe6d82a1 --- /dev/null +++ b/dbms/tests/queries/00013_8_select_from_table_with_arrays.reference @@ -0,0 +1,5 @@ +Hello [1,2] 1 1 [1,2] +Hello [1,2] 2 2 [1,2] +World [3,4,5] 3 1 [1,2,3] +World [3,4,5] 4 2 [1,2,3] +World [3,4,5] 5 3 [1,2,3] diff --git a/dbms/tests/queries/00013_8_select_from_table_with_arrays.sql b/dbms/tests/queries/00013_8_select_from_table_with_arrays.sql new file mode 100644 index 00000000000..d7b3a7b44b9 --- /dev/null +++ b/dbms/tests/queries/00013_8_select_from_table_with_arrays.sql @@ -0,0 +1 @@ +SELECT s, arr, a, num, arrayEnumerate(arr) FROM arrays_test ARRAY JOIN arr AS a, arrayEnumerate(arr) AS num \ No newline at end of file diff --git a/dbms/tests/queries/00013_9_select_from_table_with_arrays.reference b/dbms/tests/queries/00013_9_select_from_table_with_arrays.reference new file mode 100644 index 00000000000..58328ca2588 --- /dev/null +++ b/dbms/tests/queries/00013_9_select_from_table_with_arrays.reference @@ -0,0 +1,5 @@ +Hello [1,2] 1 2 +Hello [1,2] 2 3 +World [3,4,5] 3 4 +World [3,4,5] 4 5 +World [3,4,5] 5 6 diff --git a/dbms/tests/queries/00013_9_select_from_table_with_arrays.sql b/dbms/tests/queries/00013_9_select_from_table_with_arrays.sql new file mode 100644 index 00000000000..010faea3d76 --- /dev/null +++ b/dbms/tests/queries/00013_9_select_from_table_with_arrays.sql @@ -0,0 +1 @@ +SELECT s, arr, a, mapped FROM arrays_test ARRAY JOIN arr AS a, arrayMap(x -> x + 1, arr) AS mapped diff --git a/dbms/tests/queries/00013_a_select_from_table_with_arrays.reference b/dbms/tests/queries/00013_a_select_from_table_with_arrays.reference new file mode 100644 index 00000000000..14686f65be3 --- /dev/null +++ b/dbms/tests/queries/00013_a_select_from_table_with_arrays.reference @@ -0,0 +1,5 @@ +Hello [1,2] 1 1 2 +Hello [1,2] 2 2 3 +World [3,4,5] 3 1 4 +World [3,4,5] 4 2 5 +World [3,4,5] 5 3 6 diff --git a/dbms/tests/queries/00013_a_select_from_table_with_arrays.sql b/dbms/tests/queries/00013_a_select_from_table_with_arrays.sql new file mode 100644 index 00000000000..1c4b2b02e19 --- /dev/null +++ b/dbms/tests/queries/00013_a_select_from_table_with_arrays.sql @@ -0,0 +1 @@ +SELECT s, arr, a, num, mapped FROM arrays_test ARRAY JOIN arr AS a, arrayEnumerate(arr) AS num, arrayMap(x -> x + 1, arr) AS mapped diff --git a/dbms/tests/queries/00014_1_drop_if_exists_table_with_nested.reference b/dbms/tests/queries/00014_1_drop_if_exists_table_with_nested.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/queries/00014_1_drop_if_exists_table_with_nested.sql b/dbms/tests/queries/00014_1_drop_if_exists_table_with_nested.sql new file mode 100644 index 00000000000..257afc58919 --- /dev/null +++ b/dbms/tests/queries/00014_1_drop_if_exists_table_with_nested.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS nested_test diff --git a/dbms/tests/queries/00014_2_create_table_with_nested.reference b/dbms/tests/queries/00014_2_create_table_with_nested.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/queries/00014_2_create_table_with_nested.sql b/dbms/tests/queries/00014_2_create_table_with_nested.sql new file mode 100644 index 00000000000..49f015ce1aa --- /dev/null +++ b/dbms/tests/queries/00014_2_create_table_with_nested.sql @@ -0,0 +1 @@ +CREATE TABLE nested_test (s String, nest Nested(x UInt8, y UInt32)) ENGINE = Memory diff --git a/dbms/tests/queries/00014_3_insert_into_table_with_nested.reference b/dbms/tests/queries/00014_3_insert_into_table_with_nested.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/queries/00014_3_insert_into_table_with_nested.sql b/dbms/tests/queries/00014_3_insert_into_table_with_nested.sql new file mode 100644 index 00000000000..44fdbc820ff --- /dev/null +++ b/dbms/tests/queries/00014_3_insert_into_table_with_nested.sql @@ -0,0 +1 @@ +INSERT INTO nested_test VALUES ('Hello', [1,2], [10,20]), ('World', [3,4,5], [30,40,50]), ('Goodbye', [], []) diff --git a/dbms/tests/queries/00014_4_select_from_table_with_nested.reference b/dbms/tests/queries/00014_4_select_from_table_with_nested.reference new file mode 100644 index 00000000000..32bd08bad02 --- /dev/null +++ b/dbms/tests/queries/00014_4_select_from_table_with_nested.reference @@ -0,0 +1,3 @@ +Hello [1,2] [10,20] +World [3,4,5] [30,40,50] +Goodbye [] [] diff --git a/dbms/tests/queries/00014_4_select_from_table_with_nested.sql b/dbms/tests/queries/00014_4_select_from_table_with_nested.sql new file mode 100644 index 00000000000..509911959ac --- /dev/null +++ b/dbms/tests/queries/00014_4_select_from_table_with_nested.sql @@ -0,0 +1 @@ +SELECT * FROM nested_test diff --git a/dbms/tests/queries/00014_5_select_from_table_with_nested.reference b/dbms/tests/queries/00014_5_select_from_table_with_nested.reference new file mode 100644 index 00000000000..05200edd33b --- /dev/null +++ b/dbms/tests/queries/00014_5_select_from_table_with_nested.reference @@ -0,0 +1,5 @@ +Hello 1 10 +Hello 2 20 +World 3 30 +World 4 40 +World 5 50 diff --git a/dbms/tests/queries/00014_5_select_from_table_with_nested.sql b/dbms/tests/queries/00014_5_select_from_table_with_nested.sql new file mode 100644 index 00000000000..31e1ac1b05e --- /dev/null +++ b/dbms/tests/queries/00014_5_select_from_table_with_nested.sql @@ -0,0 +1 @@ +SELECT s, nest.x, nest.y FROM nested_test ARRAY JOIN nest diff --git a/dbms/tests/queries/00014_6_select_from_table_with_nested.reference b/dbms/tests/queries/00014_6_select_from_table_with_nested.reference new file mode 100644 index 00000000000..8ea4568b73c --- /dev/null +++ b/dbms/tests/queries/00014_6_select_from_table_with_nested.reference @@ -0,0 +1,5 @@ +Hello 1 [10,20] +Hello 2 [10,20] +World 3 [30,40,50] +World 4 [30,40,50] +World 5 [30,40,50] diff --git a/dbms/tests/queries/00014_6_select_from_table_with_nested.sql b/dbms/tests/queries/00014_6_select_from_table_with_nested.sql new file mode 100644 index 00000000000..3648cb4852c --- /dev/null +++ b/dbms/tests/queries/00014_6_select_from_table_with_nested.sql @@ -0,0 +1 @@ +SELECT s, nest.x, nest.y FROM nested_test ARRAY JOIN nest.x diff --git a/dbms/tests/queries/00014_7_select_from_table_with_nested.reference b/dbms/tests/queries/00014_7_select_from_table_with_nested.reference new file mode 100644 index 00000000000..05200edd33b --- /dev/null +++ b/dbms/tests/queries/00014_7_select_from_table_with_nested.reference @@ -0,0 +1,5 @@ +Hello 1 10 +Hello 2 20 +World 3 30 +World 4 40 +World 5 50 diff --git a/dbms/tests/queries/00014_7_select_from_table_with_nested.sql b/dbms/tests/queries/00014_7_select_from_table_with_nested.sql new file mode 100644 index 00000000000..9380d7d285f --- /dev/null +++ b/dbms/tests/queries/00014_7_select_from_table_with_nested.sql @@ -0,0 +1 @@ +SELECT s, nest.x, nest.y FROM nested_test ARRAY JOIN nest.x, nest.y \ No newline at end of file diff --git a/dbms/tests/queries/00014_9_select_from_table_with_nested.reference b/dbms/tests/queries/00014_9_select_from_table_with_nested.reference new file mode 100644 index 00000000000..05200edd33b --- /dev/null +++ b/dbms/tests/queries/00014_9_select_from_table_with_nested.reference @@ -0,0 +1,5 @@ +Hello 1 10 +Hello 2 20 +World 3 30 +World 4 40 +World 5 50 diff --git a/dbms/tests/queries/00014_9_select_from_table_with_nested.sql b/dbms/tests/queries/00014_9_select_from_table_with_nested.sql new file mode 100644 index 00000000000..945f3dc79a1 --- /dev/null +++ b/dbms/tests/queries/00014_9_select_from_table_with_nested.sql @@ -0,0 +1 @@ +SELECT s, n.x, n.y FROM nested_test ARRAY JOIN nest AS n \ No newline at end of file diff --git a/dbms/tests/queries/00014_a_select_from_table_with_nested.reference b/dbms/tests/queries/00014_a_select_from_table_with_nested.reference new file mode 100644 index 00000000000..d40754269c6 --- /dev/null +++ b/dbms/tests/queries/00014_a_select_from_table_with_nested.reference @@ -0,0 +1,5 @@ +Hello 1 10 [1,2] +Hello 2 20 [1,2] +World 3 30 [3,4,5] +World 4 40 [3,4,5] +World 5 50 [3,4,5] diff --git a/dbms/tests/queries/00014_a_select_from_table_with_nested.sql b/dbms/tests/queries/00014_a_select_from_table_with_nested.sql new file mode 100644 index 00000000000..4e275aa4e12 --- /dev/null +++ b/dbms/tests/queries/00014_a_select_from_table_with_nested.sql @@ -0,0 +1 @@ +SELECT s, n.x, n.y, nest.x FROM nested_test ARRAY JOIN nest AS n \ No newline at end of file diff --git a/dbms/tests/queries/00014_b_select_from_table_with_nested.reference b/dbms/tests/queries/00014_b_select_from_table_with_nested.reference new file mode 100644 index 00000000000..7129270657e --- /dev/null +++ b/dbms/tests/queries/00014_b_select_from_table_with_nested.reference @@ -0,0 +1,5 @@ +Hello 1 10 [1,2] [10,20] +Hello 2 20 [1,2] [10,20] +World 3 30 [3,4,5] [30,40,50] +World 4 40 [3,4,5] [30,40,50] +World 5 50 [3,4,5] [30,40,50] diff --git a/dbms/tests/queries/00014_b_select_from_table_with_nested.sql b/dbms/tests/queries/00014_b_select_from_table_with_nested.sql new file mode 100644 index 00000000000..4643e428942 --- /dev/null +++ b/dbms/tests/queries/00014_b_select_from_table_with_nested.sql @@ -0,0 +1 @@ +SELECT s, n.x, n.y, nest.x, nest.y FROM nested_test ARRAY JOIN nest AS n \ No newline at end of file diff --git a/dbms/tests/queries/00014_c_select_from_table_with_nested.reference b/dbms/tests/queries/00014_c_select_from_table_with_nested.reference new file mode 100644 index 00000000000..fa7a8052ce9 --- /dev/null +++ b/dbms/tests/queries/00014_c_select_from_table_with_nested.reference @@ -0,0 +1,5 @@ +Hello 1 10 [1,2] [10,20] 1 +Hello 2 20 [1,2] [10,20] 2 +World 3 30 [3,4,5] [30,40,50] 1 +World 4 40 [3,4,5] [30,40,50] 2 +World 5 50 [3,4,5] [30,40,50] 3 diff --git a/dbms/tests/queries/00014_c_select_from_table_with_nested.sql b/dbms/tests/queries/00014_c_select_from_table_with_nested.sql new file mode 100644 index 00000000000..6033dd1c011 --- /dev/null +++ b/dbms/tests/queries/00014_c_select_from_table_with_nested.sql @@ -0,0 +1 @@ +SELECT s, n.x, n.y, nest.x, nest.y, num FROM nested_test ARRAY JOIN nest AS n, arrayEnumerate(nest.x) AS num \ No newline at end of file diff --git a/dbms/tests/queries/00015_totals_having_constants.reference b/dbms/tests/queries/00015_totals_having_constants.reference new file mode 100644 index 00000000000..1b62b5f7c43 --- /dev/null +++ b/dbms/tests/queries/00015_totals_having_constants.reference @@ -0,0 +1,12 @@ +0 10 +1 10 +5 10 +7 10 +2 10 +6 10 +4 10 +8 10 +3 10 +9 10 + +0 100 diff --git a/dbms/tests/queries/00015_totals_having_constants.sql b/dbms/tests/queries/00015_totals_having_constants.sql new file mode 100644 index 00000000000..586bef3ac13 --- /dev/null +++ b/dbms/tests/queries/00015_totals_having_constants.sql @@ -0,0 +1 @@ +SELECT number, count() / 0.1 FROM (SELECT number FROM system.numbers LIMIT 10) GROUP BY number WITH TOTALS HAVING count() > 0.1 diff --git a/dbms/tests/queries/00016_totals_having_constants.reference b/dbms/tests/queries/00016_totals_having_constants.reference new file mode 100644 index 00000000000..4804131baba --- /dev/null +++ b/dbms/tests/queries/00016_totals_having_constants.reference @@ -0,0 +1,3 @@ +0 10 + +0 10 diff --git a/dbms/tests/queries/00016_totals_having_constants.sql b/dbms/tests/queries/00016_totals_having_constants.sql new file mode 100644 index 00000000000..c50659b8140 --- /dev/null +++ b/dbms/tests/queries/00016_totals_having_constants.sql @@ -0,0 +1 @@ +SELECT dummy, count() / 0.1 GROUP BY dummy WITH TOTALS HAVING count() > 0.1 diff --git a/dbms/tests/queries/00017_in_subquery_with_empty_result.reference b/dbms/tests/queries/00017_in_subquery_with_empty_result.reference new file mode 100644 index 00000000000..e25c5780b65 --- /dev/null +++ b/dbms/tests/queries/00017_in_subquery_with_empty_result.reference @@ -0,0 +1,18 @@ +{ + "meta": + [ + { + "name": "count()", + "type": "UInt64" + } + ], + + "data": + [ + + ], + + "rows": 0, + + "rows_before_limit_at_least": 1000 +} diff --git a/dbms/tests/queries/00017_in_subquery_with_empty_result.sql b/dbms/tests/queries/00017_in_subquery_with_empty_result.sql new file mode 100644 index 00000000000..b83d597159d --- /dev/null +++ b/dbms/tests/queries/00017_in_subquery_with_empty_result.sql @@ -0,0 +1,2 @@ +SELECT count() FROM (SELECT * FROM system.numbers LIMIT 1000) WHERE 1 IN (SELECT 0 WHERE 0) +FORMAT JSON diff --git a/dbms/tests/queries/00018_distinct_in_subquery.reference b/dbms/tests/queries/00018_distinct_in_subquery.reference new file mode 100644 index 00000000000..6ed281c757a --- /dev/null +++ b/dbms/tests/queries/00018_distinct_in_subquery.reference @@ -0,0 +1,2 @@ +1 +1 diff --git a/dbms/tests/queries/00018_distinct_in_subquery.sql b/dbms/tests/queries/00018_distinct_in_subquery.sql new file mode 100644 index 00000000000..b0bce846904 --- /dev/null +++ b/dbms/tests/queries/00018_distinct_in_subquery.sql @@ -0,0 +1 @@ +SELECT x FROM (SELECT DISTINCT 1 AS x, arrayJoin([1, 2]) AS y)