From 03247707737af0f76cacdd6b8b4544e1967f7ed9 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 8 Sep 2020 23:05:47 +0300 Subject: [PATCH] Remove all trailing whitespaces in tests sed -r -i \ -e 's/SELECT $/SELECT/' \ -e 's/SELECT DISTINCT $/SELECT DISTINCT/' \ -e 's/WITH $/WITH/' \ # zero matches, new test will be added -e 's/ARRAY JOIN $/ARRAY JOIN/' \ -e 's/GROUP BY $/GROUP BY/' \ -e 's/ORDER BY $/ORDER BY/' \ -e 's/LIMIT ([0-9]+) BY $/LIMIT \1 BY/' \ # zero matches, new test will be added tests/queries/*/*.sql \ tests/queries/*/*.reference (With except for tests/queries/0_stateless/00751_default_databasename_for_view.reference) --- .../00239_type_conversion_in_in.sql | 2 +- .../0_stateless/00250_tuple_comparison.sql | 2 +- .../00344_row_number_in_all_blocks.sql | 2 +- .../0_stateless/00436_convert_charset.sql | 4 +- .../00541_to_start_of_fifteen_minutes.sql | 4 +- .../00552_logical_functions_uint8_as_bool.sql | 2 +- ...ll_subquery_aggregation_column_removal.sql | 72 +++++----- .../00597_push_down_predicate.reference | 128 +++++++++--------- .../queries/0_stateless/00618_nullable_in.sql | 4 +- .../00712_prewhere_with_alias_bug_2.sql | 2 +- .../00740_optimize_predicate_expression.sql | 2 +- .../00743_limit_by_not_found_column.sql | 2 +- ...51_default_databasename_for_view.reference | 2 +- tests/queries/0_stateless/00759_kodieg.sql | 2 +- .../00826_cross_to_inner_join.reference | 16 +-- .../00849_multiple_comma_join.reference | 40 +++--- .../00849_multiple_comma_join_2.reference | 30 ++-- .../0_stateless/00908_analyze_query.reference | 2 +- .../0_stateless/00941_to_custom_week.sql | 2 +- ...0957_format_with_clashed_aliases.reference | 2 +- ...58_format_of_tuple_array_element.reference | 2 +- ...hecksums_in_system_parts_columns_table.sql | 2 +- .../01056_predicate_optimizer_bugs.reference | 26 ++-- ...76_predicate_optimizer_with_view.reference | 4 +- .../01083_cross_to_inner_with_like.reference | 6 +- .../0_stateless/01117_chain_finalize_bug.sql | 2 +- .../01250_fixed_string_comparison.sql | 2 +- ...ithmetic_operations_in_aggr_func.reference | 84 ++++++------ .../01272_totals_and_filter_bug.sql | 6 +- .../01278_format_multiple_queries.reference | 4 +- .../01300_group_by_other_keys.reference | 18 +-- ...01300_group_by_other_keys_having.reference | 8 +- ...egate_functions_of_group_by_keys.reference | 28 ++-- ...monotonous_functions_in_order_by.reference | 12 +- .../01322_any_input_optimize.reference | 4 +- ..._redundant_functions_in_order_by.reference | 30 ++-- .../01355_defaultValueOfArgumentType_bug.sql | 2 +- .../01372_wrong_order_by_removal.reference | 6 +- .../01379_with_fill_several_columns.sql | 8 +- .../01390_remove_injective_in_uniq.reference | 28 ++-- ...dicate_when_contains_with_clause.reference | 4 +- .../0_stateless/01418_index_analysis_bug.sql | 4 +- ..._duplicate_distinct_optimization.reference | 28 ++-- .../01470_columns_transformers.reference | 22 +-- .../1_stateful/00063_loyalty_joins.sql | 20 +-- 45 files changed, 341 insertions(+), 341 deletions(-) diff --git a/tests/queries/0_stateless/00239_type_conversion_in_in.sql b/tests/queries/0_stateless/00239_type_conversion_in_in.sql index 6e76a31ac56..5589d91ce74 100644 --- a/tests/queries/0_stateless/00239_type_conversion_in_in.sql +++ b/tests/queries/0_stateless/00239_type_conversion_in_in.sql @@ -2,7 +2,7 @@ select 1 as x, x = 1 or x = 2 or x = 3 or x = -1; select 1 as x, x = 1.0 or x = 2 or x = 3 or x = -1; select 1 as x, x = 1.5 or x = 2 or x = 3 or x = -1; -SELECT +SELECT 1 IN (1, -1, 2.0, 2.5), 1.0 IN (1, -1, 2.0, 2.5), 1 IN (1.0, -1, 2.0, 2.5), diff --git a/tests/queries/0_stateless/00250_tuple_comparison.sql b/tests/queries/0_stateless/00250_tuple_comparison.sql index 2ee29ef5863..03a4d23a271 100644 --- a/tests/queries/0_stateless/00250_tuple_comparison.sql +++ b/tests/queries/0_stateless/00250_tuple_comparison.sql @@ -1,4 +1,4 @@ -SELECT +SELECT (1, 'Hello', 23) = (1, 'Hello', 23), (1, 'Hello', 23) != (1, 'Hello', 23), (1, 'Hello', 23) < (1, 'Hello', 23), diff --git a/tests/queries/0_stateless/00344_row_number_in_all_blocks.sql b/tests/queries/0_stateless/00344_row_number_in_all_blocks.sql index 865d0084ce8..43727f2a14e 100644 --- a/tests/queries/0_stateless/00344_row_number_in_all_blocks.sql +++ b/tests/queries/0_stateless/00344_row_number_in_all_blocks.sql @@ -1,5 +1,5 @@ SET max_block_size = 1000; -SELECT +SELECT groupUniqArray(blockSize()), uniqExact(rowNumberInAllBlocks()), min(rowNumberInAllBlocks()), diff --git a/tests/queries/0_stateless/00436_convert_charset.sql b/tests/queries/0_stateless/00436_convert_charset.sql index cba91fe67f4..1b7baf22450 100644 --- a/tests/queries/0_stateless/00436_convert_charset.sql +++ b/tests/queries/0_stateless/00436_convert_charset.sql @@ -1,4 +1,4 @@ -SELECT +SELECT 'абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ' AS orig, hex(convertCharset(orig, 'utf-8', 'cp1251') AS cp1251) AS cp1251_hex, hex(convertCharset(orig, 'utf-8', 'utf-7')) AS utf7_hex, @@ -13,7 +13,7 @@ SELECT convertCharset(broken3, 'utf-8', 'koi8-r') AS restored3 FORMAT Vertical; -SELECT +SELECT materialize('абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ') AS orig, hex(convertCharset(orig, 'utf-8', 'cp1251') AS cp1251) AS cp1251_hex, hex(convertCharset(orig, 'utf-8', 'utf-7')) AS utf7_hex, diff --git a/tests/queries/0_stateless/00541_to_start_of_fifteen_minutes.sql b/tests/queries/0_stateless/00541_to_start_of_fifteen_minutes.sql index 29056eea3d6..0c20670fad2 100644 --- a/tests/queries/0_stateless/00541_to_start_of_fifteen_minutes.sql +++ b/tests/queries/0_stateless/00541_to_start_of_fifteen_minutes.sql @@ -1,7 +1,7 @@ -SELECT +SELECT DISTINCT result FROM ( - SELECT + SELECT toStartOfFifteenMinutes(toDateTime('2017-12-25 00:00:00') + number * 60) AS result FROM system.numbers LIMIT 120 diff --git a/tests/queries/0_stateless/00552_logical_functions_uint8_as_bool.sql b/tests/queries/0_stateless/00552_logical_functions_uint8_as_bool.sql index feee33add1c..f62a02288ed 100644 --- a/tests/queries/0_stateless/00552_logical_functions_uint8_as_bool.sql +++ b/tests/queries/0_stateless/00552_logical_functions_uint8_as_bool.sql @@ -10,7 +10,7 @@ SELECT 1 OR 2 OR 4 ; -SELECT +SELECT toUInt8(bitAnd(number, 4)) AS a, toUInt8(bitAnd(number, 2)) AS b, toUInt8(bitAnd(number, 1)) AS c, diff --git a/tests/queries/0_stateless/00585_union_all_subquery_aggregation_column_removal.sql b/tests/queries/0_stateless/00585_union_all_subquery_aggregation_column_removal.sql index 47e6582134a..bf5d2251470 100644 --- a/tests/queries/0_stateless/00585_union_all_subquery_aggregation_column_removal.sql +++ b/tests/queries/0_stateless/00585_union_all_subquery_aggregation_column_removal.sql @@ -8,19 +8,19 @@ INSERT INTO clicks VALUES ('facebook.com'), ('yandex.ru'), ('google.com'); INSERT INTO transactions VALUES ('facebook.com'), ('yandex.ru'), ('baidu.com'); -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain FROM transactions GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain @@ -33,19 +33,19 @@ LIMIT 10 FORMAT JSONEachRow; -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain FROM clicks GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain @@ -60,19 +60,19 @@ FORMAT JSONEachRow; SELECT DISTINCT * FROM ( -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain FROM transactions GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain @@ -85,19 +85,19 @@ LIMIT 10 UNION ALL -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain FROM clicks GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain @@ -112,20 +112,20 @@ LIMIT 10 SELECT DISTINCT total, domain FROM ( -SELECT +SELECT sum(total_count) AS total, sum(facebookHits) AS facebook, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain FROM transactions GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain @@ -138,20 +138,20 @@ LIMIT 10 UNION ALL -SELECT +SELECT sum(total_count) AS total, max(facebookHits) AS facebook, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain FROM clicks GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain @@ -167,19 +167,19 @@ ORDER BY domain, total; SELECT * FROM ( -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain FROM transactions GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain @@ -192,19 +192,19 @@ LIMIT 10 ) js1 ALL FULL OUTER JOIN ( -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain FROM clicks GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain @@ -221,19 +221,19 @@ ORDER BY total, domain; SELECT total FROM ( -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain FROM transactions GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain @@ -246,19 +246,19 @@ LIMIT 10 ) js1 ALL FULL OUTER JOIN ( -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain FROM clicks GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain @@ -275,19 +275,19 @@ ORDER BY total, domain; SELECT domain FROM ( -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain FROM transactions GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain @@ -300,19 +300,19 @@ LIMIT 10 ) js1 ALL FULL OUTER JOIN ( -SELECT +SELECT sum(total_count) AS total, domain FROM ( - SELECT + SELECT COUNT(*) AS total_count, SUM(if(domain = 'facebook.com', 1, 0)) AS facebookHits, domain FROM clicks GROUP BY domain UNION ALL - SELECT + SELECT COUNT(*) AS total_count, toUInt64(0) AS facebookHits, domain diff --git a/tests/queries/0_stateless/00597_push_down_predicate.reference b/tests/queries/0_stateless/00597_push_down_predicate.reference index 1798c727088..83f783138a0 100644 --- a/tests/queries/0_stateless/00597_push_down_predicate.reference +++ b/tests/queries/0_stateless/00597_push_down_predicate.reference @@ -7,18 +7,18 @@ SELECT count() FROM ( - SELECT + SELECT [number] AS a, [number * 2] AS b FROM system.numbers LIMIT 1 ) AS t -ARRAY JOIN +ARRAY JOIN a, b WHERE NOT ignore(a + b) 1 -SELECT +SELECT a, b FROM @@ -27,17 +27,17 @@ FROM ) ANY LEFT JOIN ( - SELECT + SELECT 1 AS a, 1 AS b ) USING (a) WHERE b = 0 -SELECT +SELECT a, b FROM ( - SELECT + SELECT 1 AS a, 1 AS b ) @@ -46,7 +46,7 @@ ANY RIGHT JOIN SELECT 1 AS a ) USING (a) WHERE b = 0 -SELECT +SELECT a, b FROM @@ -55,17 +55,17 @@ FROM ) ANY FULL OUTER JOIN ( - SELECT + SELECT 1 AS a, 1 AS b ) USING (a) WHERE b = 0 -SELECT +SELECT a, b FROM ( - SELECT + SELECT 1 AS a, 1 AS b ) @@ -107,22 +107,22 @@ FROM ) WHERE id = 1 1 -SELECT +SELECT id, subquery FROM ( - SELECT + SELECT 1 AS id, CAST(1, \'UInt8\') AS subquery ) 1 1 -SELECT +SELECT a, b FROM ( - SELECT + SELECT toUInt64(sum(id) AS b) AS a, b FROM test_00597 @@ -130,20 +130,20 @@ FROM ) WHERE a = 3 3 3 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, name, value, min(id) AS id FROM test_00597 - GROUP BY + GROUP BY date, name, value @@ -151,12 +151,12 @@ FROM ) WHERE id = 1 2000-01-01 1 test string 1 1 -SELECT +SELECT a, b FROM ( - SELECT + SELECT toUInt64(sum(id) AS b) AS a, b FROM test_00597 AS table_alias @@ -164,14 +164,14 @@ FROM ) AS outer_table_alias WHERE b = 3 3 3 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, @@ -181,21 +181,21 @@ FROM ) WHERE id = 1 2000-01-01 1 test string 1 1 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, @@ -207,21 +207,21 @@ FROM ) WHERE id = 1 2000-01-01 1 test string 1 1 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, @@ -233,14 +233,14 @@ FROM ) WHERE id = 1 2000-01-01 1 test string 1 1 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, @@ -250,21 +250,21 @@ FROM ) WHERE id = 1 2000-01-01 1 test string 1 1 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, @@ -276,14 +276,14 @@ FROM ) WHERE id = 1 2000-01-01 1 test string 1 1 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, @@ -293,21 +293,21 @@ FROM ) AS b WHERE id = 1 2000-01-01 1 test string 1 1 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, @@ -319,32 +319,32 @@ FROM ) AS b WHERE id = 1 2000-01-01 1 test string 1 1 -SELECT +SELECT id, date, value FROM ( - SELECT + SELECT id, date, min(value) AS value FROM test_00597 WHERE id = 1 - GROUP BY + GROUP BY id, date ) WHERE id = 1 1 2000-01-01 1 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, @@ -352,7 +352,7 @@ FROM FROM test_00597 WHERE id = 1 UNION ALL - SELECT + SELECT date, id, name, @@ -363,7 +363,7 @@ FROM WHERE id = 1 2000-01-01 1 test string 1 1 2000-01-01 1 test string 1 1 -SELECT +SELECT date, id, name, @@ -373,7 +373,7 @@ SELECT value FROM ( - SELECT + SELECT date, id, name, @@ -388,7 +388,7 @@ ANY LEFT JOIN ) USING (id) WHERE id = 1 2000-01-01 1 test string 1 1 2000-01-01 test string 1 1 -SELECT +SELECT id, date, name, @@ -399,7 +399,7 @@ FROM ) ANY LEFT JOIN ( - SELECT + SELECT date, id, name, @@ -416,14 +416,14 @@ FROM ANY LEFT JOIN test_00597 AS b USING (id) WHERE value = 1 1 -SELECT +SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, @@ -433,7 +433,7 @@ FROM value FROM ( - SELECT + SELECT date, id, name, @@ -450,7 +450,7 @@ FROM ) WHERE id = 1 2000-01-01 1 test string 1 1 -SELECT +SELECT date, id, name, @@ -460,7 +460,7 @@ SELECT b.value FROM ( - SELECT + SELECT date, id, name, @@ -469,7 +469,7 @@ FROM ) ANY LEFT JOIN ( - SELECT + SELECT date, id, name, @@ -478,14 +478,14 @@ ANY LEFT JOIN ) AS b USING (id) WHERE b.id = 1 2000-01-01 1 test string 1 1 2000-01-01 test string 1 1 -SELECT +SELECT id, date, name, value FROM ( - SELECT + SELECT toInt8(1) AS id, toDate(\'2000-01-01\') AS date FROM system.numbers @@ -493,7 +493,7 @@ FROM ) ANY LEFT JOIN ( - SELECT + SELECT date, id, name, @@ -502,7 +502,7 @@ ANY LEFT JOIN ) AS b USING (date, id) WHERE b.date = toDate(\'2000-01-01\') 1 2000-01-01 test string 1 1 -SELECT +SELECT date, id, name, @@ -513,7 +513,7 @@ SELECT `b.value` FROM ( - SELECT + SELECT date, id, name, @@ -524,7 +524,7 @@ FROM b.value FROM ( - SELECT + SELECT date, id, name, @@ -534,7 +534,7 @@ FROM ) AS a ANY LEFT JOIN ( - SELECT + SELECT date, id, name, @@ -545,7 +545,7 @@ FROM ) WHERE id = 1 2000-01-01 1 test string 1 1 2000-01-01 1 test string 1 1 -SELECT +SELECT date, id, name, @@ -555,7 +555,7 @@ SELECT r.value FROM ( - SELECT + SELECT date, id, name, @@ -564,14 +564,14 @@ FROM ) SEMI LEFT JOIN ( - SELECT + SELECT date, id, name, value FROM ( - SELECT + SELECT date, id, name, diff --git a/tests/queries/0_stateless/00618_nullable_in.sql b/tests/queries/0_stateless/00618_nullable_in.sql index 8e8c26d225d..72e166dc0f5 100644 --- a/tests/queries/0_stateless/00618_nullable_in.sql +++ b/tests/queries/0_stateless/00618_nullable_in.sql @@ -1,13 +1,13 @@ SELECT sum(toNullable('a') IN 'a'); SELECT countIf(number, toNullable('a') IN ('a', 'b')) FROM numbers(100); -SELECT +SELECT uniqExact(x) AS u, uniqExactIf(x, name = 'a') AS ue, uniqExactIf(x, name IN ('a', 'b')) AS ui FROM ( - SELECT + SELECT toNullable('a') AS name, arrayJoin(range(10)) AS x ) diff --git a/tests/queries/0_stateless/00712_prewhere_with_alias_bug_2.sql b/tests/queries/0_stateless/00712_prewhere_with_alias_bug_2.sql index 2c5c494fc1f..97d5e33633a 100644 --- a/tests/queries/0_stateless/00712_prewhere_with_alias_bug_2.sql +++ b/tests/queries/0_stateless/00712_prewhere_with_alias_bug_2.sql @@ -4,7 +4,7 @@ CREATE TABLE table (a UInt32, date Date, b UInt64, c UInt64, str String, d Int SELECT alias2 AS alias3 FROM table -ARRAY JOIN +ARRAY JOIN arr_alias AS alias2, arrayEnumerateUniq(arr_alias) AS _uniq_Event WHERE (date = toDate('2010-10-10')) AND (a IN (2, 3)) AND (str NOT IN ('z', 'x')) AND (d != -1) diff --git a/tests/queries/0_stateless/00740_optimize_predicate_expression.sql b/tests/queries/0_stateless/00740_optimize_predicate_expression.sql index b016ab49ddd..65b06635808 100644 --- a/tests/queries/0_stateless/00740_optimize_predicate_expression.sql +++ b/tests/queries/0_stateless/00740_optimize_predicate_expression.sql @@ -5,7 +5,7 @@ SELECT * FROM (SELECT perf_1.z AS z_1 FROM perf AS perf_1); SELECT sum(mul)/sqrt(sum(sqr_dif_1) * sum(sqr_dif_2)) AS z_r FROM( -SELECT +SELECT (SELECT avg(z_1) AS z_1_avg, avg(z_2) AS z_2_avg FROM ( diff --git a/tests/queries/0_stateless/00743_limit_by_not_found_column.sql b/tests/queries/0_stateless/00743_limit_by_not_found_column.sql index 46c6bcb99b2..d20b3b0209e 100644 --- a/tests/queries/0_stateless/00743_limit_by_not_found_column.sql +++ b/tests/queries/0_stateless/00743_limit_by_not_found_column.sql @@ -24,7 +24,7 @@ CREATE TEMPORARY TABLE Accounts (AccountID UInt64, Currency String); SELECT AccountID FROM ( - SELECT + SELECT AccountID, Currency FROM Accounts diff --git a/tests/queries/0_stateless/00751_default_databasename_for_view.reference b/tests/queries/0_stateless/00751_default_databasename_for_view.reference index 4814cc77b37..76d5cee02e2 100644 --- a/tests/queries/0_stateless/00751_default_databasename_for_view.reference +++ b/tests/queries/0_stateless/00751_default_databasename_for_view.reference @@ -7,7 +7,7 @@ CREATE MATERIALIZED VIEW test_00751.t_mv_00751 ENGINE = MergeTree ORDER BY date SETTINGS index_granularity = 8192 AS -SELECT +SELECT date, platform, app diff --git a/tests/queries/0_stateless/00759_kodieg.sql b/tests/queries/0_stateless/00759_kodieg.sql index 2037f210dea..9cbe2a0cd7f 100644 --- a/tests/queries/0_stateless/00759_kodieg.sql +++ b/tests/queries/0_stateless/00759_kodieg.sql @@ -1,4 +1,4 @@ -SELECT +SELECT [1, 2, 3, 1, 3] AS a, indexOf(arrayReverse(arraySlice(a, 1, -1)), 3) AS offset_from_right, arraySlice(a, multiIf(offset_from_right = 0, 1, (length(a) - offset_from_right) + 1)); diff --git a/tests/queries/0_stateless/00826_cross_to_inner_join.reference b/tests/queries/0_stateless/00826_cross_to_inner_join.reference index 6e5cbdcab4e..e7c8d6b1ea9 100644 --- a/tests/queries/0_stateless/00826_cross_to_inner_join.reference +++ b/tests/queries/0_stateless/00826_cross_to_inner_join.reference @@ -35,7 +35,7 @@ comma nullable 1 1 1 1 2 2 1 2 cross -SELECT +SELECT a, b, t2_00826.a, @@ -44,7 +44,7 @@ FROM t1_00826 ALL INNER JOIN t2_00826 ON a = t2_00826.a WHERE a = t2_00826.a cross nullable -SELECT +SELECT a, b, t2_00826.a, @@ -53,7 +53,7 @@ FROM t1_00826 ALL INNER JOIN t2_00826 ON a = t2_00826.a WHERE a = t2_00826.a cross nullable vs not nullable -SELECT +SELECT a, b, t2_00826.a, @@ -62,7 +62,7 @@ FROM t1_00826 ALL INNER JOIN t2_00826 ON a = t2_00826.b WHERE a = t2_00826.b cross self -SELECT +SELECT a, b, y.a, @@ -71,7 +71,7 @@ FROM t1_00826 AS x ALL INNER JOIN t1_00826 AS y ON (a = y.a) AND (b = y.b) WHERE (a = y.a) AND (b = y.b) cross one table expr -SELECT +SELECT a, b, t2_00826.a, @@ -80,7 +80,7 @@ FROM t1_00826 CROSS JOIN t2_00826 WHERE a = b cross multiple ands -SELECT +SELECT a, b, t2_00826.a, @@ -89,7 +89,7 @@ FROM t1_00826 ALL INNER JOIN t2_00826 ON (a = t2_00826.a) AND (b = t2_00826.b) WHERE (a = t2_00826.a) AND (b = t2_00826.b) cross and inside and -SELECT +SELECT a, b, t2_00826.a, @@ -98,7 +98,7 @@ FROM t1_00826 ALL INNER JOIN t2_00826 ON (a = t2_00826.a) AND (a = t2_00826.a) AND (a = t2_00826.a) AND (b = t2_00826.b) WHERE (a = t2_00826.a) AND ((a = t2_00826.a) AND ((a = t2_00826.a) AND (b = t2_00826.b))) cross split conjunction -SELECT +SELECT a, b, t2_00826.a, diff --git a/tests/queries/0_stateless/00849_multiple_comma_join.reference b/tests/queries/0_stateless/00849_multiple_comma_join.reference index 5a5a90cbdf2..f4db2238dd1 100644 --- a/tests/queries/0_stateless/00849_multiple_comma_join.reference +++ b/tests/queries/0_stateless/00849_multiple_comma_join.reference @@ -12,7 +12,7 @@ WHERE b = t2_00849.b SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a AS `--t2_00849.a`, @@ -25,7 +25,7 @@ WHERE (`--t1_00849.a` = `--t2_00849.a`) AND (`--t1_00849.a` = a) SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b AS `--t1_00849.b`, t2_00849.a, @@ -38,7 +38,7 @@ WHERE (`--t1_00849.b` = `--t2_00849.b`) AND (`--t1_00849.b` = b) SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT `--t1_00849.a`, b, `--t2_00849.a`, @@ -47,7 +47,7 @@ FROM t3_00849.b FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a AS `--t2_00849.a`, @@ -62,7 +62,7 @@ WHERE (`--t1_00849.a` = `--t2_00849.a`) AND (`--t1_00849.a` = `--t3_00849.a`) AN SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT `--t1_00849.a`, `--t1_00849.b`, `t2_00849.a`, @@ -71,7 +71,7 @@ FROM b AS `--t3_00849.b` FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b AS `--t1_00849.b`, t2_00849.a, @@ -86,7 +86,7 @@ WHERE (`--t1_00849.b` = `--t2_00849.b`) AND (`--t1_00849.b` = `--t3_00849.b`) AN SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT `--t1_00849.a`, b, `--t2_00849.a`, @@ -95,7 +95,7 @@ FROM t3_00849.b FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a AS `--t2_00849.a`, @@ -110,7 +110,7 @@ WHERE (`--t2_00849.a` = `--t1_00849.a`) AND (`--t2_00849.a` = `--t3_00849.a`) AN SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT `--t1_00849.a`, b, `--t2_00849.a`, @@ -119,7 +119,7 @@ FROM t3_00849.b FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a AS `--t2_00849.a`, @@ -134,7 +134,7 @@ WHERE (`--t3_00849.a` = `--t1_00849.a`) AND (`--t3_00849.a` = `--t2_00849.a`) AN SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT `--t1_00849.a`, b, `--t2_00849.a`, @@ -143,7 +143,7 @@ FROM t3_00849.b FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a AS `--t2_00849.a`, @@ -158,7 +158,7 @@ WHERE (a = `--t1_00849.a`) AND (a = `--t2_00849.a`) AND (a = `--t3_00849.a`) SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT `--t1_00849.a`, b, `--t2_00849.a`, @@ -167,7 +167,7 @@ FROM t3_00849.b FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a AS `--t2_00849.a`, @@ -182,7 +182,7 @@ WHERE (`--t1_00849.a` = `--t2_00849.a`) AND (`--t2_00849.a` = `--t3_00849.a`) AN SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT `--t1_00849.a`, b, `t2_00849.a`, @@ -191,7 +191,7 @@ FROM t3_00849.b FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a, @@ -205,7 +205,7 @@ CROSS JOIN t4_00849 SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT `--t1_00849.a`, b, `t2_00849.a`, @@ -214,7 +214,7 @@ FROM t3_00849.b FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a, @@ -228,7 +228,7 @@ CROSS JOIN t4_00849 SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a, @@ -240,7 +240,7 @@ CROSS JOIN t3_00849 SELECT `--t1_00849.a` AS `t1_00849.a` FROM ( - SELECT + SELECT a AS `--t1_00849.a`, b, t2_00849.a AS `--t2_00849.a`, diff --git a/tests/queries/0_stateless/00849_multiple_comma_join_2.reference b/tests/queries/0_stateless/00849_multiple_comma_join_2.reference index e08d6ff1192..fc39ef13935 100644 --- a/tests/queries/0_stateless/00849_multiple_comma_join_2.reference +++ b/tests/queries/0_stateless/00849_multiple_comma_join_2.reference @@ -12,7 +12,7 @@ WHERE b = t2.b SELECT `--t1.a` AS `t1.a` FROM ( - SELECT + SELECT a AS `--t1.a`, t2.a AS `--t2.a` FROM t1 @@ -23,7 +23,7 @@ WHERE (`--t1.a` = `--t2.a`) AND (`--t1.a` = a) SELECT `--t1.a` AS `t1.a` FROM ( - SELECT + SELECT b AS `--t1.b`, a AS `--t1.a`, t2.b AS `--t2.b` @@ -35,13 +35,13 @@ WHERE (`--t1.b` = `--t2.b`) AND (`--t1.b` = b) SELECT `--t1.a` AS `t1.a` FROM ( - SELECT + SELECT `--t1.a`, `--t2.a`, a AS `--t3.a` FROM ( - SELECT + SELECT a AS `--t1.a`, t2.a AS `--t2.a` FROM t1 @@ -54,14 +54,14 @@ WHERE (`--t1.a` = `--t2.a`) AND (`--t1.a` = `--t3.a`) AND (`--t1.a` = a) SELECT `--t1.a` AS `t1.a` FROM ( - SELECT + SELECT `--t1.b`, `--t1.a`, `--t2.b`, b AS `--t3.b` FROM ( - SELECT + SELECT b AS `--t1.b`, a AS `--t1.a`, t2.b AS `--t2.b` @@ -75,13 +75,13 @@ WHERE (`--t1.b` = `--t2.b`) AND (`--t1.b` = `--t3.b`) AND (`--t1.b` = b) SELECT `--t1.a` AS `t1.a` FROM ( - SELECT + SELECT `--t1.a`, `--t2.a`, a AS `--t3.a` FROM ( - SELECT + SELECT a AS `--t1.a`, t2.a AS `--t2.a` FROM t1 @@ -94,13 +94,13 @@ WHERE (`--t2.a` = `--t1.a`) AND (`--t2.a` = `--t3.a`) AND (`--t2.a` = a) SELECT `--t1.a` AS `t1.a` FROM ( - SELECT + SELECT `--t1.a`, `--t2.a`, a AS `--t3.a` FROM ( - SELECT + SELECT a AS `--t1.a`, t2.a AS `--t2.a` FROM t1 @@ -113,13 +113,13 @@ WHERE (`--t3.a` = `--t1.a`) AND (`--t3.a` = `--t2.a`) AND (`--t3.a` = a) SELECT `--t1.a` AS `t1.a` FROM ( - SELECT + SELECT `--t1.a`, `--t2.a`, a AS `--t3.a` FROM ( - SELECT + SELECT a AS `--t1.a`, t2.a AS `--t2.a` FROM t1 @@ -132,13 +132,13 @@ WHERE (a = `--t1.a`) AND (a = `--t2.a`) AND (a = `--t3.a`) SELECT `--t1.a` AS `t1.a` FROM ( - SELECT + SELECT `--t1.a`, `--t2.a`, a AS `--t3.a` FROM ( - SELECT + SELECT a AS `--t1.a`, t2.a AS `--t2.a` FROM t1 @@ -185,7 +185,7 @@ CROSS JOIN t3 SELECT `--t1.a` AS `t1.a` FROM ( - SELECT + SELECT a AS `--t1.a`, t2.a AS `--t2.a` FROM t1 diff --git a/tests/queries/0_stateless/00908_analyze_query.reference b/tests/queries/0_stateless/00908_analyze_query.reference index 0305f528b25..ab9237531f7 100644 --- a/tests/queries/0_stateless/00908_analyze_query.reference +++ b/tests/queries/0_stateless/00908_analyze_query.reference @@ -1,4 +1,4 @@ -SELECT +SELECT a, b FROM a diff --git a/tests/queries/0_stateless/00941_to_custom_week.sql b/tests/queries/0_stateless/00941_to_custom_week.sql index a6ff40a6d3f..c7d52e7438b 100644 --- a/tests/queries/0_stateless/00941_to_custom_week.sql +++ b/tests/queries/0_stateless/00941_to_custom_week.sql @@ -25,7 +25,7 @@ SELECT toWeek(toDate('2001-01-01'),0) AS w0, toWeek(toDate('2001-01-01'),1) AS w SELECT toYearWeek(toDate('2000-12-31'),0), toYearWeek(toDate('2000-12-31'),1), toYearWeek(toDate('2000-12-31'),2), toYearWeek(toDate('2000-12-31'),3), toYearWeek(toDate('2000-12-31'),4), toYearWeek(toDate('2000-12-31'),5), toYearWeek(toDate('2000-12-31'),6), toYearWeek(toDate('2000-12-31'),7); -- week mode 8,9 -SELECT +SELECT toDate('2016-12-21') + number AS d, toWeek(d, 8) AS week8, toWeek(d, 9) AS week9, diff --git a/tests/queries/0_stateless/00957_format_with_clashed_aliases.reference b/tests/queries/0_stateless/00957_format_with_clashed_aliases.reference index d1c8033b363..d6e53c8b48b 100644 --- a/tests/queries/0_stateless/00957_format_with_clashed_aliases.reference +++ b/tests/queries/0_stateless/00957_format_with_clashed_aliases.reference @@ -1,4 +1,4 @@ -SELECT +SELECT 1 AS x, x.y FROM diff --git a/tests/queries/0_stateless/00958_format_of_tuple_array_element.reference b/tests/queries/0_stateless/00958_format_of_tuple_array_element.reference index eaea02ba40b..a2953fa0264 100644 --- a/tests/queries/0_stateless/00958_format_of_tuple_array_element.reference +++ b/tests/queries/0_stateless/00958_format_of_tuple_array_element.reference @@ -1,4 +1,4 @@ -SELECT +SELECT (x.1)[1], (((x[1]).1)[1]).1, (NOT x)[1], diff --git a/tests/queries/0_stateless/00961_checksums_in_system_parts_columns_table.sql b/tests/queries/0_stateless/00961_checksums_in_system_parts_columns_table.sql index b9eed1e8183..3b99ebf8b22 100644 --- a/tests/queries/0_stateless/00961_checksums_in_system_parts_columns_table.sql +++ b/tests/queries/0_stateless/00961_checksums_in_system_parts_columns_table.sql @@ -4,7 +4,7 @@ CREATE TABLE test_00961 (d Date, a String, b UInt8, x String, y Int8, z UInt32) INSERT INTO test_00961 VALUES ('2000-01-01', 'Hello, world!', 123, 'xxx yyy', -123, 123456789); -SELECT +SELECT name, table, hash_of_all_files, diff --git a/tests/queries/0_stateless/01056_predicate_optimizer_bugs.reference b/tests/queries/0_stateless/01056_predicate_optimizer_bugs.reference index fd9d96bdf5f..4227af86be7 100644 --- a/tests/queries/0_stateless/01056_predicate_optimizer_bugs.reference +++ b/tests/queries/0_stateless/01056_predicate_optimizer_bugs.reference @@ -1,11 +1,11 @@ -SELECT +SELECT k, v, d, i FROM ( - SELECT + SELECT t.1 AS k, t.2 AS v, runningDifference(v) AS d, @@ -21,26 +21,26 @@ a 2 1 0 a 3 1 0 b 13 2 0 b 15 2 0 -SELECT +SELECT co, co2, co3, num FROM ( - SELECT + SELECT co, co2, co3, count() AS num FROM ( - SELECT + SELECT 1 AS co, 2 AS co2, 3 AS co3 ) - GROUP BY + GROUP BY co, co2, co3 @@ -84,7 +84,7 @@ FROM ) WHERE ccc > 1 2 -SELECT +SELECT ts, id, id_b, @@ -93,7 +93,7 @@ SELECT id_c FROM ( - SELECT + SELECT ts, id, id_b @@ -102,7 +102,7 @@ FROM ) AS a ALL LEFT JOIN B AS b ON b.id = id_b WHERE ts <= toDateTime(\'1970-01-01 03:00:00\') -SELECT +SELECT ts AS `--a.ts`, id AS `--a.id`, id_b AS `--a.id_b`, @@ -111,7 +111,7 @@ SELECT id_c AS `--b.id_c` FROM ( - SELECT + SELECT ts, id, id_b @@ -137,19 +137,19 @@ FROM ) WHERE arrayMap(x -> (x + 1), [dummy]) = [1] 0 -SELECT +SELECT id, value, value_1 FROM ( - SELECT + SELECT 1 AS id, 2 AS value ) ALL INNER JOIN ( - SELECT + SELECT 1 AS id, 3 AS value_1 ) USING (id) diff --git a/tests/queries/0_stateless/01076_predicate_optimizer_with_view.reference b/tests/queries/0_stateless/01076_predicate_optimizer_with_view.reference index d6426f679c5..dfab41b5e4c 100644 --- a/tests/queries/0_stateless/01076_predicate_optimizer_with_view.reference +++ b/tests/queries/0_stateless/01076_predicate_optimizer_with_view.reference @@ -1,4 +1,4 @@ -SELECT +SELECT date, id, name, @@ -10,7 +10,7 @@ FROM HAVING id = 1 ) AS test_view WHERE id = 1 -SELECT +SELECT date, id, name, diff --git a/tests/queries/0_stateless/01083_cross_to_inner_with_like.reference b/tests/queries/0_stateless/01083_cross_to_inner_with_like.reference index 5491e82c7d3..42bbeb05ecb 100644 --- a/tests/queries/0_stateless/01083_cross_to_inner_with_like.reference +++ b/tests/queries/0_stateless/01083_cross_to_inner_with_like.reference @@ -1,18 +1,18 @@ -SELECT +SELECT k, r.k, name FROM n ALL INNER JOIN r ON k = r.k WHERE (k = r.k) AND (name = \'A\') -SELECT +SELECT k, r.k, name FROM n ALL INNER JOIN r ON k = r.k WHERE (k = r.k) AND (name LIKE \'A%\') -SELECT +SELECT k, r.k, name diff --git a/tests/queries/0_stateless/01117_chain_finalize_bug.sql b/tests/queries/0_stateless/01117_chain_finalize_bug.sql index f79f82b8d4d..273b742d0bd 100644 --- a/tests/queries/0_stateless/01117_chain_finalize_bug.sql +++ b/tests/queries/0_stateless/01117_chain_finalize_bug.sql @@ -14,7 +14,7 @@ SET group_by_two_level_threshold = 2; SELECT count() FROM ( - SELECT + SELECT arrayJoin(arrayMap(i -> (i + 1), range(2))) AS index, number FROM numbers_mt(100000) diff --git a/tests/queries/0_stateless/01250_fixed_string_comparison.sql b/tests/queries/0_stateless/01250_fixed_string_comparison.sql index 8481b3572bb..d574fd082f0 100644 --- a/tests/queries/0_stateless/01250_fixed_string_comparison.sql +++ b/tests/queries/0_stateless/01250_fixed_string_comparison.sql @@ -1,5 +1,5 @@ WITH 'abb' AS b, 'abc' AS c, 'abd' AS d, toFixedString(b, 5) AS bf, toFixedString(c, 5) AS cf, toFixedString(d, 5) AS df -SELECT +SELECT b = b, b > b, b < b, b = c, b > c, b < c, b = d, b > d, b < d, diff --git a/tests/queries/0_stateless/01271_optimize_arithmetic_operations_in_aggr_func.reference b/tests/queries/0_stateless/01271_optimize_arithmetic_operations_in_aggr_func.reference index eeba2646046..669221005f4 100644 --- a/tests/queries/0_stateless/01271_optimize_arithmetic_operations_in_aggr_func.reference +++ b/tests/queries/0_stateless/01271_optimize_arithmetic_operations_in_aggr_func.reference @@ -1,4 +1,4 @@ -SELECT +SELECT sum(n + 1), sum(1 + n), sum(n - 1), @@ -8,7 +8,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum(n) * 2, 2 * sum(n), sum(n) / 2, @@ -18,7 +18,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(n) + 1, 1 + min(n), min(n) - 1, @@ -28,7 +28,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(n) * 2, 2 * min(n), min(n) / 2, @@ -38,7 +38,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(n) + 1, 1 + max(n), max(n) - 1, @@ -48,7 +48,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(n) * 2, 2 * max(n), max(n) / 2, @@ -58,7 +58,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum(n + -1), sum(-1 + n), sum(n - -1), @@ -68,7 +68,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum(n) * -2, -2 * sum(n), sum(n) / -2, @@ -78,7 +78,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(n) + -1, -1 + min(n), min(n) - -1, @@ -88,7 +88,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(n) * -2, -2 * max(n), max(n) / -2, @@ -98,7 +98,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(n) + -1, -1 + max(n), max(n) - -1, @@ -108,7 +108,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(n) * -2, -2 * min(n), min(n) / -2, @@ -118,7 +118,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum(abs(2) + 1), sum(abs(2) + n), sum(n - abs(2)), @@ -128,7 +128,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum(abs(2)) * 2, sum(abs(2) * n), sum(n / abs(2)), @@ -138,7 +138,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(abs(2)) + 1, min(abs(2) + n), min(n - abs(2)), @@ -148,7 +148,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(abs(2)) * 2, min(abs(2) * n), min(n / abs(2)), @@ -158,7 +158,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(abs(2)) + 1, max(abs(2) + n), max(n - abs(2)), @@ -168,7 +168,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(abs(2)) * 2, max(abs(2) * n), max(n / abs(2)), @@ -178,7 +178,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum(abs(n) + 1), sum(abs(n) + n), sum(n - abs(n)), @@ -188,7 +188,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum(abs(n)) * 2, sum(abs(n) * n), sum(n / abs(n)), @@ -198,7 +198,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(abs(n)) + 1, min(abs(n) + n), min(n - abs(n)), @@ -208,7 +208,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(abs(n)) * 2, min(abs(n) * n), min(n / abs(n)), @@ -218,7 +218,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(abs(n)) + 1, max(abs(n) + n), max(n - abs(n)), @@ -228,7 +228,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(abs(n)) * 2, max(abs(n) * n), max(n / abs(n)), @@ -238,7 +238,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum((n * n) + 1), sum(1 + (n * n)), sum((n * n) - 1), @@ -248,7 +248,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum(n * n) * 2, sum((2 * n) * n), sum(n * n) / 2, @@ -258,7 +258,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(n * n) + 1, 1 + min(n * n), min(n * n) - 1, @@ -268,7 +268,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT min(n * n) * 2, min((2 * n) * n), min(n * n) / 2, @@ -278,7 +278,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(n * n) + 1, 1 + max(n * n), max(n * n) - 1, @@ -288,7 +288,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT max(n * n) * 2, max((2 * n) * n), max(n * n) / 2, @@ -298,7 +298,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum((1 + n) + 1), sum((1 + 1) + n), sum((1 + n) - 1), @@ -308,7 +308,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum(1 + (n * 2)), sum(1 + (2 * n)), sum(1 + (n / 2)), @@ -318,7 +318,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT (1 + min(n)) + 1, min((1 + 1) + n), (1 + min(n)) - 1, @@ -328,7 +328,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT 1 + min(n * 2), 1 + min(2 * n), 1 + min(n / 2), @@ -338,7 +338,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT (1 + max(n)) + 1, max((1 + 1) + n), (1 + max(n)) - 1, @@ -348,7 +348,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT 1 + max(n * 2), 1 + max(2 * n), 1 + max(n / 2), @@ -358,7 +358,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT sum((n + -1) + -1), sum((-1 + n) + -1), sum((n - -1) + -1), @@ -368,7 +368,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT (sum(n) * -2) * -1, (-2 * sum(n)) * -1, (sum(n) / -2) / -1, @@ -378,7 +378,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT (min(n) + -1) + -1, (-1 + min(n)) + -1, (min(n) - -1) + -1, @@ -388,7 +388,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT (min(n) * -2) * -1, (-2 * min(n)) * -1, (min(n) / -2) / -1, @@ -398,7 +398,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT (max(n) + -1) + -1, (-1 + max(n)) + -1, (max(n) - -1) + -1, @@ -408,7 +408,7 @@ FROM SELECT number AS n FROM numbers(10) ) -SELECT +SELECT (max(n) * -2) * -1, (-2 * max(n)) * -1, (max(n) / -2) / -1, diff --git a/tests/queries/0_stateless/01272_totals_and_filter_bug.sql b/tests/queries/0_stateless/01272_totals_and_filter_bug.sql index a6082ae9f11..de751eb73bd 100644 --- a/tests/queries/0_stateless/01272_totals_and_filter_bug.sql +++ b/tests/queries/0_stateless/01272_totals_and_filter_bug.sql @@ -8,13 +8,13 @@ CREATE TABLE bar (server_date Date, dimension_1 String, metric_2 UInt32) ENGINE INSERT INTO foo VALUES ('2020-01-01', 'test1', 10), ('2020-01-01', 'test2', 20); INSERT INTO bar VALUES ('2020-01-01', 'test2', 30), ('2020-01-01', 'test3', 40); -SELECT +SELECT dimension_1, sum_metric_1, sum_metric_2 FROM ( - SELECT + SELECT dimension_1, sum(metric_1) AS sum_metric_1 FROM foo @@ -23,7 +23,7 @@ FROM ) AS subquery_1 ALL FULL OUTER JOIN ( - SELECT + SELECT dimension_1, sum(metric_2) AS sum_metric_2 FROM bar diff --git a/tests/queries/0_stateless/01278_format_multiple_queries.reference b/tests/queries/0_stateless/01278_format_multiple_queries.reference index b12e3b30f0c..001b10b0990 100644 --- a/tests/queries/0_stateless/01278_format_multiple_queries.reference +++ b/tests/queries/0_stateless/01278_format_multiple_queries.reference @@ -1,4 +1,4 @@ -SELECT +SELECT a, b AS x FROM table AS t @@ -6,7 +6,7 @@ INNER JOIN table2 AS t2 ON t.id = t2.t_id WHERE 1 = 1 ; -SELECT +SELECT a, b AS x, if(x = 0, a, b) diff --git a/tests/queries/0_stateless/01300_group_by_other_keys.reference b/tests/queries/0_stateless/01300_group_by_other_keys.reference index bd2372dca93..1db34d884a3 100644 --- a/tests/queries/0_stateless/01300_group_by_other_keys.reference +++ b/tests/queries/0_stateless/01300_group_by_other_keys.reference @@ -24,7 +24,7 @@ 3465735.9028 SELECT max(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY number % 2, number % 3, ((number % 2) + (number % 3)) % 2 @@ -35,19 +35,19 @@ GROUP BY number % 5 ORDER BY k ASC SELECT avg(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY (number % 2) * (number % 3), number % 3 ORDER BY k ASC SELECT avg(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY number % 3, number % 2 ORDER BY k ASC SELECT avg(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY (number % 2) % 3, number % 2 ORDER BY k ASC @@ -77,33 +77,33 @@ ORDER BY k ASC 3465735.9028 SELECT max(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY number % 2, number % 3, ((number % 2) + (number % 3)) % 2 ORDER BY k ASC SELECT avg(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY number % 5, (number % 5) * (number % 5) ORDER BY k ASC SELECT avg(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY (number % 2) * (number % 3), number % 3 ORDER BY k ASC SELECT avg(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY (number % 2) * (number % 3), number % 3, number % 2 ORDER BY k ASC SELECT avg(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY (number % 2) % 3, number % 2 ORDER BY k ASC diff --git a/tests/queries/0_stateless/01300_group_by_other_keys_having.reference b/tests/queries/0_stateless/01300_group_by_other_keys_having.reference index 0bec0ebdf9b..a470c19a244 100644 --- a/tests/queries/0_stateless/01300_group_by_other_keys_having.reference +++ b/tests/queries/0_stateless/01300_group_by_other_keys_having.reference @@ -9,7 +9,7 @@ 4 SELECT avg(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY number % 3, number % 2 HAVING avg(log(2) * number) > 3465735.3 @@ -35,7 +35,7 @@ ORDER BY k ASC 4 SELECT avg(log(2) * number) AS k FROM numbers(10000000) -GROUP BY +GROUP BY (number % 2) * (number % 3), number % 3, number % 2 @@ -44,14 +44,14 @@ ORDER BY k ASC SELECT avg(log(2) * number) AS k FROM numbers(10000000) WHERE ((number % 5) * (number % 5)) < 5 -GROUP BY +GROUP BY number % 5, (number % 5) * (number % 5) ORDER BY k ASC SELECT (number % 5) * (number % 5) AS k FROM numbers(10000000) WHERE ((number % 5) * (number % 5)) < 5 -GROUP BY +GROUP BY number % 5, (number % 5) * (number % 5) ORDER BY k ASC diff --git a/tests/queries/0_stateless/01321_aggregate_functions_of_group_by_keys.reference b/tests/queries/0_stateless/01321_aggregate_functions_of_group_by_keys.reference index 875a6753f84..92d6e5c37e6 100644 --- a/tests/queries/0_stateless/01321_aggregate_functions_of_group_by_keys.reference +++ b/tests/queries/0_stateless/01321_aggregate_functions_of_group_by_keys.reference @@ -47,29 +47,29 @@ 24 0 0 -SELECT +SELECT number % 2 AS a, number % 3 AS b FROM numbers(10000000) -GROUP BY +GROUP BY number % 2, number % 3 -ORDER BY +ORDER BY min(number % 2) AS a ASC, max(number % 3) AS b ASC -SELECT +SELECT number % 2 AS a, number % 3 AS b FROM numbers(10000000) -GROUP BY +GROUP BY number % 2, number % 3 -ORDER BY +ORDER BY any(number % 2) AS a ASC, anyLast(number % 3) AS b ASC SELECT (number % 5) * (number % 7) AS a FROM numbers(10000000) -GROUP BY +GROUP BY number % 7, number % 5 ORDER BY max((number % 5) * (number % 7)) AS a ASC @@ -128,29 +128,29 @@ FROM 20 24 0 -SELECT +SELECT min(number % 2) AS a, max(number % 3) AS b FROM numbers(10000000) -GROUP BY +GROUP BY number % 2, number % 3 -ORDER BY +ORDER BY a ASC, b ASC -SELECT +SELECT any(number % 2) AS a, anyLast(number % 3) AS b FROM numbers(10000000) -GROUP BY +GROUP BY number % 2, number % 3 -ORDER BY +ORDER BY a ASC, b ASC SELECT max((number % 5) * (number % 7)) AS a FROM numbers(10000000) -GROUP BY +GROUP BY number % 7, number % 5 ORDER BY a ASC diff --git a/tests/queries/0_stateless/01321_monotonous_functions_in_order_by.reference b/tests/queries/0_stateless/01321_monotonous_functions_in_order_by.reference index e8e7d754ed9..ffa91586f35 100644 --- a/tests/queries/0_stateless/01321_monotonous_functions_in_order_by.reference +++ b/tests/queries/0_stateless/01321_monotonous_functions_in_order_by.reference @@ -54,12 +54,12 @@ FROM numbers(3) ORDER BY exp(number) ASC SELECT roundToExp2(number) AS x FROM numbers(3) -ORDER BY +ORDER BY number ASC, number ASC SELECT number AS x FROM numbers(3) -ORDER BY +ORDER BY number ASC, number ASC SELECT number @@ -79,7 +79,7 @@ FROM numbers(3) ORDER BY exp(number) DESC SELECT roundToExp2(number) AS x FROM numbers(3) -ORDER BY +ORDER BY number DESC, number DESC 0 @@ -138,12 +138,12 @@ FROM numbers(3) ORDER BY exp(number) ASC SELECT roundToExp2(number) AS x FROM numbers(3) -ORDER BY +ORDER BY x ASC, toFloat32(x) ASC SELECT number AS x FROM numbers(3) -ORDER BY +ORDER BY toFloat32(x) AS k ASC, toFloat64(k) ASC SELECT number @@ -163,6 +163,6 @@ FROM numbers(3) ORDER BY exp(number) DESC SELECT roundToExp2(number) AS x FROM numbers(3) -ORDER BY +ORDER BY x DESC, toFloat32(x) DESC diff --git a/tests/queries/0_stateless/01322_any_input_optimize.reference b/tests/queries/0_stateless/01322_any_input_optimize.reference index c02c9fbeae4..f88f2f5937c 100644 --- a/tests/queries/0_stateless/01322_any_input_optimize.reference +++ b/tests/queries/0_stateless/01322_any_input_optimize.reference @@ -8,7 +8,7 @@ WITH any(number) * 3 AS x SELECT x FROM numbers(1, 2) 3 -SELECT +SELECT anyLast(number) * 3 AS x, x FROM numbers(1, 2) @@ -23,7 +23,7 @@ WITH any(number * 3) AS x SELECT x FROM numbers(1, 2) 3 -SELECT +SELECT anyLast(number * 3) AS x, x FROM numbers(1, 2) diff --git a/tests/queries/0_stateless/01323_redundant_functions_in_order_by.reference b/tests/queries/0_stateless/01323_redundant_functions_in_order_by.reference index 8751f269c4a..fd52438e9b0 100644 --- a/tests/queries/0_stateless/01323_redundant_functions_in_order_by.reference +++ b/tests/queries/0_stateless/01323_redundant_functions_in_order_by.reference @@ -34,11 +34,11 @@ FROM ( SELECT number AS x FROM numbers(3) - ORDER BY + ORDER BY exp(x) ASC, x ASC ) -SELECT +SELECT key, a, b, @@ -49,17 +49,17 @@ FROM FROM numbers(4) ) AS s ALL FULL OUTER JOIN test AS t USING (key) -ORDER BY +ORDER BY key ASC, t.key ASC -SELECT +SELECT key, a FROM test -ORDER BY +ORDER BY key ASC, a ASC -SELECT +SELECT key, a FROM test @@ -86,7 +86,7 @@ FROM ( SELECT number AS x FROM numbers(3) - ORDER BY + ORDER BY x ASC, exp(x) ASC ) @@ -95,7 +95,7 @@ FROM ( SELECT number AS x FROM numbers(3) - ORDER BY + ORDER BY x ASC, exp(exp(x)) ASC ) @@ -104,11 +104,11 @@ FROM ( SELECT number AS x FROM numbers(3) - ORDER BY + ORDER BY exp(x) ASC, x ASC ) -SELECT +SELECT key, a, b, @@ -119,21 +119,21 @@ FROM FROM numbers(4) ) AS s ALL FULL OUTER JOIN test AS t USING (key) -ORDER BY +ORDER BY key ASC, t.key ASC -SELECT +SELECT key, a FROM test -ORDER BY +ORDER BY key ASC, a ASC, exp(key + a) ASC -SELECT +SELECT key, a FROM test -ORDER BY +ORDER BY key ASC, exp(key + a) ASC diff --git a/tests/queries/0_stateless/01355_defaultValueOfArgumentType_bug.sql b/tests/queries/0_stateless/01355_defaultValueOfArgumentType_bug.sql index e3168eb09a0..2313cb686a4 100644 --- a/tests/queries/0_stateless/01355_defaultValueOfArgumentType_bug.sql +++ b/tests/queries/0_stateless/01355_defaultValueOfArgumentType_bug.sql @@ -1,4 +1,4 @@ -SELECT +SELECT materialize(toLowCardinality('')) AS lc, toTypeName(lc) WHERE lc = defaultValueOfArgumentType(lc) diff --git a/tests/queries/0_stateless/01372_wrong_order_by_removal.reference b/tests/queries/0_stateless/01372_wrong_order_by_removal.reference index 8ed303c04aa..f1f1bcef6e5 100644 --- a/tests/queries/0_stateless/01372_wrong_order_by_removal.reference +++ b/tests/queries/0_stateless/01372_wrong_order_by_removal.reference @@ -1,14 +1,14 @@ -SELECT +SELECT k, groupArrayMovingSum(v) FROM ( - SELECT + SELECT k, dt, v FROM moving_sum_num - ORDER BY + ORDER BY k ASC, dt ASC ) diff --git a/tests/queries/0_stateless/01379_with_fill_several_columns.sql b/tests/queries/0_stateless/01379_with_fill_several_columns.sql index 5d1cb4e6828..f98431b61b9 100644 --- a/tests/queries/0_stateless/01379_with_fill_several_columns.sql +++ b/tests/queries/0_stateless/01379_with_fill_several_columns.sql @@ -1,21 +1,21 @@ -SELECT +SELECT toDate((number * 10) * 86400) AS d1, toDate(number * 86400) AS d2, 'original' AS source FROM numbers(10) WHERE (number % 3) = 1 -ORDER BY +ORDER BY d2 WITH FILL, d1 WITH FILL STEP 5; SELECT '==============='; -SELECT +SELECT toDate((number * 10) * 86400) AS d1, toDate(number * 86400) AS d2, 'original' AS source FROM numbers(10) WHERE (number % 3) = 1 -ORDER BY +ORDER BY d1 WITH FILL STEP 5, d2 WITH FILL; \ No newline at end of file diff --git a/tests/queries/0_stateless/01390_remove_injective_in_uniq.reference b/tests/queries/0_stateless/01390_remove_injective_in_uniq.reference index 8fe2933b95e..94e1dbc5da7 100644 --- a/tests/queries/0_stateless/01390_remove_injective_in_uniq.reference +++ b/tests/queries/0_stateless/01390_remove_injective_in_uniq.reference @@ -1,4 +1,4 @@ -SELECT +SELECT uniq(x), uniqExact(x), uniqHLL12(x), @@ -9,7 +9,7 @@ FROM SELECT number % 2 AS x FROM numbers(10) ) -SELECT +SELECT uniq(x + y), uniqExact(x + y), uniqHLL12(x + y), @@ -17,12 +17,12 @@ SELECT uniqCombined64(x + y) FROM ( - SELECT + SELECT number % 2 AS x, number % 3 AS y FROM numbers(10) ) -SELECT +SELECT uniq(x), uniqExact(x), uniqHLL12(x), @@ -33,7 +33,7 @@ FROM SELECT number % 2 AS x FROM numbers(10) ) -SELECT +SELECT uniq(x), uniqExact(x), uniqHLL12(x), @@ -44,7 +44,7 @@ FROM SELECT number % 2 AS x FROM numbers(10) ) -SELECT +SELECT uniq(x), uniqExact(x), uniqHLL12(x), @@ -55,7 +55,7 @@ FROM SELECT number % 2 AS x FROM numbers(10) ) -SELECT +SELECT uniq(x), uniqExact(x), uniqHLL12(x), @@ -74,7 +74,7 @@ FROM ) SELECT uniq(concatAssumeInjective(\'x\', \'y\')) FROM numbers(10) -SELECT +SELECT uniq(x), uniqExact(x), uniqHLL12(x), @@ -85,7 +85,7 @@ FROM SELECT number % 2 AS x FROM numbers(10) ) -SELECT +SELECT uniq(x + y), uniqExact(x + y), uniqHLL12(x + y), @@ -93,12 +93,12 @@ SELECT uniqCombined64(x + y) FROM ( - SELECT + SELECT number % 2 AS x, number % 3 AS y FROM numbers(10) ) -SELECT +SELECT uniq(-x), uniqExact(-x), uniqHLL12(-x), @@ -109,7 +109,7 @@ FROM SELECT number % 2 AS x FROM numbers(10) ) -SELECT +SELECT uniq(bitNot(x)), uniqExact(bitNot(x)), uniqHLL12(bitNot(x)), @@ -120,7 +120,7 @@ FROM SELECT number % 2 AS x FROM numbers(10) ) -SELECT +SELECT uniq(bitNot(-x)), uniqExact(bitNot(-x)), uniqHLL12(bitNot(-x)), @@ -131,7 +131,7 @@ FROM SELECT number % 2 AS x FROM numbers(10) ) -SELECT +SELECT uniq(-bitNot(-x)), uniqExact(-bitNot(-x)), uniqHLL12(-bitNot(-x)), diff --git a/tests/queries/0_stateless/01414_push_predicate_when_contains_with_clause.reference b/tests/queries/0_stateless/01414_push_predicate_when_contains_with_clause.reference index a2ee0336191..13c8fe551c7 100644 --- a/tests/queries/0_stateless/01414_push_predicate_when_contains_with_clause.reference +++ b/tests/queries/0_stateless/01414_push_predicate_when_contains_with_clause.reference @@ -1,12 +1,12 @@ 999 1998 999 1998 -SELECT +SELECT number, square_number FROM ( WITH number * 2 AS square_number - SELECT + SELECT number, square_number FROM numbers_indexed diff --git a/tests/queries/0_stateless/01418_index_analysis_bug.sql b/tests/queries/0_stateless/01418_index_analysis_bug.sql index c5033ac7d96..aae76b63b7d 100644 --- a/tests/queries/0_stateless/01418_index_analysis_bug.sql +++ b/tests/queries/0_stateless/01418_index_analysis_bug.sql @@ -9,13 +9,13 @@ ENGINE = MergeTree() PARTITION BY toYYYYMM(eventday) ORDER BY (eventday, user_id); -INSERT INTO mytable_local SELECT +INSERT INTO mytable_local SELECT toDateTime('2020-06-01 00:00:00') + toIntervalMinute(number) AS created, toDate(created) AS eventday, if((number % 100) > 50, 742522, number % 32141) AS user_id FROM numbers(100000); -SELECT +SELECT eventday, count(*) FROM mytable_local diff --git a/tests/queries/0_stateless/01455_duplicate_distinct_optimization.reference b/tests/queries/0_stateless/01455_duplicate_distinct_optimization.reference index c5a06ca0cd3..2c54899f9f5 100644 --- a/tests/queries/0_stateless/01455_duplicate_distinct_optimization.reference +++ b/tests/queries/0_stateless/01455_duplicate_distinct_optimization.reference @@ -9,7 +9,7 @@ FROM SELECT DISTINCT number * 2 FROM ( - SELECT DISTINCT + SELECT DISTINCT number * 2, number FROM numbers(1) @@ -20,12 +20,12 @@ FROM SELECT DISTINCT number * 2 AS number FROM numbers(1) ) -SELECT +SELECT b, a FROM ( - SELECT DISTINCT + SELECT DISTINCT number % 2 AS a, number % 3 AS b FROM numbers(100) @@ -33,7 +33,7 @@ FROM SELECT DISTINCT a FROM ( - SELECT DISTINCT + SELECT DISTINCT number % 2 AS a, number % 3 AS b FROM numbers(100) @@ -44,7 +44,7 @@ FROM SELECT DISTINCT a FROM ( - SELECT DISTINCT + SELECT DISTINCT number % 2 AS a, number % 3 AS b FROM numbers(100) @@ -53,45 +53,45 @@ FROM SELECT DISTINCT a FROM ( - SELECT + SELECT a, b FROM ( - SELECT DISTINCT + SELECT DISTINCT number % 2 AS a, number % 3 AS b FROM numbers(100) ) ) -SELECT +SELECT a, b FROM ( - SELECT + SELECT b, a FROM ( - SELECT DISTINCT + SELECT DISTINCT number AS a, number AS b FROM numbers(1) ) ) -SELECT +SELECT a, b FROM ( - SELECT + SELECT b, a, a + b FROM ( - SELECT DISTINCT + SELECT DISTINCT number % 2 AS a, number % 3 AS b FROM numbers(100) @@ -103,7 +103,7 @@ FROM SELECT a FROM ( - SELECT DISTINCT + SELECT DISTINCT number % 2 AS a, number % 3 AS b FROM numbers(100) diff --git a/tests/queries/0_stateless/01470_columns_transformers.reference b/tests/queries/0_stateless/01470_columns_transformers.reference index 595d99b917f..c0f02e51ccf 100644 --- a/tests/queries/0_stateless/01470_columns_transformers.reference +++ b/tests/queries/0_stateless/01470_columns_transformers.reference @@ -9,54 +9,54 @@ 222 18 347 111 11 173.5 1970-04-11 1970-01-11 1970-11-21 -SELECT +SELECT sum(i), sum(j), sum(k) FROM columns_transformers -SELECT +SELECT avg(i), avg(j), avg(k) FROM columns_transformers -SELECT +SELECT toDate(any(i)), toDate(any(j)), toDate(any(k)) FROM columns_transformers AS a -SELECT +SELECT length(toString(j)), length(toString(k)) FROM columns_transformers -SELECT +SELECT sum(j), sum(k) FROM columns_transformers -SELECT +SELECT avg(i), avg(k) FROM columns_transformers -SELECT +SELECT toDate(any(i)), toDate(any(j)), toDate(any(k)) FROM columns_transformers AS a -SELECT +SELECT sum(i + 1 AS i), sum(j), sum(k) FROM columns_transformers -SELECT +SELECT avg(i + 1 AS i), avg(j + 2 AS j), avg(k) FROM columns_transformers -SELECT +SELECT toDate(any(i)), toDate(any(j)), toDate(any(k)) FROM columns_transformers AS a -SELECT +SELECT (i + 1) + 1 AS i, j, k diff --git a/tests/queries/1_stateful/00063_loyalty_joins.sql b/tests/queries/1_stateful/00063_loyalty_joins.sql index b2491346673..7713c65838c 100644 --- a/tests/queries/1_stateful/00063_loyalty_joins.sql +++ b/tests/queries/1_stateful/00063_loyalty_joins.sql @@ -1,12 +1,12 @@ SET any_join_distinct_right_table_keys = 1; SET joined_subquery_requires_alias = 0; -SELECT +SELECT loyalty, count() FROM test.hits ANY LEFT JOIN ( - SELECT + SELECT UserID, sum(SearchEngineID = 2) AS yandex, sum(SearchEngineID = 3) AS google, @@ -20,7 +20,7 @@ GROUP BY loyalty ORDER BY loyalty ASC; -SELECT +SELECT loyalty, count() FROM @@ -29,7 +29,7 @@ FROM FROM test.hits ) ANY LEFT JOIN ( - SELECT + SELECT UserID, sum(SearchEngineID = 2) AS yandex, sum(SearchEngineID = 3) AS google, @@ -43,12 +43,12 @@ GROUP BY loyalty ORDER BY loyalty ASC; -SELECT +SELECT loyalty, count() FROM ( - SELECT + SELECT loyalty, UserID FROM @@ -57,7 +57,7 @@ FROM FROM test.hits ) ANY LEFT JOIN ( - SELECT + SELECT UserID, sum(SearchEngineID = 2) AS yandex, sum(SearchEngineID = 3) AS google, @@ -72,18 +72,18 @@ GROUP BY loyalty ORDER BY loyalty ASC; -SELECT +SELECT loyalty, count() AS c, bar(log(c + 1) * 1000, 0, log(3000000) * 1000, 80) FROM test.hits ANY INNER JOIN ( - SELECT + SELECT UserID, toInt8(if(yandex > google, yandex / (yandex + google), -google / (yandex + google)) * 10) AS loyalty FROM ( - SELECT + SELECT UserID, sum(SearchEngineID = 2) AS yandex, sum(SearchEngineID = 3) AS google