diff options
| author | zhvv117 <[email protected]> | 2024-12-19 12:11:49 +0300 |
|---|---|---|
| committer | zhvv117 <[email protected]> | 2024-12-19 13:07:06 +0300 |
| commit | 72e5d59e4685dd66c0ecb0f845a3871e3e3d2a40 (patch) | |
| tree | 606292083f3622ca6f9b00dbcde06f2b417673b4 | |
| parent | 00dc4e62afc0e824eb511d411ac8de90e11e46da (diff) | |
do not add newline before comment if it is on the same line with statement
commit_hash:9a54a67e4d5d56469392ff71aa9585650b1e78a3
32 files changed, 98 insertions, 191 deletions
diff --git a/yql/essentials/sql/v1/format/sql_format.cpp b/yql/essentials/sql/v1/format/sql_format.cpp index b330800734b..b7a8d5c48de 100644 --- a/yql/essentials/sql/v1/format/sql_format.cpp +++ b/yql/essentials/sql/v1/format/sql_format.cpp @@ -276,6 +276,11 @@ TTokenIterator GetNextStatementBegin(TTokenIterator begin, TTokenIterator end) { continue; } if (curr->Name == "SEMICOLON") { + auto next = SkipWS(curr + 1, end); + while (next != end && next->Name == "COMMENT" && curr->Line == next->Line) { + curr = next; + next = SkipWS(next + 1, end); + } ++curr; break; } diff --git a/yql/essentials/sql/v1/format/sql_format_ut.h b/yql/essentials/sql/v1/format/sql_format_ut.h index f44ab557c36..0f7b708ca38 100644 --- a/yql/essentials/sql/v1/format/sql_format_ut.h +++ b/yql/essentials/sql/v1/format/sql_format_ut.h @@ -211,6 +211,8 @@ Y_UNIT_TEST(NamedNode) { "$a = (\n\tSELECT\n\t\t*\n\tFROM\n\t\t$t -- comment\n);\n"}, {"-- comment\r\r\r$a=1;", "-- comment\r\n$a = 1;\n"}, + {"$a=1;-- comment\n$b=2;/* comment */ /* comment */\n$c = 3;/* comment */ -- comment", + "$a = 1; -- comment\n$b = 2; /* comment */ /* comment */\n$c = 3; /* comment */ -- comment\n"}, }; TSetup setup; diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_aggregate-group_by_session_nopush_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_aggregate-group_by_session_nopush_/formatted.sql index 8c15f9f952a..55b25c01db4 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_aggregate-group_by_session_nopush_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_aggregate-group_by_session_nopush_/formatted.sql @@ -17,5 +17,4 @@ FROM ( ) WHERE ss != 100500 -; --- should not push down +; -- should not push down diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-add_bitcast_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-add_bitcast_/formatted.sql index 066eecc1658..ef99f355e0d 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-add_bitcast_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-add_bitcast_/formatted.sql @@ -2,15 +2,12 @@ USE plato; SELECT 1ul + 1 -; +; -- warn --- warn SELECT 1u + 1 -; +; -- warn --- warn SELECT 1l + 1u -; --- ok +; -- ok diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-div_bitcast_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-div_bitcast_/formatted.sql index 95971828640..946e613c554 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-div_bitcast_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-div_bitcast_/formatted.sql @@ -2,15 +2,12 @@ USE plato; SELECT 1ul / 1 -; +; -- warn --- warn SELECT 1u / 1 -; +; -- warn --- warn SELECT 1l / 1u -; --- ok +; -- ok diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-mod_bitcast_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-mod_bitcast_/formatted.sql index efa491555dc..c3d6cc2b1d6 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-mod_bitcast_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-mod_bitcast_/formatted.sql @@ -2,15 +2,12 @@ USE plato; SELECT 1ul % 1 -; +; -- warn --- warn SELECT 1u % 1 -; +; -- warn --- warn SELECT 1l % 1u -; --- ok +; -- ok diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-mul_bitcast_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-mul_bitcast_/formatted.sql index 8fbc9963552..51daa0e7ff8 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-mul_bitcast_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-mul_bitcast_/formatted.sql @@ -2,15 +2,12 @@ USE plato; SELECT 1ul * 1 -; +; -- warn --- warn SELECT 1u * 1 -; +; -- warn --- warn SELECT 1l * 1u -; --- ok +; -- ok diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-sub_bitcast_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-sub_bitcast_/formatted.sql index 8d28bd557c0..b414769fd70 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-sub_bitcast_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_bitcast_implicit-sub_bitcast_/formatted.sql @@ -2,15 +2,12 @@ USE plato; SELECT 1ul - 1 -; +; -- warn --- warn SELECT 1u - 1 -; +; -- warn --- warn SELECT 1l - 1u -; --- ok +; -- ok diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_column_group-hint_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_column_group-hint_/formatted.sql index ae5cb7e3dcf..1c102e4f178 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_column_group-hint_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_column_group-hint_/formatted.sql @@ -7,9 +7,8 @@ $i1 = ( Input WHERE a > 'a' -); +); -- several publish consumers with same groups --- several publish consumers with same groups $i2 = ( SELECT * @@ -17,9 +16,8 @@ $i2 = ( Input WHERE a > 'a1' -); +); -- several publish consumers with different groups --- several publish consumers with different groups $i3 = ( SELECT * @@ -27,9 +25,8 @@ $i3 = ( Input WHERE a < 'a2' -); +); -- several consumers including publish --- several consumers including publish $i4 = ( SELECT * @@ -37,9 +34,8 @@ $i4 = ( Input WHERE a != 'a' -); +); -- several publish consumers with and without groups --- several publish consumers with and without groups -- test column group spec normalization INSERT INTO Output1 WITH column_groups = '{g1=[a;b;c];def=#}' SELECT diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_datetime-date_tz_compare_diff_zones_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_datetime-date_tz_compare_diff_zones_/formatted.sql index 5fe7c180bae..01eff73bc12 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_datetime-date_tz_compare_diff_zones_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_datetime-date_tz_compare_diff_zones_/formatted.sql @@ -13,9 +13,8 @@ SELECT SELECT CAST('2000-01-01,GMT' AS tzdate) == tzdate('2000-01-01,America/Los_Angeles') -; +; -- same time value --- same time value SELECT RemoveTimezone(CAST('2000-01-01,GMT' AS tzdate)) == RemoveTimezone(tzdate('2000-01-01,America/Los_Angeles')) ; diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_expr-cast_string_implicit_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_expr-cast_string_implicit_/formatted.sql index d34761cff93..3b7ae94bf96 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_expr-cast_string_implicit_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_expr-cast_string_implicit_/formatted.sql @@ -1,60 +1,47 @@ SELECT AsList('aaa', 'aaa'u) -; +; -- List<String> --- List<String> SELECT AsList('aaa', '[1, 2, 3]'j) -; +; -- List<String> --- List<String> SELECT AsList('aaa', '[1; 2; 3]'y) -; +; -- List<String> --- List<String> SELECT AsList('aaa'u, 'aaa') -; +; -- List<String> --- List<String> SELECT AsList('aaa'u, '[1, 2, 3]'j) -; +; -- List<Utf8> --- List<Utf8> SELECT AsList('aaa'u, '[1; 2; 3]'y) -; +; -- List<String> --- List<String> SELECT AsList('[1, 2, 3]'j, 'aaa') -; +; -- List<String> --- List<String> SELECT AsList('[1, 2, 3]'j, 'aaa'u) -; +; -- List<Utf8> --- List<Utf8> SELECT AsList('[1, 2, 3]'j, '[1; 2; 3]'y) -; +; -- List<String> --- List<String> SELECT AsList('[1; 2; 3]'y, 'aaa') -; +; -- List<String> --- List<String> SELECT AsList('[1; 2; 3]'y, 'aaa'u) -; +; -- List<String> --- List<String> SELECT AsList('[1; 2; 3]'y, '[1, 2, 3]'j) -; --- List<String> - +; -- List<String> diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_expr-dict_builtins_null_lookup_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_expr-dict_builtins_null_lookup_/formatted.sql index 053a8e0f2c3..9fa94849369 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_expr-dict_builtins_null_lookup_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_expr-dict_builtins_null_lookup_/formatted.sql @@ -10,9 +10,8 @@ SELECT DictContains($d3, NULL), -- true, null is convertible to Nothing<T> for any T DictLookup($d2, NULL), -- Nothing(String?), no such key DictLookup($d3, NULL) -; +; -- Just("baz"), null is convertible to Nothing<T> for any T --- Just("baz"), null is convertible to Nothing<T> for any T SELECT DictContains($t1, AsTuple(1, 'keyy')), -- false, missing key DictContains($t1, AsTuple(1, 'key')), -- true, match @@ -21,5 +20,4 @@ SELECT DictContains($t3, AsTuple(NULL, 'key')), -- true, null is convertible to Nothing<T> for any T DictLookup($t2, AsTuple(NULL, 'key')), -- Nothing(Tuple<Int32?, String>?), no such key DictLookup($t3, AsTuple(NULL, 'key')) -; --- Just(AsTuple(123, "value")), null is convertible to Nothing<T> for any T +; -- Just(AsTuple(123, "value")), null is convertible to Nothing<T> for any T diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_ansi_join_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_ansi_join_/formatted.sql index 3dec26b8c09..cf090dac378 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_ansi_join_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_ansi_join_/formatted.sql @@ -66,9 +66,8 @@ WHERE optkey NOT IN $rp ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -77,9 +76,8 @@ WHERE optkey NOT IN $rp ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -88,9 +86,8 @@ WHERE optkey NOT IN $rp ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] -- Right is O SELECT optkey @@ -100,9 +97,8 @@ WHERE optkey NOT IN $ro ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -111,9 +107,8 @@ WHERE optkey NOT IN $ro ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -122,9 +117,8 @@ WHERE optkey NOT IN $ro ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] -- Right is N SELECT optkey @@ -134,9 +128,8 @@ WHERE optkey NOT IN $rn ORDER BY optkey -; +; -- [] --- [] SELECT optkey FROM @@ -145,9 +138,8 @@ WHERE optkey NOT IN $rn ORDER BY optkey -; +; -- [] --- [] SELECT optkey FROM @@ -156,9 +148,8 @@ WHERE optkey NOT IN $rn ORDER BY optkey -; +; -- [] --- [] -- 2, 4, 6, null $extraDict = ( SELECT @@ -182,9 +173,8 @@ WHERE optkey != 10 AND optkey NOT IN $ro AND optkey IN $extraDict AND optkey != 4 ORDER BY optkey -; +; -- [2,6] --- [2,6] SELECT optkey FROM @@ -193,9 +183,8 @@ WHERE optkey != 10 AND optkey NOT IN $rn AND optkey IN $extraDict AND optkey != 4 ORDER BY optkey -; +; -- [] --- [] -- Empty dict SELECT optkey @@ -211,6 +200,4 @@ WHERE ) ORDER BY optkey -; --- [1-10,null] - +; -- [1-10,null] diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_noansi_join_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_noansi_join_/formatted.sql index 9fbe514124e..4f02d53d687 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_noansi_join_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_noansi_join_/formatted.sql @@ -66,9 +66,8 @@ WHERE optkey NOT IN $rp ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -77,9 +76,8 @@ WHERE optkey NOT IN $rp ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -88,9 +86,8 @@ WHERE optkey NOT IN $rp ORDER BY optkey -; +; -- [null,2,3,4,6,8,10] --- [null,2,3,4,6,8,10] -- Right is O SELECT optkey @@ -100,9 +97,8 @@ WHERE optkey NOT IN $ro ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -111,9 +107,8 @@ WHERE optkey NOT IN $ro ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -122,9 +117,8 @@ WHERE optkey NOT IN $ro ORDER BY optkey -; +; -- [null,2,3,4,6,8,10] --- [null,2,3,4,6,8,10] -- Right is N SELECT optkey @@ -134,9 +128,8 @@ WHERE optkey NOT IN $rn ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -145,9 +138,8 @@ WHERE optkey NOT IN $rn ORDER BY optkey -; +; -- [2,3,4,6,8,10] --- [2,3,4,6,8,10] SELECT optkey FROM @@ -156,9 +148,8 @@ WHERE optkey NOT IN $rn ORDER BY optkey -; +; -- [null,2,3,4,6,8,10] --- [null,2,3,4,6,8,10] -- 2, 4, 6, null $extraDict = ( SELECT @@ -182,9 +173,8 @@ WHERE optkey != 10 AND optkey NOT IN $ro AND optkey IN $extraDict AND optkey != 4 ORDER BY optkey -; +; -- [2,6] --- [2,6] SELECT optkey FROM @@ -193,9 +183,8 @@ WHERE optkey != 10 AND optkey NOT IN $rn AND optkey IN $extraDict AND optkey != 4 ORDER BY optkey -; +; -- [2,6] --- [2,6] -- Empty dict SELECT optkey @@ -211,6 +200,4 @@ WHERE ) ORDER BY optkey -; --- [1-10,null] - +; -- [1-10,null] diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_with_nulls_and_optionals_extra_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_with_nulls_and_optionals_extra_/formatted.sql index 7cc64316c73..02d8df23eb1 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_with_nulls_and_optionals_extra_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_with_nulls_and_optionals_extra_/formatted.sql @@ -10,5 +10,4 @@ SELECT (1, NULL) IN ((1, 2), (1, 3)), -- Nothing<Bool?> (2, NULL) IN ((1, 2), (1, 3)), -- Nothing<Bool?> (1, NULL) IN () -; --- Nothing<Bool?> +; -- Nothing<Bool?> diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_with_nulls_and_optionals_extra_ansi_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_with_nulls_and_optionals_extra_ansi_/formatted.sql index 326a7099270..cd79c2a96ef 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_with_nulls_and_optionals_extra_ansi_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_in-in_with_nulls_and_optionals_extra_ansi_/formatted.sql @@ -10,5 +10,4 @@ SELECT (1, NULL) IN ((1, 2), (1, 3)), -- Nothing<Bool?> (2, NULL) IN ((1, 2), (1, 3)), -- Just(false) (1, NULL) IN () -; --- Just(false) +; -- Just(false) diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-cbo_4tables_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-cbo_4tables_/formatted.sql index 37e8cecb5ab..f9f38135f47 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-cbo_4tables_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-cbo_4tables_/formatted.sql @@ -1,9 +1,7 @@ /* ytfile can not */ USE plato; -PRAGMA warning('disable', '8001'); - --- CBO_MISSING_TABLE_STATS +PRAGMA warning('disable', '8001'); -- CBO_MISSING_TABLE_STATS PRAGMA CostBasedOptimizer = 'native'; PRAGMA yt.MapJoinLimit = '1000'; PRAGMA yt.LookupJoinLimit = '1000'; diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-cbo_4tables_only_sorted_merge_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-cbo_4tables_only_sorted_merge_/formatted.sql index 59a75e45c95..3773cd9c62c 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-cbo_4tables_only_sorted_merge_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-cbo_4tables_only_sorted_merge_/formatted.sql @@ -1,9 +1,7 @@ /* ytfile can not */ USE plato; -PRAGMA warning('disable', '8001'); - --- CBO_MISSING_TABLE_STATS +PRAGMA warning('disable', '8001'); -- CBO_MISSING_TABLE_STATS PRAGMA CostBasedOptimizer = 'native'; PRAGMA yt.MapJoinLimit = '1000'; PRAGMA yt.LookupJoinLimit = '1000'; diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_cbo_3_tables_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_cbo_3_tables_/formatted.sql index ecbc9980f96..db7bf3d339e 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_cbo_3_tables_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_cbo_3_tables_/formatted.sql @@ -1,8 +1,6 @@ USE plato; -PRAGMA warning('disable', '8001'); - --- CBO_MISSING_TABLE_STATS +PRAGMA warning('disable', '8001'); -- CBO_MISSING_TABLE_STATS PRAGMA CostBasedOptimizer = 'pg'; SELECT diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_left_cbo_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_left_cbo_/formatted.sql index e3287b0ccb7..f84bb6ef385 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_left_cbo_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_left_cbo_/formatted.sql @@ -1,8 +1,6 @@ USE plato; -PRAGMA warning('disable', '8001'); - --- CBO_MISSING_TABLE_STATS +PRAGMA warning('disable', '8001'); -- CBO_MISSING_TABLE_STATS PRAGMA CostBasedOptimizer = 'PG'; SELECT diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_right_cbo_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_right_cbo_/formatted.sql index 89c9d307048..b1ab35595c3 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_right_cbo_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_join-join_right_cbo_/formatted.sql @@ -1,8 +1,6 @@ USE plato; -PRAGMA warning('disable', '8001'); - --- CBO_MISSING_TABLE_STATS +PRAGMA warning('disable', '8001'); -- CBO_MISSING_TABLE_STATS PRAGMA CostBasedOptimizer = 'PG'; SELECT diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-decimal_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-decimal_/formatted.sql index 1c8ffe23b41..a1866f61c13 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-decimal_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-decimal_/formatted.sql @@ -84,23 +84,20 @@ FROM @decimal WHERE value == CAST('6.6' AS Decimal (15, 10)) -; +; -- Safe key filter calc --- Safe key filter calc SELECT * FROM @decimal WHERE value == CAST($asIs('3.3') AS Decimal (15, 10)) -; +; -- Unsafe key filter calc --- Unsafe key filter calc SELECT * FROM @decimal WHERE value == CAST($asIs('bad') AS Decimal (15, 10)) -; --- Unsafe key filter calc +; -- Unsafe key filter calc diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-tzdate_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-tzdate_/formatted.sql index db97e0a1359..262e38eeec8 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-tzdate_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-tzdate_/formatted.sql @@ -77,23 +77,20 @@ FROM @tzdate WHERE value == CAST('1999-01-01,Europe/Moscow' AS TzDate) -; +; -- Safe key filter calc --- Safe key filter calc SELECT * FROM @tzdate WHERE value == CAST($asIs('2105-12-30,America/Los_Angeles') AS TzDate) -; +; -- Unsafe key filter calc --- Unsafe key filter calc SELECT * FROM @tzdate WHERE value == CAST($asIs('bad') AS TzDate) -; --- Unsafe key filter calc +; -- Unsafe key filter calc diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-uuid_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-uuid_/formatted.sql index b4fc19dd856..5ca4a5e7ee9 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-uuid_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_key_filter-uuid_/formatted.sql @@ -98,23 +98,20 @@ FROM @uuid WHERE value == CAST('00000000-0000-0000-0000-100000000000' AS Uuid) -; +; -- Safe key filter calc --- Safe key filter calc SELECT * FROM @uuid WHERE value == CAST($asIs('00000000-0000-0000-0000-200000000000') AS Uuid) -; +; -- Unsafe key filter calc --- Unsafe key filter calc SELECT * FROM @uuid WHERE value == CAST($asIs('bad') AS Uuid) -; --- Unsafe key filter calc +; -- Unsafe key filter calc diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_match_recognize-all_rows_per_match_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_match_recognize-all_rows_per_match_/formatted.sql index edcc854cfab..ae649536184 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_match_recognize-all_rows_per_match_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_match_recognize-all_rows_per_match_/formatted.sql @@ -1,6 +1,6 @@ -PRAGMA FeatureR010 = "prototype"; +PRAGMA FeatureR010 = 'prototype'; -$input = +$input = ( SELECT * FROM @@ -19,7 +19,7 @@ $input = <|time: 1100, value: 5|>, <|time: 1200, value: 0|>, ]) -; +); SELECT * diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_params-primitives_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_params-primitives_/formatted.sql index 19fc917dc69..0c5da650334 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_params-primitives_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_params-primitives_/formatted.sql @@ -3,22 +3,14 @@ DECLARE $x1 AS int; DECLARE $x2 AS Double; DECLARE $x3 AS Bool; DECLARE $x4 AS Float; -DECLARE $x5 AS String; - --- unicode +DECLARE $x5 AS String; -- unicode DECLARE $x6 AS Int64; DECLARE $x7 AS Uint64; -DECLARE $x8 AS String; - --- binary +DECLARE $x8 AS String; -- binary DECLARE $x9 AS Utf8; DECLARE $x10 AS Uuid; -DECLARE $x11 AS String?; - --- null -DECLARE $x12 AS String?; - --- not null +DECLARE $x11 AS String?; -- null +DECLARE $x12 AS String?; -- not null DECLARE $x13 AS Yson; DECLARE $x14 AS Json; DECLARE $x15 AS datetime; diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-bind_expr_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-bind_expr_/formatted.sql index 08d9a3b581d..0a9259aed40 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-bind_expr_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-bind_expr_/formatted.sql @@ -8,9 +8,8 @@ $count = ( COUNT(*) FROM Input -); +); -- $count = 10 --- $count = 10 $var = ( SELECT * diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-bind_expr_udf_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-bind_expr_udf_/formatted.sql index 7a2f11fb418..7da3c0e4d72 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-bind_expr_udf_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-bind_expr_udf_/formatted.sql @@ -11,5 +11,4 @@ FROM TABLESAMPLE BERNOULLI (Math::Ceil(100 * $percent)) ORDER BY key -; --- 100% sample +; -- 100% sample diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-subquery_expr_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-subquery_expr_/formatted.sql index 337f365d5e4..6b7041a3f1e 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-subquery_expr_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_sampling-subquery_expr_/formatted.sql @@ -6,9 +6,8 @@ $count = ( COUNT(*) FROM plato.Input -); +); -- $count = 10 --- $count = 10 SELECT * FROM ( diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_schema-user_schema_with_sort_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_schema-user_schema_with_sort_/formatted.sql index 6b9523050c5..38c1e0f904a 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_schema-user_schema_with_sort_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_schema-user_schema_with_sort_/formatted.sql @@ -15,9 +15,8 @@ FROM Input1 WITH SCHEMA Struct<key: String?, subkey: String> ORDER BY key -; +; -- should reset sort --- should reset sort SELECT * FROM diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_udf-named_args_for_script_with_posargs_reuse_args_fail_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_udf-named_args_for_script_with_posargs_reuse_args_fail_/formatted.sql index b1cc4299503..3a7b94d707d 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_udf-named_args_for_script_with_posargs_reuse_args_fail_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_udf-named_args_for_script_with_posargs_reuse_args_fail_/formatted.sql @@ -26,5 +26,4 @@ SELECT $udf(name, age, age AS age) AS val FROM $data -; --- age is reused as named after positional +; -- age is reused as named after positional diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_udf-wrong_args_fail_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_udf-wrong_args_fail_/formatted.sql index 67a6d45b69c..2aeb8fc7edd 100644 --- a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_udf-wrong_args_fail_/formatted.sql +++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_udf-wrong_args_fail_/formatted.sql @@ -3,20 +3,16 @@ -- Find has optional args SELECT String::ReplaceAll() -; +; -- too few --- too few SELECT String::ReplaceAll('abc') -; +; -- too few --- too few SELECT String::ReplaceAll('abc', 'b', 2, 4) -; +; -- too many --- too many SELECT String::ReplaceAll('abc', 'b', 2, 4, 44) -; --- too many +; -- too many |
