From 60dccce8180f231845ab9eb2dfcc1f705157b5c6 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 15 Aug 2021 08:29:31 +0300 Subject: [PATCH 01/13] Remove trailing zeros from Decimal serialization #15794 --- src/Common/tests/gtest_wide_integer.cpp | 1 - src/IO/WriteHelpers.h | 58 ++++++++++++++----- .../02009_decimal_no_trailing_zeros.reference | 32 ++++++++++ .../02009_decimal_no_trailing_zeros.sql | 18 ++++++ 4 files changed, 95 insertions(+), 14 deletions(-) create mode 100644 tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference create mode 100644 tests/queries/0_stateless/02009_decimal_no_trailing_zeros.sql diff --git a/src/Common/tests/gtest_wide_integer.cpp b/src/Common/tests/gtest_wide_integer.cpp index 982bbee804e..0cdbcb29c02 100644 --- a/src/Common/tests/gtest_wide_integer.cpp +++ b/src/Common/tests/gtest_wide_integer.cpp @@ -277,5 +277,4 @@ GTEST_TEST(WideInteger, DecimalFormatting) Int128 fractional = DecimalUtils::getFractionalPart(x, 2); EXPECT_EQ(fractional, 40); - EXPECT_EQ(decimalFractional(fractional, 2), "40"); } diff --git a/src/IO/WriteHelpers.h b/src/IO/WriteHelpers.h index 556adbe2d6f..891a8d1f073 100644 --- a/src/IO/WriteHelpers.h +++ b/src/IO/WriteHelpers.h @@ -901,30 +901,63 @@ inline void writeText(const LocalDateTime & x, WriteBuffer & buf) { writeDateTim inline void writeText(const UUID & x, WriteBuffer & buf) { writeUUIDText(x, buf); } template -String decimalFractional(const T & x, UInt32 scale) +void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr) { + /// If it's big integer, but the number of digits is small, + /// use the implementation for smaller integers for more efficient arithmetic. + if constexpr (std::is_same_v) { if (x <= std::numeric_limits::max()) - return decimalFractional(static_cast(x), scale); + { + writeDecimalFractional(static_cast(x), scale, ostr); + return; + } else if (x <= std::numeric_limits::max()) - return decimalFractional(static_cast(x), scale); + { + writeDecimalFractional(static_cast(x), scale, ostr); + return; + } else if (x <= std::numeric_limits::max()) - return decimalFractional(static_cast(x), scale); + { + writeDecimalFractional(static_cast(x), scale, ostr); + return; + } } else if constexpr (std::is_same_v) { if (x <= std::numeric_limits::max()) - return decimalFractional(static_cast(x), scale); + { + writeDecimalFractional(static_cast(x), scale, ostr); + return; + } else if (x <= std::numeric_limits::max()) - return decimalFractional(static_cast(x), scale); + { + writeDecimalFractional(static_cast(x), scale, ostr); + return; + } } - String str(scale, '0'); + constexpr size_t max_digits = std::numeric_limits::digits10; + assert(scale <= max_digits); + char buf[max_digits]; + memset(buf, '0', scale); + T value = x; - for (Int32 pos = scale - 1; pos >= 0; --pos, value /= 10) - str[pos] += static_cast(value % 10); - return str; + Int32 last_nonzero_pos = 0; + for (Int32 pos = scale - 1; pos >= 0; --pos) + { + auto remainder = value % 10; + value /= 10; + + if (remainder != 0 && last_nonzero_pos == 0) + last_nonzero_pos = pos; + + buf[pos] += static_cast(remainder); + } + + writeChar('.', ostr); + ostr.write(buf, last_nonzero_pos + 1); } template @@ -941,10 +974,9 @@ void writeText(Decimal x, UInt32 scale, WriteBuffer & ostr) if (scale) { - writeChar('.', ostr); part = DecimalUtils::getFractionalPart(x, scale); - String fractional = decimalFractional(part, scale); - ostr.write(fractional.data(), scale); + if (part) + writeDecimalFractional(part, scale, ostr); } } diff --git a/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference new file mode 100644 index 00000000000..d41682b62ce --- /dev/null +++ b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference @@ -0,0 +1,32 @@ +-- { echo } + +SELECT 1.123::Decimal64(1); +1.1 +SELECT 1.123::Decimal64(2); +1.12 +SELECT 1.123::Decimal64(3); +1.123 +SELECT 1.123::Decimal64(4); +1.123 +SELECT 1.123::Decimal64(5); +1.123 +SELECT 1.123::Decimal64(10); +1.123 +SELECT 1::Decimal64(0); +1 +SELECT 1::Decimal64(1); +1 +SELECT 1::Decimal64(10); +1 +SELECT 1.1234567::Decimal32(8); +1.1234567 +SELECT 1.1234567890::Decimal64(10); +1.123456789 +SELECT 1.1234567890::Decimal128(10); +1.123456789 +SELECT 1.1234567890::Decimal256(10); +1.123456789 +SELECT 1.123456789012345678901::Decimal256(20); +1.1234567890123456789 +SELECT 1.123456789012345678901::Decimal256(22); +1.123456789012345678901 diff --git a/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.sql b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.sql new file mode 100644 index 00000000000..556e355e7d8 --- /dev/null +++ b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.sql @@ -0,0 +1,18 @@ +-- { echo } + +SELECT 1.123::Decimal64(1); +SELECT 1.123::Decimal64(2); +SELECT 1.123::Decimal64(3); +SELECT 1.123::Decimal64(4); +SELECT 1.123::Decimal64(5); +SELECT 1.123::Decimal64(10); +SELECT 1::Decimal64(0); +SELECT 1::Decimal64(1); +SELECT 1::Decimal64(10); + +SELECT 1.1234567::Decimal32(8); +SELECT 1.1234567890::Decimal64(10); +SELECT 1.1234567890::Decimal128(10); +SELECT 1.1234567890::Decimal256(10); +SELECT 1.123456789012345678901::Decimal256(20); +SELECT 1.123456789012345678901::Decimal256(22); From f5397c4430b77d0974c6a8632e0656f757b043c5 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 15 Aug 2021 10:53:46 +0300 Subject: [PATCH 02/13] Update tests --- .../0_stateless/00027_argMinMax.reference | 2 +- .../0_stateless/00502_sum_map.reference | 4 +- .../00700_decimal_aggregates.reference | 130 +- .../00700_decimal_arithm.reference | 46 +- .../00700_decimal_array_functions.reference | 30 +- .../00700_decimal_bounds.reference | 86 +- .../0_stateless/00700_decimal_casts.reference | 218 +- .../00700_decimal_casts_2.reference | 48 +- .../00700_decimal_compare.reference | 26 +- .../00700_decimal_complex_types.reference | 110 +- .../00700_decimal_defaults.reference | 16 +- .../00700_decimal_empty_aggregates.reference | 86 +- .../00700_decimal_formats.reference | 78 +- .../00700_decimal_gathers.reference | 24 +- .../00700_decimal_in_keys.reference | 44 +- .../0_stateless/00700_decimal_math.reference | 54 +- .../0_stateless/00700_decimal_null.reference | 10 +- .../0_stateless/00700_decimal_round.reference | 150 +- .../00700_to_decimal_or_something.reference | 12 +- ...00732_decimal_summing_merge_tree.reference | 4 +- .../00737_decimal_group_by.reference | 22 +- ...4_test_custom_compression_codecs.reference | 2 +- .../0_stateless/00805_round_down.reference | 60 +- .../0_stateless/00837_minmax_index.reference | 8 +- .../0_stateless/00838_unique_index.reference | 24 +- .../00861_decimal_quoted_csv.reference | 8 +- .../0_stateless/00862_decimal_in.reference | 36 +- ...0_decimal_group_array_crash_3783.reference | 16 +- .../00927_asof_join_other_types.reference | 18 +- .../0_stateless/00950_dict_get.reference | 30 +- .../0_stateless/00975_values_list.reference | 2 +- .../00979_toFloat_monotonicity.reference | 4 +- .../00980_crash_nullable_decimal.reference | 14 +- .../01018_empty_aggregation_filling.reference | 2 +- ...01055_minmax_index_compact_parts.reference | 8 +- .../01087_storage_generate.reference | 26 +- .../01087_table_function_generate.reference | 6 +- .../01095_tpch_like_smoke.reference | 6 +- .../01178_int_field_to_decimal.reference | 4 +- ...ialized_view_different_structure.reference | 2 +- .../01186_conversion_to_nullable.reference | 6 +- .../01231_markdown_format.reference | 4 +- .../01260_ubsan_decimal_parse.reference | 2 +- .../01280_min_map_max_map.reference | 4 +- ...mal_cut_extra_digits_after_point.reference | 8 +- .../01412_group_array_moving_shard.reference | 16 +- ...imal_parse_big_negative_exponent.reference | 2 +- ...01425_default_value_of_type_name.reference | 2 +- .../01440_big_int_exotic_casts.reference | 364 +- .../0_stateless/01459_decimal_casts.reference | 18 +- .../01474_decimal_scale_bug.reference | 36 +- ...1501_cache_dictionary_all_fields.reference | 12 +- ...01518_nullable_aggregate_states2.reference | 3636 ++++++++--------- .../01556_accurate_cast_or_null.reference | 2 +- .../01592_window_functions.reference | 148 +- .../0_stateless/01601_accurate_cast.reference | 2 +- .../01602_array_aggregation.reference | 18 +- .../0_stateless/01622_byte_size.reference | 8 +- ...ing_type_convert_to_decimal_type.reference | 2 +- .../01676_reinterpret_as.reference | 10 +- .../01711_decimal_multiplication.reference | 8 +- .../01721_dictionary_decimal_p_s.reference | 10 +- ...01804_dictionary_decimal256_type.reference | 12 +- .../0_stateless/01852_cast_operator.reference | 4 +- .../01852_cast_operator_2.reference | 4 +- ...cache_dictionary_decimal256_type.reference | 2 +- .../01913_if_int_decimal.reference | 6 +- 67 files changed, 2911 insertions(+), 2911 deletions(-) diff --git a/tests/queries/0_stateless/00027_argMinMax.reference b/tests/queries/0_stateless/00027_argMinMax.reference index 101e8c16044..c92140c0f33 100644 --- a/tests/queries/0_stateless/00027_argMinMax.reference +++ b/tests/queries/0_stateless/00027_argMinMax.reference @@ -1,5 +1,5 @@ 0 9 0 9 1970-01-01 1970-01-10 -0.00 9.00 +0 9 4 1 diff --git a/tests/queries/0_stateless/00502_sum_map.reference b/tests/queries/0_stateless/00502_sum_map.reference index c38fb2ec7d6..efd5a5534d4 100644 --- a/tests/queries/0_stateless/00502_sum_map.reference +++ b/tests/queries/0_stateless/00502_sum_map.reference @@ -22,5 +22,5 @@ ([1.01],[1]) (['a','b'],[1,2]) (['a','ab','abc'],[3,2,1]) -([1,2,3,4,5,6,7,8],[1.00000,2.00000,6.00000,8.00000,10.00000,12.00000,7.00000,8.00000]) -([1,2,3,4,5,6,7,8],[1.00000,2.00000,6.00000,8.00000,10.00000,12.00000,7.00000,8.00000]) +([1,2,3,4,5,6,7,8],[1,2,6,8,10,12,7,8]) +([1,2,3,4,5,6,7,8],[1,2,6,8,10,12,7,8]) diff --git a/tests/queries/0_stateless/00700_decimal_aggregates.reference b/tests/queries/0_stateless/00700_decimal_aggregates.reference index 251445675a2..159091d867e 100644 --- a/tests/queries/0_stateless/00700_decimal_aggregates.reference +++ b/tests/queries/0_stateless/00700_decimal_aggregates.reference @@ -1,72 +1,72 @@ 101 101 101 -[-50.0000,50.0000] [-16.66666666,16.66666666] [-10.00000000,10.00000000] -0.0000 0.00000000 0.00000000 0.0000 0.00000000 0.00000000 -1275.0000 424.99999983 255.00000000 1275.0000 424.99999983 255.00000000 --1275.0000 -424.99999983 -255.00000000 -1275.0000 -424.99999983 -255.00000000 -101.0000 101.00000000 101.00000000 101.0000 101.00000000 101.00000000 --101.0000 -101.00000000 -101.00000000 -101.0000 -101.00000000 -101.00000000 +[-50,50] [-16.66666666,16.66666666] [-10,10] +0 0 0 0 0 0 +1275 424.99999983 255 1275 424.99999983 255 +-1275 -424.99999983 -255 -1275 -424.99999983 -255 +101 101 101 101 101 101 +-101 -101 -101 -101 -101 -101 (101,101,101) (101,101,101) (101,101,101) (101,101,101) (102,100,101) 5 5 5 10 10 10 --50.0000 -50.0000 -16.66666666 -16.66666666 -10.00000000 -10.00000000 -1.0000 1.0000 0.33333333 0.33333333 0.20000000 0.20000000 -50.0000 50.0000 16.66666666 16.66666666 10.00000000 10.00000000 --1.0000 -1.0000 -0.33333333 -0.33333333 -0.20000000 -0.20000000 -0.0000 0.00000000 0.00000000 Decimal(38, 8) --25.5000 -8.49999999 -5.10000000 Decimal(38, 8) -0.0000 0.00000000 0.00000000 -10.0000 3.33333333 2.00000000 -20.0000 6.66666666 4.00000000 -30.0000 10.00000000 6.00000000 -40.0000 13.33333333 8.00000000 -50.0000 16.66666666 10.00000000 -[-50.0000,-40.0000,-30.0000,-20.0000,-10.0000,0.0000,10.0000,20.0000,30.0000,40.0000,50.0000] -[-16.66666666,-13.33333333,-10.00000000,-6.66666666,-3.33333333,0.00000000,3.33333333,6.66666666,10.00000000,13.33333333,16.66666666] -[-10.00000000,-8.00000000,-6.00000000,-4.00000000,-2.00000000,0.00000000,2.00000000,4.00000000,6.00000000,8.00000000,10.00000000] -0.0000 0.00000000 0.00000000 Decimal(38, 8) --25.0000 -8.33333333 -5.00000000 Decimal(38, 8) -0.0000 0.00000000 0.00000000 -10.0000 3.33333333 2.00000000 -20.0000 6.66666666 4.00000000 -30.0000 10.00000000 6.00000000 -40.0000 13.33333333 8.00000000 -50.0000 16.66666666 10.00000000 -[-50.0000,-40.0000,-30.0000,-20.0000,-10.0000,0.0000,10.0000,20.0000,30.0000,40.0000,50.0000] -[-16.66666666,-13.33333333,-10.00000000,-6.66666666,-3.33333333,0.00000000,3.33333333,6.66666666,10.00000000,13.33333333,16.66666666] -[-10.00000000,-8.00000000,-6.00000000,-4.00000000,-2.00000000,0.00000000,2.00000000,4.00000000,6.00000000,8.00000000,10.00000000] -0.0000 0.00000000 0.00000000 Decimal(38, 8) --26.0000 -8.66666666 -5.20000000 Decimal(38, 8) -0.0000 0.00000000 0.00000000 -10.0000 3.33333333 2.00000000 -20.0000 6.66666666 4.00000000 -30.0000 10.00000000 6.00000000 -40.0000 13.33333333 8.00000000 -50.0000 16.66666666 10.00000000 -[-50.0000,-40.0000,-30.0000,-20.0000,-10.0000,0.0000,10.0000,20.0000,30.0000,40.0000,50.0000] -[-16.66666666,-13.33333333,-10.00000000,-6.66666666,-3.33333333,0.00000000,3.33333333,6.66666666,10.00000000,13.33333333,16.66666666] -[-10.00000000,-8.00000000,-6.00000000,-4.00000000,-2.00000000,0.00000000,2.00000000,4.00000000,6.00000000,8.00000000,10.00000000] -0.0000 0.00000000 0.00000000 Decimal(38, 8) --25.0000 -8.33333333 -5.00000000 Decimal(38, 8) -0.0000 0.00000000 0.00000000 -10.0000 3.33333333 2.00000000 -20.0000 6.66666666 4.00000000 -30.0000 10.00000000 6.00000000 -40.0000 13.33333333 8.00000000 -50.0000 16.66666666 10.00000000 -[-50.0000,-40.0000,-30.0000,-20.0000,-10.0000,0.0000,10.0000,20.0000,30.0000,40.0000,50.0000] -[-16.66666666,-13.33333333,-10.00000000,-6.66666666,-3.33333333,0.00000000,3.33333333,6.66666666,10.00000000,13.33333333,16.66666666] -[-10.00000000,-8.00000000,-6.00000000,-4.00000000,-2.00000000,0.00000000,2.00000000,4.00000000,6.00000000,8.00000000,10.00000000] -0.0000 0.00000000 0.00000000 Decimal(38, 8) --26.0000 -8.66666666 -5.20000000 Decimal(38, 8) -0.0000 0.00000000 0.00000000 -10.0000 3.33333333 2.00000000 -20.0000 6.66666666 4.00000000 -30.0000 10.00000000 6.00000000 -40.0000 13.33333333 8.00000000 -50.0000 16.66666666 10.00000000 -[-50.0000,-40.0000,-30.0000,-20.0000,-10.0000,0.0000,10.0000,20.0000,30.0000,40.0000,50.0000] -[-16.66666666,-13.33333333,-10.00000000,-6.66666666,-3.33333333,0.00000000,3.33333333,6.66666666,10.00000000,13.33333333,16.66666666] -[-10.00000000,-8.00000000,-6.00000000,-4.00000000,-2.00000000,0.00000000,2.00000000,4.00000000,6.00000000,8.00000000,10.00000000] +-50 -50 -16.66666666 -16.66666666 -10 -10 +1 1 0.33333333 0.33333333 0.2 0.2 +50 50 16.66666666 16.66666666 10 10 +-1 -1 -0.33333333 -0.33333333 -0.2 -0.2 +0 0 0 Decimal(38, 8) +-25.5 -8.49999999 -5.1 Decimal(38, 8) +0 0 0 +10 3.33333333 2 +20 6.66666666 4 +30 10 6 +40 13.33333333 8 +50 16.66666666 10 +[-50,-40,-30,-20,-10,0,10,20,30,40,50] +[-16.66666666,-13.33333333,-10,-6.66666666,-3.33333333,0,3.33333333,6.66666666,10,13.33333333,16.66666666] +[-10,-8,-6,-4,-2,0,2,4,6,8,10] +0 0 0 Decimal(38, 8) +-25 -8.33333333 -5 Decimal(38, 8) +0 0 0 +10 3.33333333 2 +20 6.66666666 4 +30 10 6 +40 13.33333333 8 +50 16.66666666 10 +[-50,-40,-30,-20,-10,0,10,20,30,40,50] +[-16.66666666,-13.33333333,-10,-6.66666666,-3.33333333,0,3.33333333,6.66666666,10,13.33333333,16.66666666] +[-10,-8,-6,-4,-2,0,2,4,6,8,10] +0 0 0 Decimal(38, 8) +-26 -8.66666666 -5.2 Decimal(38, 8) +0 0 0 +10 3.33333333 2 +20 6.66666666 4 +30 10 6 +40 13.33333333 8 +50 16.66666666 10 +[-50,-40,-30,-20,-10,0,10,20,30,40,50] +[-16.66666666,-13.33333333,-10,-6.66666666,-3.33333333,0,3.33333333,6.66666666,10,13.33333333,16.66666666] +[-10,-8,-6,-4,-2,0,2,4,6,8,10] +0 0 0 Decimal(38, 8) +-25 -8.33333333 -5 Decimal(38, 8) +0 0 0 +10 3.33333333 2 +20 6.66666666 4 +30 10 6 +40 13.33333333 8 +50 16.66666666 10 +[-50,-40,-30,-20,-10,0,10,20,30,40,50] +[-16.66666666,-13.33333333,-10,-6.66666666,-3.33333333,0,3.33333333,6.66666666,10,13.33333333,16.66666666] +[-10,-8,-6,-4,-2,0,2,4,6,8,10] +0 0 0 Decimal(38, 8) +-26 -8.66666666 -5.2 Decimal(38, 8) +0 0 0 +10 3.33333333 2 +20 6.66666666 4 +30 10 6 +40 13.33333333 8 +50 16.66666666 10 +[-50,-40,-30,-20,-10,0,10,20,30,40,50] +[-16.66666666,-13.33333333,-10,-6.66666666,-3.33333333,0,3.33333333,6.66666666,10,13.33333333,16.66666666] +[-10,-8,-6,-4,-2,0,2,4,6,8,10] 850 94.44444438684269 34 Float64 Float64 Float64 850 94.4444443868427 34.00000000000001 858.5 95.38888883071111 34.34 Float64 Float64 Float64 diff --git a/tests/queries/0_stateless/00700_decimal_arithm.reference b/tests/queries/0_stateless/00700_decimal_arithm.reference index 9de0d4cbf9a..a41ef5b0557 100644 --- a/tests/queries/0_stateless/00700_decimal_arithm.reference +++ b/tests/queries/0_stateless/00700_decimal_arithm.reference @@ -1,37 +1,37 @@ 84 0 1764 1 1 1 84 0 1764 1 1 1 84 0 1764 1 1 1 -84.840 0.000 1799.456400 1.000 1.000 1.000 -84.840000000 0.000000000 -84.840000000000000000 0.000000000000000000 98.044565395307682683126962841158942720 1.000000000000000000 1.000000000000000000 1.000000000000000000 -84.840000000000000000 0.000000000000000000 -84.84 0.00 1799.4564 1.00 1.00 1.00 +84.84 0 1799.4564 1 1 1 +84.84 0 +84.84 0 98.04456539530768268312696284115894272 1 1 1 +84.84 0 +84.84 0 1799.4564 1 1 1 63 21 -42 882 -882 2 0 2 0 63 21 -42 882 -882 2 0 2 0 63 21 -42 882 -882 2 0 2 0 -1.00305798474369219219752355409390731264 -0.16305798474369219219752355409390731264 1.49059173023461586584365185794205286400 -1.38847100762815390390123822295304634368 1.38847100762815390390123822295304634368 0.02000000000000000000000000000000000000 0.00500000000000000000000000000000000000 -63.420 21.420 -41.580 890.820 -890.820 2.020 0.505 2.020 0.505 -63.420000000 21.420000000 -41.580000000 890.820000000 -890.820000000 2.020000000 0.505000000 2.020000000 0.505000000 -63.420000000000000000 21.420000000000000000 -41.580000000000000000 890.820000000000000000 -890.820000000000000000 2.020000000000000000 0.505000000000000000 2.020000000000000000 0.505000000000000000 -63.42 21.42 -41.58 890.82 -890.82 2.02 0.50 2.02 0.50 +1.00305798474369219219752355409390731264 -0.16305798474369219219752355409390731264 1.490591730234615865843651857942052864 -1.38847100762815390390123822295304634368 1.38847100762815390390123822295304634368 0.02 0.005 +63.42 21.42 -41.58 890.82 -890.82 2.02 0.505 2.02 0.505 +63.42 21.42 -41.58 890.82 -890.82 2.02 0.505 2.02 0.505 +63.42 21.42 -41.58 890.82 -890.82 2.02 0.505 2.02 0.505 +63.42 21.42 -41.58 890.82 -890.82 2.02 0.5 2.02 0.5 63 -21 42 882 -882 0 2 0 2 63 -21 42 882 -882 0 2 0 2 63 -21 42 882 -882 0 2 0 2 -1.00305798474369219219752355409390731264 0.16305798474369219219752355409390731264 -1.49059173023461586584365185794205286400 -1.38847100762815390390123822295304634368 1.38847100762815390390123822295304634368 -0.00000000000000000000000000000000000001 0.00000000000000000000000000000000000001 -63.420 -21.420 41.580 890.820 -890.820 0.495 1.980 0.495 1.980 -63.420000000 -21.420000000 41.580000000 890.820000000 -890.820000000 -63.420000000000000000 -21.420000000000000000 41.580000000000000000 890.820000000000000000 -890.820000000000000000 0.495049504950495049 1.980198019801980198 0.495049504950495049 1.980198019801980198 +1.00305798474369219219752355409390731264 0.16305798474369219219752355409390731264 -1.490591730234615865843651857942052864 -1.38847100762815390390123822295304634368 1.38847100762815390390123822295304634368 -0.00000000000000000000000000000000000001 0.00000000000000000000000000000000000001 +63.42 -21.42 41.58 890.82 -890.82 0.495 1.98 0.495 1.98 +63.42 -21.42 41.58 890.82 -890.82 +63.42 -21.42 41.58 890.82 -890.82 0.495049504950495049 1.980198019801980198 0.495049504950495049 1.980198019801980198 63.42 -21.42 41.58 890.82 -890.82 0.49 1.98 0.49 1.98 --42 42 42 42 0.420000000 0.420000000000000000 0.42000000000000000000000000000000000000 42.420 42.420000000 42.42 -0 0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.000 0.000000000 0.00 -42 -42 -42 -42 -0.420000000 -0.420000000000000000 -0.42000000000000000000000000000000000000 -42.420 -42.420000000 -42.42 -42 42 42 0.420000000 0.420000000000000000 0.42000000000000000000000000000000000000 42.420 42.420000000 42.42 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.000 0.000000000 0.00 -42 42 42 0.420000000 0.420000000000000000 0.42000000000000000000000000000000000000 42.420 42.420000000 42.42 +-42 42 42 42 0.42 0.42 0.42 42.42 42.42 42.42 +0 0 0 0 0 0 0 0 0 0 +42 -42 -42 -42 -0.42 -0.42 -0.42 -42.42 -42.42 -42.42 +42 42 42 0.42 0.42 0.42 42.42 42.42 42.42 +0 0 0 0 0 0 0 0 0 +42 42 42 0.42 0.42 0.42 42.42 42.42 42.42 1 1 1 1 1 0 1 0 1 0 1 0 -0.0000 \N \N -0.00000000 \N \N -0.000000000000000000 \N \N +0 \N \N +0 \N \N +0 \N \N diff --git a/tests/queries/0_stateless/00700_decimal_array_functions.reference b/tests/queries/0_stateless/00700_decimal_array_functions.reference index 969a8dd2f18..ae872b7a347 100644 --- a/tests/queries/0_stateless/00700_decimal_array_functions.reference +++ b/tests/queries/0_stateless/00700_decimal_array_functions.reference @@ -1,20 +1,20 @@ -[0.0000,1.0000] Array(Decimal(9, 4)) -[0.00000000,1.00000000] Array(Decimal(18, 8)) -[0.00000000,1.00000000] Array(Decimal(38, 8)) +[0,1] Array(Decimal(9, 4)) +[0,1] Array(Decimal(18, 8)) +[0,1] Array(Decimal(38, 8)) - -1.0000 Decimal(38, 4) -1.00000000 Decimal(38, 8) -1.00000000 Decimal(38, 8) +1 Decimal(38, 4) +1 Decimal(38, 8) +1 Decimal(38, 8) - -[1.0000,2.0000] Array(Decimal(38, 4)) -[1.00000000,2.00000000] Array(Decimal(38, 8)) -[1.00000000,2.00000000] Array(Decimal(38, 8)) +[1,2] Array(Decimal(38, 4)) +[1,2] Array(Decimal(38, 8)) +[1,2] Array(Decimal(38, 8)) - -[1.0000,2.0000] Array(Decimal(38, 4)) -[1.00000000,2.00000000] Array(Decimal(38, 8)) -[1.00000000,2.00000000] Array(Decimal(38, 8)) +[1,2] Array(Decimal(38, 4)) +[1,2] Array(Decimal(38, 8)) +[1,2] Array(Decimal(38, 8)) - -[1.0000] Array(Decimal(9, 4)) -[1.00000000] Array(Decimal(18, 8)) -[1.00000000] Array(Decimal(38, 8)) +[1] Array(Decimal(9, 4)) +[1] Array(Decimal(18, 8)) +[1] Array(Decimal(38, 8)) - diff --git a/tests/queries/0_stateless/00700_decimal_bounds.reference b/tests/queries/0_stateless/00700_decimal_bounds.reference index 3f25fccc942..86688ea0546 100644 --- a/tests/queries/0_stateless/00700_decimal_bounds.reference +++ b/tests/queries/0_stateless/00700_decimal_bounds.reference @@ -1,43 +1,43 @@ --999999999 -999999999999999999 0 -0.999999999 0.000000000000000000 0.00000000000000000000000000000000000000 -9999.99999 0.000000000 0.000000000000000000 0 --900000000 -900000000000000000 -90000000000000000000000000000000000000 -0.000000009 -0.000000000000000009 -0.00000000000000000000000000000000000009 0.00000 0.000000000 0.000000000000000000 0 --1 -1 -1 -0.000000001 0.000000000000000000 0.00000000000000000000000000000000000000 -0.00001 -0.000000001 0.000000000000000000 -1 -0 0 -99999999999999999999999999999999999999 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 -0.999999999999999999 0.00000000000000000000000000000000000000 0.00000 -999999999.999999999 0.000000000000000000 0 -0 0 0 0.000000000 -0.000000000000000001 -0.00000000000000000000000000000000000001 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 -0.99999999999999999999999999999999999999 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 -99999999999999999999.999999999999999999 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 -0.000000000000000001 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000001 0 -0 0 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 99999999999999999999.999999999999999999 0 -0 0 0 0.000000000 0.000000000000000000 0.99999999999999999999999999999999999999 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.000000000000000001 0.00000000000000000000000000000000000001 0.00000 0.000000000 0.000000000000000000 0 -0 0 0 0.000000000 0.999999999999999999 0.00000000000000000000000000000000000000 0.00000 999999999.999999999 0.000000000000000000 0 -0 0 99999999999999999999999999999999999999 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.00000 0.000000000 0.000000000000000000 0 -1 1 1 0.000000001 0.000000000000000000 0.00000000000000000000000000000000000000 0.00001 0.000000001 0.000000000000000000 1 -42 42 0 0.000000000 0.000000000000000000 0.00000000000000000000000000000000000000 0.99999 0.000000000 0.000000000000000000 0 -900000000 900000000000000000 90000000000000000000000000000000000000 0.000000009 0.000000000000000009 0.00000000000000000000000000000000000009 0.00000 0.000000000 0.000000000000000000 0 -999999999 999999999999999999 0 0.999999999 0.000000000000000000 0.00000000000000000000000000000000000000 9999.99999 0.000000000 0.000000000000000000 0 +-999999999 -999999999999999999 0 -0.999999999 0 0 -9999.99999 0 0 0 +-900000000 -900000000000000000 -90000000000000000000000000000000000000 -0.000000009 -0.000000000000000009 -0.00000000000000000000000000000000000009 0 0 0 0 +-1 -1 -1 -0.000000001 0 0 -0.00001 -0.000000001 0 -1 +0 0 -99999999999999999999999999999999999999 0 0 0 0 0 0 0 +0 0 0 0 -0.999999999999999999 0 0 -999999999.999999999 0 0 +0 0 0 0 -0.000000000000000001 -0.00000000000000000000000000000000000001 0 0 0 0 +0 0 0 0 0 -0.99999999999999999999999999999999999999 0 0 0 0 +0 0 0 0 0 0 0 0 -99999999999999999999.999999999999999999 0 +0 0 0 0 0 0 0 0 -0.000000000000000001 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0.000000000000000001 0 +0 0 0 0 0 0 0 0 99999999999999999999.999999999999999999 0 +0 0 0 0 0 0.99999999999999999999999999999999999999 0 0 0 0 +0 0 0 0 0.000000000000000001 0.00000000000000000000000000000000000001 0 0 0 0 +0 0 0 0 0.999999999999999999 0 0 999999999.999999999 0 0 +0 0 99999999999999999999999999999999999999 0 0 0 0 0 0 0 +1 1 1 0.000000001 0 0 0.00001 0.000000001 0 1 +42 42 0 0 0 0 0.99999 0 0 0 +900000000 900000000000000000 90000000000000000000000000000000000000 0.000000009 0.000000000000000009 0.00000000000000000000000000000000000009 0 0 0 0 +999999999 999999999999999999 0 0.999999999 0 0 9999.99999 0 0 0 diff --git a/tests/queries/0_stateless/00700_decimal_casts.reference b/tests/queries/0_stateless/00700_decimal_casts.reference index 99d8b949398..9f469f2907e 100644 --- a/tests/queries/0_stateless/00700_decimal_casts.reference +++ b/tests/queries/0_stateless/00700_decimal_casts.reference @@ -1,30 +1,30 @@ -1.1 1.10 1.10000000 +1.1 1.1 1.1 1 -1 1.1 1.10 1.10000000 +1 1.1 1.1 1.1 0.1 0 -0.1 0 0.1 0 -0.1 0 0.1 0 -0.1 0 -0.0000000001 0.000000000 --0.0000000001 0.000000000 -0.0000000000000000001 0.000000000000000000 --0.0000000000000000001 0.000000000000000000 -0.000000000000000000000000000000000000001 0.00000000000000000000000000000000000000 --0.000000000000000000000000000000000000001 0.00000000000000000000000000000000000000 +0.0000000001 0 +-0.0000000001 0 +0.0000000000000000001 0 +-0.0000000000000000001 0 +0.000000000000000000000000000000000000001 0 +-0.000000000000000000000000000000000000001 0 1e-1 0 -1e-1 0 1e-1 0 -1e-1 0 1e-1 0 -1e-1 0 -1e-10 0.000000000 --1e-10 0.000000000 -1e-19 0.000000000000000000 --1e-19 0.000000000000000000 -1e-39 0.00000000000000000000000000000000000000 --1e-39 0.00000000000000000000000000000000000000 +1e-10 0 +-1e-10 0 +1e-19 0 +-1e-19 0 +1e-39 0 +-1e-39 0 9999999 9999999 -9999999 9999999 -9999999 999999.9 999999.9 -999999.9 999999.9 -999999.9 99999.99 99999.99 -99999.99 99999.99 -99999.99 @@ -33,8 +33,8 @@ 99.99999 99.99999 -99.99999 99.99999 -99.99999 9.999999 9.999999 -9.999999 9.999999 -9.999999 0.9999999 0.9999999 -0.9999999 0.9999999 -0.9999999 -10 10.00000000 -10.00000000 10.00000000 -10.00000000 -1 1.000000000 -1.000000000 1.000000000 -1.000000000 +10 10 -10 10 -10 +1 1 -1 1 -1 999999999 999999999 -999999999 999999999 -999999999 99999999.9 99999999.9 -99999999.9 99999999.9 -99999999.9 9999999.99 9999999.99 -9999999.99 9999999.99 -9999999.99 @@ -45,111 +45,111 @@ 99.9999999 99.9999999 -99.9999999 99.9999999 -99.9999999 9.99999999 9.99999998 -9.99999998 9.99999998 -9.99999998 0.999999999 0.999999999 -0.999999999 0.999999999 -0.999999999 -1000000000 1000000000.000000000 -1000000000.000000000 -100000000 100000000.0000000000 -100000000.0000000000 -10000000 10000000.00000000000 -10000000.00000000000 -1000000 1000000.000000000000 -1000000.000000000000 -100000 100000.0000000000000 -100000.0000000000000 -10000 10000.00000000000000 -10000.00000000000000 -1000 1000.000000000000000 -1000.000000000000000 -100 100.0000000000000000 -100.0000000000000000 -10 10.00000000000000000 -10.00000000000000000 -1 1.000000000000000000 -1.000000000000000000 +1000000000 1000000000 -1000000000 +100000000 100000000 -100000000 +10000000 10000000 -10000000 +1000000 1000000 -1000000 +100000 100000 -100000 +10000 10000 -10000 +1000 1000 -1000 +100 100 -100 +10 10 -10 +1 1 -1 1000000000000000000 1000000000000000000 -1000000000000000000 -100000000000000000 100000000000000000.0 -100000000000000000.0 -10000000000000000 10000000000000000.00 -10000000000000000.00 -1000000000000000 1000000000000000.000 -1000000000000000.000 -100000000000000 100000000000000.0000 -100000000000000.0000 -10000000000000 10000000000000.00000 -10000000000000.00000 -1000000000000 1000000000000.000000 -1000000000000.000000 -100000000000 100000000000.0000000 -100000000000.0000000 -10000000000 10000000000.00000000 -10000000000.00000000 -1000000000 1000000000.000000000 -1000000000.000000000 -1000000000 1000000000.000000000 -1000000000.000000000 -100000000 100000000.0000000000 -100000000.0000000000 -10000000 10000000.00000000000 -10000000.00000000000 -1000000 1000000.000000000000 -1000000.000000000000 -100000 100000.0000000000000 -100000.0000000000000 -10000 10000.00000000000000 -10000.00000000000000 -1000 1000.000000000000000 -1000.000000000000000 -100 100.0000000000000000 -100.0000000000000000 -10 10.00000000000000000 -10.00000000000000000 -1 1.000000000000000000 -1.000000000000000000 -0.0000 0.00 0.00000000 -1.0000 0.11 0.11000000 -2.0000 0.22 0.22000000 -3.0000 0.33 0.33000000 -4.0000 0.44 0.44000000 -5.0000 0.55 0.55000000 -6.0000 0.66 0.66000000 -7.0000 0.77 0.77000000 -8.0000 0.88 0.88000000 -9.0000 1.00 1.00000000 -0.0000 0.00000000 0.00 -1.0000 0.11110000 0.11 -2.0000 0.22220000 0.22 -3.0000 0.33330000 0.33 -4.0000 0.44440000 0.44 -5.0000 0.55550000 0.55 -6.0000 0.66660000 0.66 -7.0000 0.77770000 0.77 -8.0000 0.88880000 0.88 -9.0000 1.00000000 1.00 -0.00000000 0.0000 0.00 -1.00000000 0.1111 0.11 -2.00000000 0.2222 0.22 -3.00000000 0.3333 0.33 -4.00000000 0.4444 0.44 -5.00000000 0.5555 0.55 -6.00000000 0.6666 0.66 -7.00000000 0.7777 0.77 -8.00000000 0.8888 0.88 -9.00000000 1.0000 1.00 -0.0000 0.00 0.00000000 -1.0000 0.11 0.11000000 -2.0000 0.22 0.22000000 -3.0000 0.33 0.33000000 -4.0000 0.44 0.44000000 -5.0000 0.55 0.55000000 -6.0000 0.66 0.66000000 -7.0000 0.77 0.77000000 -8.0000 0.88 0.88000000 -9.0000 1.00 1.00000000 -0.0000 0.00000000 0.00 -1.0000 0.11110000 0.11 -2.0000 0.22220000 0.22 -3.0000 0.33330000 0.33 -4.0000 0.44440000 0.44 -5.0000 0.55550000 0.55 -6.0000 0.66660000 0.66 -7.0000 0.77770000 0.77 -8.0000 0.88880000 0.88 -9.0000 1.00000000 1.00 -0.00000000 0.0000 0.00 -1.00000000 0.1111 0.11 -2.00000000 0.2222 0.22 -3.00000000 0.3333 0.33 -4.00000000 0.4444 0.44 -5.00000000 0.5555 0.55 -6.00000000 0.6666 0.66 -7.00000000 0.7777 0.77 -8.00000000 0.8888 0.88 -9.00000000 1.0000 1.00 +100000000000000000 100000000000000000 -100000000000000000 +10000000000000000 10000000000000000 -10000000000000000 +1000000000000000 1000000000000000 -1000000000000000 +100000000000000 100000000000000 -100000000000000 +10000000000000 10000000000000 -10000000000000 +1000000000000 1000000000000 -1000000000000 +100000000000 100000000000 -100000000000 +10000000000 10000000000 -10000000000 +1000000000 1000000000 -1000000000 +1000000000 1000000000 -1000000000 +100000000 100000000 -100000000 +10000000 10000000 -10000000 +1000000 1000000 -1000000 +100000 100000 -100000 +10000 10000 -10000 +1000 1000 -1000 +100 100 -100 +10 10 -10 +1 1 -1 +0 0 0 +1 0.11 0.11 +2 0.22 0.22 +3 0.33 0.33 +4 0.44 0.44 +5 0.55 0.55 +6 0.66 0.66 +7 0.77 0.77 +8 0.88 0.88 +9 1 1 +0 0 0 +1 0.1111 0.11 +2 0.2222 0.22 +3 0.3333 0.33 +4 0.4444 0.44 +5 0.5555 0.55 +6 0.6666 0.66 +7 0.7777 0.77 +8 0.8888 0.88 +9 1 1 +0 0 0 +1 0.1111 0.11 +2 0.2222 0.22 +3 0.3333 0.33 +4 0.4444 0.44 +5 0.5555 0.55 +6 0.6666 0.66 +7 0.7777 0.77 +8 0.8888 0.88 +9 1 1 +0 0 0 +1 0.11 0.11 +2 0.22 0.22 +3 0.33 0.33 +4 0.44 0.44 +5 0.55 0.55 +6 0.66 0.66 +7 0.77 0.77 +8 0.88 0.88 +9 1 1 +0 0 0 +1 0.1111 0.11 +2 0.2222 0.22 +3 0.3333 0.33 +4 0.4444 0.44 +5 0.5555 0.55 +6 0.6666 0.66 +7 0.7777 0.77 +8 0.8888 0.88 +9 1 1 +0 0 0 +1 0.1111 0.11 +2 0.2222 0.22 +3 0.3333 0.33 +4 0.4444 0.44 +5 0.5555 0.55 +6 0.6666 0.66 +7 0.7777 0.77 +8 0.8888 0.88 +9 1 1 99 99 -99 99 -99 9999 9999 -9999 9999 -9999 999999999 999999999 -999999999 999999999 -999999999 999999999 999999999 -999999999 999999999 -999999999 -999999999 999999999.000000000 -999999999.000000000 999999999.00000000000000000000000000000 -999999999.00000000000000000000000000000 -999999999 999999999.000000000 -999999999.000000000 999999999.00000000000000000000000000000 -999999999.00000000000000000000000000000 +999999999 999999999 -999999999 999999999 -999999999 +999999999 999999999 -999999999 999999999 -999999999 +999999999999999999 999999999999999999 -999999999999999999 999999999999999999 999999999999999999 -999999999999999999 999999999999999999 999999999999999999 -999999999999999999 -999999999999999999 999999999999999999.00000000000000000000 -999999999999999999.00000000000000000000 99 99 99 9999 9999 9999 999999999 999999999 999999999 999999999 999999999 999999999 42.42 42.42 42.42 42.42 -42.42 42.4200000 42.4200000000000000 42.420000000000000000000000000000000000 +42.42 42.42 42.42 42.42 123456789 123456789123456789 12345678901234567890123456789012345678 0.123456789 0.123456789123456789 diff --git a/tests/queries/0_stateless/00700_decimal_casts_2.reference b/tests/queries/0_stateless/00700_decimal_casts_2.reference index 393baae6c47..ed951e82036 100644 --- a/tests/queries/0_stateless/00700_decimal_casts_2.reference +++ b/tests/queries/0_stateless/00700_decimal_casts_2.reference @@ -1,36 +1,36 @@ -1234567890.0000000000000000000000000000 1234567890.00000000000000000000000000000 1234567890.00000000000000000000000000000 +1234567890 1234567890 1234567890 -126561577.683753853853498429727072845824 -1234567890.00000000 1234567890.000000000 1234567890.000000000 -12345678.0 12345678.00 12345678.00 -9223372036854775807.000000 9223372036854775807 -9223372036854775807 +1234567890 1234567890 1234567890 +12345678 12345678 12345678 +9223372036854775807 9223372036854775807 -9223372036854775807 9223372036854775800 9223372036854775800 -9223372036854775800 -92233720368547758.00 92233720368547758 -92233720368547758 -2147483647.0000000000 2147483647 -2147483647 -2147483647.00 2147483647 -2147483647 +92233720368547758 92233720368547758 -92233720368547758 +2147483647 2147483647 -2147483647 +2147483647 2147483647 -2147483647 92233720368547757.99 92233720368547757 -92233720368547757 2147483640.99 2147483640 -2147483640 --0.90000000 0 --0.90000000 0 --0.90000000 0 --0.8000 0 --0.8000 0 --0.8000 0 --0.70 0 --0.70 0 --0.70 0 --0.600000 0 --0.600000 0 --0.600000 0 +-0.9 0 +-0.9 0 +-0.9 0 +-0.8 0 +-0.8 0 +-0.8 0 +-0.7 0 +-0.7 0 +-0.7 0 +-0.6 0 +-0.6 0 +-0.6 0 +18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 -18446744073709551615.00000000 18446744073709551615 4294967295 4294967295 -4294967295.0000000000 4294967295 4294967295 4294967295 -4294967295.0000 4294967295 +4294967295 4294967295 +4294967295 4294967295 +65535 65535 +65535 65535 65535 65535 -65535.0000000000 65535 65535 65535 -65535.0000 65535 2147483647 2147483647 -2147483647 -2147483647 2147483647 2147483647 diff --git a/tests/queries/0_stateless/00700_decimal_compare.reference b/tests/queries/0_stateless/00700_decimal_compare.reference index 2325847045f..6b2787642b7 100644 --- a/tests/queries/0_stateless/00700_decimal_compare.reference +++ b/tests/queries/0_stateless/00700_decimal_compare.reference @@ -2,27 +2,27 @@ 1 -42 -42 1 0 0 0 1 1 42 42 1 0 0 0 1 1 --42 -42.42000 0 0 1 1 0 1 -42 42.42000 0 1 0 1 1 0 +-42 -42.42 0 0 1 1 0 1 +42 42.42 0 1 0 1 1 0 1 1 1 0 0 0 -42 0 0 0 0 42 1 1 1 1 -42 0 0 0 0 42 1 1 1 1 -0.420000000 0.420000000000000000 0.42000000000000000000000000000000000000 -42.42 42.420000000 42.420000000000000000 42.42 --42.42 -42.420000000 -42.420000000000000000 -42.42 +0.42 0.42 0.42 +42.42 42.42 42.42 42.42 +-42.42 -42.42 -42.42 -42.42 42 42 42 42 42 42 42 42 42 42 42 42 --42 -42.42000 -42 -42.00000 -42 42.00000 42 42.42000 --42 -42 -42.42000 -0 0 0.00000 -0 0 0.00000 -42 42 42.42000 +-42 -42.42 -42 -42 +42 42 42 42.42 +-42 -42 -42.42 +0 0 0 +0 0 0 +42 42 42.42 1 0 1 0 1 0 @@ -35,5 +35,5 @@ 0 1 0 1 0 1 --42 -42 -42 -0.420000000 -0.420000000000000000 -0.42000000000000000000000000000000000000 -42.42000 -42.420000000 -42.420000000000000000 -42.42 -42 42 42 0.420000000 0.420000000000000000 0.42000000000000000000000000000000000000 42.42000 42.420000000 42.420000000000000000 42.42 +-42 -42 -42 -0.42 -0.42 -0.42 -42.42 -42.42 -42.42 -42.42 +42 42 42 0.42 0.42 0.42 42.42 42.42 42.42 42.42 diff --git a/tests/queries/0_stateless/00700_decimal_complex_types.reference b/tests/queries/0_stateless/00700_decimal_complex_types.reference index 9c7c6fefefd..b5ae11ad5d3 100644 --- a/tests/queries/0_stateless/00700_decimal_complex_types.reference +++ b/tests/queries/0_stateless/00700_decimal_complex_types.reference @@ -3,31 +3,31 @@ Array(Decimal(9, 2)) Array(Decimal(18, 2)) Array(Decimal(38, 2)) Decimal(9, 3) Decimal(18, 3) Decimal(38, 3) Decimal(9, 2) Decimal(18, 2) Decimal(38, 2) Tuple(Decimal(9, 1), Decimal(18, 1), Decimal(38, 1)) Decimal(9, 1) Decimal(18, 1) Decimal(38, 1) -0.100 -0.200 -0.300 -0.400 -0.500 -0.600 -0.700 -0.800 -0.900 +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 (9.1,9.2,9.3) 9.1 9.2 9.3 -[0.100,0.200,0.300] [0.100,0.200] [0.200,0.300] [0.100] [0.200] -[0.400,0.500,0.600] [0.400,0.500] [0.500,0.600] [0.400] [0.500] -[0.700,0.800,0.900] [0.700,0.800] [0.800,0.900] [0.700] [0.800] -[1.10,1.20] [1.10] [1.20] [1.10] [1.20] -[2.10,2.20] [2.10] [2.20] [2.10] [2.20] -[3.10,3.20] [3.10] [3.20] [3.10] [3.20] -[0.100,0.200,0.300,0.000] [0.000,0.100,0.200,0.300] -[0.400,0.500,0.600,0.000] [0.000,0.400,0.500,0.600] -[0.700,0.800,0.900,0.000] [0.000,0.700,0.800,0.900] -[0.100,0.200,0.300,0.000] Array(Decimal(9, 3)) -[0.400,0.500,0.600,0.000] Array(Decimal(18, 3)) -[0.700,0.800,0.900,0.000] Array(Decimal(38, 3)) -[0.0000,0.1000,0.2000,0.3000] Array(Decimal(9, 4)) -[0.0000,0.4000,0.5000,0.6000] Array(Decimal(18, 4)) -[0.0000,0.7000,0.8000,0.9000] Array(Decimal(38, 4)) +[0.1,0.2,0.3] [0.1,0.2] [0.2,0.3] [0.1] [0.2] +[0.4,0.5,0.6] [0.4,0.5] [0.5,0.6] [0.4] [0.5] +[0.7,0.8,0.9] [0.7,0.8] [0.8,0.9] [0.7] [0.8] +[1.1,1.2] [1.1] [1.2] [1.1] [1.2] +[2.1,2.2] [2.1] [2.2] [2.1] [2.2] +[3.1,3.2] [3.1] [3.2] [3.1] [3.2] +[0.1,0.2,0.3,0] [0,0.1,0.2,0.3] +[0.4,0.5,0.6,0] [0,0.4,0.5,0.6] +[0.7,0.8,0.9,0] [0,0.7,0.8,0.9] +[0.1,0.2,0.3,0] Array(Decimal(9, 3)) +[0.4,0.5,0.6,0] Array(Decimal(18, 3)) +[0.7,0.8,0.9,0] Array(Decimal(38, 3)) +[0,0.1,0.2,0.3] Array(Decimal(9, 4)) +[0,0.4,0.5,0.6] Array(Decimal(18, 4)) +[0,0.7,0.8,0.9] Array(Decimal(38, 4)) 3 3 3 2 2 2 0 0 0 @@ -66,24 +66,24 @@ Tuple(Decimal(9, 1), Decimal(18, 1), Decimal(38, 1)) Decimal(9, 1) Decimal(18, 1 1 1 1 -[0.100,0.200,0.300,0.400,0.500,0.600] Array(Decimal(18, 3)) -[0.100,0.200,0.300,0.700,0.800,0.900] Array(Decimal(38, 3)) -[0.400,0.500,0.600,0.700,0.800,0.900] Array(Decimal(38, 3)) -[0.100,0.200,0.300,1.100,1.200] Array(Decimal(9, 3)) -[0.400,0.500,0.600,2.100,2.200] Array(Decimal(18, 3)) -[0.700,0.800,0.900,3.100,3.200] Array(Decimal(38, 3)) -[0.100,0.200,0.300,2.100,2.200] Array(Decimal(18, 3)) -[0.100,0.200,0.300,3.100,3.200] Array(Decimal(38, 3)) -[0.400,0.500,0.600,1.100,1.200] Array(Decimal(18, 3)) -[0.400,0.500,0.600,3.100,3.200] Array(Decimal(38, 3)) -[0.700,0.800,0.900,1.100,1.200] Array(Decimal(38, 3)) -[0.700,0.800,0.900,2.100,2.200] Array(Decimal(38, 3)) +[0.1,0.2,0.3,0.4,0.5,0.6] Array(Decimal(18, 3)) +[0.1,0.2,0.3,0.7,0.8,0.9] Array(Decimal(38, 3)) +[0.4,0.5,0.6,0.7,0.8,0.9] Array(Decimal(38, 3)) +[0.1,0.2,0.3,1.1,1.2] Array(Decimal(9, 3)) +[0.4,0.5,0.6,2.1,2.2] Array(Decimal(18, 3)) +[0.7,0.8,0.9,3.1,3.2] Array(Decimal(38, 3)) +[0.1,0.2,0.3,2.1,2.2] Array(Decimal(18, 3)) +[0.1,0.2,0.3,3.1,3.2] Array(Decimal(38, 3)) +[0.4,0.5,0.6,1.1,1.2] Array(Decimal(18, 3)) +[0.4,0.5,0.6,3.1,3.2] Array(Decimal(38, 3)) +[0.7,0.8,0.9,1.1,1.2] Array(Decimal(38, 3)) +[0.7,0.8,0.9,2.1,2.2] Array(Decimal(38, 3)) 12345.6789 2 2 2 -12345.6789 2 2 2 123456789.123456784 2 2 2 -123456789.123456784 2 2 2 0.123456789123456784 2 2 2 --0.123456789112345680 2 2 2 +-0.12345678911234568 2 2 2 Decimal(9, 5) Decimal(9, 5) Decimal(9, 4) @@ -114,21 +114,21 @@ Decimal(38, 4) Decimal(38, 4) Decimal(9, 0) Decimal(18, 0) -32.20000 -32.10000 -64.20000 -32.10000 -128.20000 -32.10000 -32.20000 -64.10000 -64.20000 -64.10000 -128.20000 -64.10000 -32.20000 -128.10000 -64.20000 -128.10000 -128.20000 -128.10000 +32.2 +32.1 +64.2 +32.1 +128.2 +32.1 +32.2 +64.1 +64.2 +64.1 +128.2 +64.1 +32.2 +128.1 +64.2 +128.1 +128.2 +128.1 diff --git a/tests/queries/0_stateless/00700_decimal_defaults.reference b/tests/queries/0_stateless/00700_decimal_defaults.reference index f3f1fba83e7..04de9ac4c3d 100644 --- a/tests/queries/0_stateless/00700_decimal_defaults.reference +++ b/tests/queries/0_stateless/00700_decimal_defaults.reference @@ -4,11 +4,11 @@ c Decimal(38, 4) DEFAULT b / 3 d Decimal(9, 4) MATERIALIZED a + toDecimal32(\'0.2\', 1) e Decimal(18, 4) ALIAS b * 2 f Decimal(38, 4) ALIAS c * 6 -0.0000 0.0000 0.0000 -1.0000 0.5000 0.1666 -2.0000 1.0000 0.3333 -3.0000 1.5000 0.5000 -0.0000 0.0000 0.0000 0.2000 0.0000 0.0000 -1.0000 0.5000 0.1666 1.2000 1.0000 0.9996 -2.0000 1.0000 0.3333 2.2000 2.0000 1.9998 -3.0000 1.5000 0.5000 3.2000 3.0000 3.0000 +0 0 0 +1 0.5 0.1666 +2 1 0.3333 +3 1.5 0.5 +0 0 0 0.2 0 0 +1 0.5 0.1666 1.2 1 0.9996 +2 1 0.3333 2.2 2 1.9998 +3 1.5 0.5 3.2 3 3 diff --git a/tests/queries/0_stateless/00700_decimal_empty_aggregates.reference b/tests/queries/0_stateless/00700_decimal_empty_aggregates.reference index b079e91fddc..2c29b72f50c 100644 --- a/tests/queries/0_stateless/00700_decimal_empty_aggregates.reference +++ b/tests/queries/0_stateless/00700_decimal_empty_aggregates.reference @@ -1,50 +1,50 @@ 0 0 0 -[0.0000,0.0000] [0.0000000,0.0000000] [0.00000000,0.00000000] -0.0000 0.0000000 0.00000000 0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 0.0000 0.0000000 0.00000000 +[0,0] [0,0] [0,0] +0 0 0 0 0 0 +0 0 0 0 0 0 +0 0 0 0 0 0 +0 0 0 0 0 0 +0 0 0 0 0 0 (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) 0 0 0 0 0 0 -0.0000 0.0000 0.0000000 0.0000000 0.00000000 0.00000000 -0.0000 0.0000 0.0000000 0.0000000 0.00000000 0.00000000 -0.0000 0.0000 0.0000000 0.0000000 0.00000000 0.00000000 -0.0000 0.0000 0.0000000 0.0000000 0.00000000 0.00000000 -0.0000 0.0000000 0.00000000 Decimal(6, 4) Decimal(16, 7) Decimal(20, 8) -0.0000 0.0000000 0.00000000 Decimal(6, 4) Decimal(16, 7) Decimal(20, 8) -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -[0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000] -[0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000] -[0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000] -0.0000 0.0000000 0.00000000 Decimal(20, 8) -0.0000 0.0000000 0.00000000 Decimal(20, 8) -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -[0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000] -[0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000] -[0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000] -0.0000 0.0000000 0.00000000 Decimal(20, 8) -0.0000 0.0000000 0.00000000 Decimal(20, 8) -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -0.0000 0.0000000 0.00000000 -[0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000] -[0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000] -[0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000] +0 0 0 0 0 0 +0 0 0 0 0 0 +0 0 0 0 0 0 +0 0 0 0 0 0 +0 0 0 Decimal(6, 4) Decimal(16, 7) Decimal(20, 8) +0 0 0 Decimal(6, 4) Decimal(16, 7) Decimal(20, 8) +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +[0,0,0,0,0,0,0,0,0,0,0] +[0,0,0,0,0,0,0,0,0,0,0] +[0,0,0,0,0,0,0,0,0,0,0] +0 0 0 Decimal(20, 8) +0 0 0 Decimal(20, 8) +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +[0,0,0,0,0,0,0,0,0,0,0] +[0,0,0,0,0,0,0,0,0,0,0] +[0,0,0,0,0,0,0,0,0,0,0] +0 0 0 Decimal(20, 8) +0 0 0 Decimal(20, 8) +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +[0,0,0,0,0,0,0,0,0,0,0] +[0,0,0,0,0,0,0,0,0,0,0] +[0,0,0,0,0,0,0,0,0,0,0] inf inf inf Float64 Float64 Float64 nan nan nan nan nan nan Float64 Float64 Float64 diff --git a/tests/queries/0_stateless/00700_decimal_formats.reference b/tests/queries/0_stateless/00700_decimal_formats.reference index 0bea4ba27be..ff3961780a2 100644 --- a/tests/queries/0_stateless/00700_decimal_formats.reference +++ b/tests/queries/0_stateless/00700_decimal_formats.reference @@ -1,42 +1,42 @@ {"a":0.055,"b":-0.000000005,"c":0.000000000000000005} -{"a":0.100,"b":-0.100000000,"c":0.100000000000000000} -{"a":0.200,"b":-0.200000000,"c":0.200000000000000000} -{"a":0.300,"b":-0.300000000,"c":0.300000000000000000} -{"a":0.420,"b":-0.420000000,"c":0.420000000000000000} -{"a":1.000,"b":-1.000000000,"c":1.000000000000000000} -{"a":1.100,"b":-1.100000000,"c":1.100000000000000000} -{"a":2.000,"b":-2.000000000,"c":2.000000000000000000} -{"a":2.200,"b":-2.200000000,"c":2.200000000000000000} -{"a":3.000,"b":-3.000000000,"c":3.000000000000000000} -{"a":3.300,"b":-3.300000000,"c":3.300000000000000000} -{"a":42.000,"b":-42.000000000,"c":42.000000000000000000} -{"a":42.420,"b":-42.420000000,"c":42.420000000000000000} -{"a":440000.000,"b":-400000000.000000000,"c":40000000000000000000.000000000000000000} +{"a":0.1,"b":-0.1,"c":0.1} +{"a":0.2,"b":-0.2,"c":0.2} +{"a":0.3,"b":-0.3,"c":0.3} +{"a":0.42,"b":-0.42,"c":0.42} +{"a":1,"b":-1,"c":1} +{"a":1.1,"b":-1.1,"c":1.1} +{"a":2,"b":-2,"c":2} +{"a":2.2,"b":-2.2,"c":2.2} +{"a":3,"b":-3,"c":3} +{"a":3.3,"b":-3.3,"c":3.3} +{"a":42,"b":-42,"c":42} +{"a":42.42,"b":-42.42,"c":42.42} +{"a":440000,"b":-400000000,"c":40000000000000000000} 0.055,-0.000000005,0.000000000000000005 -0.100,-0.100000000,0.100000000000000000 -0.200,-0.200000000,0.200000000000000000 -0.300,-0.300000000,0.300000000000000000 -0.420,-0.420000000,0.420000000000000000 -1.000,-1.000000000,1.000000000000000000 -1.100,-1.100000000,1.100000000000000000 -2.000,-2.000000000,2.000000000000000000 -2.200,-2.200000000,2.200000000000000000 -3.000,-3.000000000,3.000000000000000000 -3.300,-3.300000000,3.300000000000000000 -42.000,-42.000000000,42.000000000000000000 -42.420,-42.420000000,42.420000000000000000 -440000.000,-400000000.000000000,40000000000000000000.000000000000000000 +0.1,-0.1,0.1 +0.2,-0.2,0.2 +0.3,-0.3,0.3 +0.42,-0.42,0.42 +1,-1,1 +1.1,-1.1,1.1 +2,-2,2 +2.2,-2.2,2.2 +3,-3,3 +3.3,-3.3,3.3 +42,-42,42 +42.42,-42.42,42.42 +440000,-400000000,40000000000000000000 0.055 -0.000000005 0.000000000000000005 -0.100 -0.100000000 0.100000000000000000 -0.200 -0.200000000 0.200000000000000000 -0.300 -0.300000000 0.300000000000000000 -0.420 -0.420000000 0.420000000000000000 -1.000 -1.000000000 1.000000000000000000 -1.100 -1.100000000 1.100000000000000000 -2.000 -2.000000000 2.000000000000000000 -2.200 -2.200000000 2.200000000000000000 -3.000 -3.000000000 3.000000000000000000 -3.300 -3.300000000 3.300000000000000000 -42.000 -42.000000000 42.000000000000000000 -42.420 -42.420000000 42.420000000000000000 -440000.000 -400000000.000000000 40000000000000000000.000000000000000000 +0.1 -0.1 0.1 +0.2 -0.2 0.2 +0.3 -0.3 0.3 +0.42 -0.42 0.42 +1 -1 1 +1.1 -1.1 1.1 +2 -2 2 +2.2 -2.2 2.2 +3 -3 3 +3.3 -3.3 3.3 +42 -42 42 +42.42 -42.42 42.42 +440000 -400000000 40000000000000000000 diff --git a/tests/queries/0_stateless/00700_decimal_gathers.reference b/tests/queries/0_stateless/00700_decimal_gathers.reference index bbfd7388e12..273642d15a8 100644 --- a/tests/queries/0_stateless/00700_decimal_gathers.reference +++ b/tests/queries/0_stateless/00700_decimal_gathers.reference @@ -1,13 +1,13 @@ -[2.000] -[2.0000000000] -[2.000000000000000000] -[1.000] -[1.0000000000] -[1.000000000000000000] -- -[2.000] -[1] -[2.000000000000000000] -[1.000] [2] -[1.000000000000000000] +[2] +[2] +[1] +[1] +[1] +- +[2] +[1] +[2] +[1] +[2] +[1] diff --git a/tests/queries/0_stateless/00700_decimal_in_keys.reference b/tests/queries/0_stateless/00700_decimal_in_keys.reference index ec11144a206..4b3486b5ce7 100644 --- a/tests/queries/0_stateless/00700_decimal_in_keys.reference +++ b/tests/queries/0_stateless/00700_decimal_in_keys.reference @@ -5,25 +5,25 @@ 1 1 5 -9.00000000 29.00000000 29.00000000 -8.00000000 28.00000000 28.00000000 -7.00000000 27.00000000 27.00000000 -6.00000000 26.00000000 26.00000000 -9.00000000 19.00000000 19.00000000 -8.00000000 18.00000000 18.00000000 -7.00000000 17.00000000 17.00000000 -6.00000000 16.00000000 16.00000000 -9.00000000 9.00000000 9.00000000 -8.00000000 8.00000000 8.00000000 -7.00000000 7.00000000 7.00000000 -6.00000000 6.00000000 6.00000000 -1.00000000 1.00000000 1.00000000 -3.00000000 3.00000000 3.00000000 -1.00000000 11.00000000 11.00000000 -3.00000000 13.00000000 13.00000000 -1.00000000 21.00000000 21.00000000 -3.00000000 23.00000000 23.00000000 -1.00000000 31.00000000 31.00000000 -3.00000000 33.00000000 33.00000000 -1.00000000 41.00000000 41.00000000 -3.00000000 43.00000000 43.00000000 +9 29 29 +8 28 28 +7 27 27 +6 26 26 +9 19 19 +8 18 18 +7 17 17 +6 16 16 +9 9 9 +8 8 8 +7 7 7 +6 6 6 +1 1 1 +3 3 3 +1 11 11 +3 13 13 +1 21 21 +3 23 23 +1 31 31 +3 33 33 +1 41 41 +3 43 43 diff --git a/tests/queries/0_stateless/00700_decimal_math.reference b/tests/queries/0_stateless/00700_decimal_math.reference index f58e08dc1fb..eb556ac49b8 100644 --- a/tests/queries/0_stateless/00700_decimal_math.reference +++ b/tests/queries/0_stateless/00700_decimal_math.reference @@ -1,30 +1,30 @@ -42.4200 3.7476 42.419154 -42.4200 5.4066 42.417862 -42.4200 1.6275 42.413098 -42.4200 6.513 42.419169 -42.4200 3.4875 42.417263671875 -1.00000 0.8427007929497149 0.15729920705028513 -42.4200 115.60113124678627 1.6029995567009473e50 -0.00 0 1 0 +42.42 3.7476 42.419154 +42.42 5.4066 42.417862 +42.42 1.6275 42.413098 +42.42 6.513 42.419169 +42.42 3.4875 42.417263671875 +1 0.8427007929497149 0.15729920705028513 +42.42 115.60113124678627 1.6029995567009473e50 +0 0 1 0 3.14159265 0 -1 -0 -1.00 1.5707963267948966 0 0.7853981633974483 -42.4200 3.7476 42.419154 -42.4200 5.4066 42.417862 -42.4200 1.6275 42.413098 -42.4200 6.513 42.419169 -42.4200 3.4875 42.417263671875 -1.00000 0.8427007929497149 0.15729920705028513 -42.4200 115.60113124678627 1.6029995567009473e50 -0.00 0 1 0 +1 1.5707963267948966 0 0.7853981633974483 +42.42 3.7476 42.419154 +42.42 5.4066 42.417862 +42.42 1.6275 42.413098 +42.42 6.513 42.419169 +42.42 3.4875 42.417263671875 +1 0.8427007929497149 0.15729920705028513 +42.42 115.60113124678627 1.6029995567009473e50 +0 0 1 0 3.14159265358979328 0 -1 -0 -1.00 1.5707963267948966 0 0.7853981633974483 -42.4200 3.7476 42.419154 -42.4200 5.4066 42.417862 -42.4200 1.6275 42.413098 -42.4200 6.513 42.419169 -42.4200 3.4875 42.417263671875 -1.00000 0.8427007929497149 0.15729920705028513 -42.4200 115.60113124678627 1.6029995567009473e50 -0.00 0 1 0 +1 1.5707963267948966 0 0.7853981633974483 +42.42 3.7476 42.419154 +42.42 5.4066 42.417862 +42.42 1.6275 42.413098 +42.42 6.513 42.419169 +42.42 3.4875 42.417263671875 +1 0.8427007929497149 0.15729920705028513 +42.42 115.60113124678627 1.6029995567009473e50 +0 0 1 0 3.14159265358979 0 -1 -0 -1.00 1.5707963267948966 0 0.7853981633974483 +1 1.5707963267948966 0 0.7853981633974483 diff --git a/tests/queries/0_stateless/00700_decimal_null.reference b/tests/queries/0_stateless/00700_decimal_null.reference index 250a437a883..e9ddf011260 100644 --- a/tests/queries/0_stateless/00700_decimal_null.reference +++ b/tests/queries/0_stateless/00700_decimal_null.reference @@ -17,11 +17,11 @@ \N 1 1 -1.10 1.10000 1.10000 1.1000 1.10000000 1.10000000 -2.20 2.20000 2.20000 2.2000 \N \N -3.30 3.30000 3.30000 \N 3.30000000 \N -4.40 4.40000 4.40000 \N \N 4.40000000 -5.50 5.50000 5.50000 \N \N \N +1.1 1.1 1.1 1.1 1.1 1.1 +2.2 2.2 2.2 2.2 \N \N +3.3 3.3 3.3 \N 3.3 \N +4.4 4.4 4.4 \N \N 4.4 +5.5 5.5 5.5 \N \N \N 0 1 0 1 0 1 diff --git a/tests/queries/0_stateless/00700_decimal_round.reference b/tests/queries/0_stateless/00700_decimal_round.reference index 230b6863411..d0f03c07849 100644 --- a/tests/queries/0_stateless/00700_decimal_round.reference +++ b/tests/queries/0_stateless/00700_decimal_round.reference @@ -1,75 +1,75 @@ -12345.6789 12346.0000 12345.7000 12345.6800 12345.6790 12345.6789 12345.6789 -12345.6789 12346.0000 12345.7000 12345.6800 12345.6790 12345.6789 12345.6789 -12345.6789 12346.0000 12345.7000 12345.6800 12345.6790 12345.6789 12345.6789 -12345.6789 12345.0000 12345.6000 12345.6700 12345.6780 12345.6789 12345.6789 -12345.6789 12345.0000 12345.6000 12345.6700 12345.6780 12345.6789 12345.6789 --12345.6789 -12346.0000 -12345.7000 -12345.6800 -12345.6790 -12345.6789 -12345.6789 --12345.6789 -12346.0000 -12345.7000 -12345.6800 -12345.6790 -12345.6789 -12345.6789 --12345.6789 -12345.0000 -12345.6000 -12345.6700 -12345.6780 -12345.6789 -12345.6789 --12345.6789 -12346.0000 -12345.7000 -12345.6800 -12345.6790 -12345.6789 -12345.6789 --12345.6789 -12345.0000 -12345.6000 -12345.6700 -12345.6780 -12345.6789 -12345.6789 -12345.6789 12350.0000 12300.0000 12000.0000 10000.0000 0.0000 -12345.6789 12350.0000 12300.0000 12000.0000 10000.0000 0.0000 -12345.6789 12350.0000 12400.0000 13000.0000 20000.0000 100000.0000 -12345.6789 12340.0000 12300.0000 12000.0000 10000.0000 0.0000 -12345.6789 12340.0000 12300.0000 12000.0000 10000.0000 0.0000 --12345.6789 -12350.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 --12345.6789 -12350.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 --12345.6789 -12340.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 --12345.6789 -12350.0000 -12400.0000 -13000.0000 -20000.0000 -100000.0000 --12345.6789 -12340.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 -12345.6789 12346.0000 12345.7000 12345.6800 12345.6790 12345.6789 12345.6789 -12345.6789 12346.0000 12345.7000 12345.6800 12345.6790 12345.6789 12345.6789 -12345.6789 12346.0000 12345.7000 12345.6800 12345.6790 12345.6789 12345.6789 -12345.6789 12345.0000 12345.6000 12345.6700 12345.6780 12345.6789 12345.6789 -12345.6789 12345.0000 12345.6000 12345.6700 12345.6780 12345.6789 12345.6789 --12345.6789 -12346.0000 -12345.7000 -12345.6800 -12345.6790 -12345.6789 -12345.6789 --12345.6789 -12346.0000 -12345.7000 -12345.6800 -12345.6790 -12345.6789 -12345.6789 --12345.6789 -12345.0000 -12345.6000 -12345.6700 -12345.6780 -12345.6789 -12345.6789 --12345.6789 -12346.0000 -12345.7000 -12345.6800 -12345.6790 -12345.6789 -12345.6789 --12345.6789 -12345.0000 -12345.6000 -12345.6700 -12345.6780 -12345.6789 -12345.6789 -12345.6789 12350.0000 12300.0000 12000.0000 10000.0000 0.0000 -12345.6789 12350.0000 12300.0000 12000.0000 10000.0000 0.0000 -12345.6789 12350.0000 12400.0000 13000.0000 20000.0000 100000.0000 -12345.6789 12340.0000 12300.0000 12000.0000 10000.0000 0.0000 -12345.6789 12340.0000 12300.0000 12000.0000 10000.0000 0.0000 --12345.6789 -12350.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 --12345.6789 -12350.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 --12345.6789 -12340.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 --12345.6789 -12350.0000 -12400.0000 -13000.0000 -20000.0000 -100000.0000 --12345.6789 -12340.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 -12345.6789 12346.0000 12345.7000 12345.6800 12345.6790 12345.6789 12345.6789 -12345.6789 12346.0000 12345.7000 12345.6800 12345.6790 12345.6789 12345.6789 -12345.6789 12346.0000 12345.7000 12345.6800 12345.6790 12345.6789 12345.6789 -12345.6789 12345.0000 12345.6000 12345.6700 12345.6780 12345.6789 12345.6789 -12345.6789 12345.0000 12345.6000 12345.6700 12345.6780 12345.6789 12345.6789 --12345.6789 -12346.0000 -12345.7000 -12345.6800 -12345.6790 -12345.6789 -12345.6789 --12345.6789 -12346.0000 -12345.7000 -12345.6800 -12345.6790 -12345.6789 -12345.6789 --12345.6789 -12345.0000 -12345.6000 -12345.6700 -12345.6780 -12345.6789 -12345.6789 --12345.6789 -12346.0000 -12345.7000 -12345.6800 -12345.6790 -12345.6789 -12345.6789 --12345.6789 -12345.0000 -12345.6000 -12345.6700 -12345.6780 -12345.6789 -12345.6789 -12345.6789 12350.0000 12300.0000 12000.0000 10000.0000 0.0000 -12345.6789 12350.0000 12300.0000 12000.0000 10000.0000 0.0000 -12345.6789 12350.0000 12400.0000 13000.0000 20000.0000 100000.0000 -12345.6789 12340.0000 12300.0000 12000.0000 10000.0000 0.0000 -12345.6789 12340.0000 12300.0000 12000.0000 10000.0000 0.0000 --12345.6789 -12350.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 --12345.6789 -12350.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 --12345.6789 -12340.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 --12345.6789 -12350.0000 -12400.0000 -13000.0000 -20000.0000 -100000.0000 --12345.6789 -12340.0000 -12300.0000 -12000.0000 -10000.0000 0.0000 -123456789.123456789 -123456789.123456789 123456789.000000000 -123456789.000000000 123456789.123460000 -123456789.123460000 123500000.000000000 -123500000.000000000 -123456789.123456789 -123456789.123456789 123456789.000000000 -123456789.000000000 123456789.123460000 -123456789.123460000 123500000.000000000 -123500000.000000000 -123456789.123456789 -123456789.123456789 123456790.000000000 -123456789.000000000 123456789.123460000 -123456789.123450000 123500000.000000000 -123400000.000000000 -123456789.123456789 -123456789.123456789 123456789.000000000 -123456790.000000000 123456789.123450000 -123456789.123460000 123400000.000000000 -123500000.000000000 -123456789.123456789 -123456789.123456789 123456789.000000000 -123456789.000000000 123456789.123450000 -123456789.123450000 123400000.000000000 -123400000.000000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789.000000000 -12345678901234567890123456789.000000000 12345678901234567890123456789.123000000 -12345678901234567890123456789.123000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789.000000000 -12345678901234567890123456789.000000000 12345678901234567890123456789.123000000 -12345678901234567890123456789.123000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456790.000000000 -12345678901234567890123456789.000000000 12345678901234567890123456789.124000000 -12345678901234567890123456789.123000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789.000000000 -12345678901234567890123456790.000000000 12345678901234567890123456789.123000000 -12345678901234567890123456789.124000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789.000000000 -12345678901234567890123456789.000000000 12345678901234567890123456789.123000000 -12345678901234567890123456789.123000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789.000000000 -12345678901234567890123456789.000000000 12345678901234567890123457000.000000000 -12345678901234567890123457000.000000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789.000000000 -12345678901234567890123456789.000000000 12345678901234567890123457000.000000000 -12345678901234567890123457000.000000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456790.000000000 -12345678901234567890123456789.000000000 12345678901234567890123457000.000000000 -12345678901234567890123456000.000000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789.000000000 -12345678901234567890123456790.000000000 12345678901234567890123456000.000000000 -12345678901234567890123457000.000000000 -12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789.000000000 -12345678901234567890123456789.000000000 12345678901234567890123456000.000000000 -12345678901234567890123456000.000000000 +12345.6789 12346 12345.7 12345.68 12345.679 12345.6789 12345.6789 +12345.6789 12346 12345.7 12345.68 12345.679 12345.6789 12345.6789 +12345.6789 12346 12345.7 12345.68 12345.679 12345.6789 12345.6789 +12345.6789 12345 12345.6 12345.67 12345.678 12345.6789 12345.6789 +12345.6789 12345 12345.6 12345.67 12345.678 12345.6789 12345.6789 +-12345.6789 -12346 -12345.7 -12345.68 -12345.679 -12345.6789 -12345.6789 +-12345.6789 -12346 -12345.7 -12345.68 -12345.679 -12345.6789 -12345.6789 +-12345.6789 -12345 -12345.6 -12345.67 -12345.678 -12345.6789 -12345.6789 +-12345.6789 -12346 -12345.7 -12345.68 -12345.679 -12345.6789 -12345.6789 +-12345.6789 -12345 -12345.6 -12345.67 -12345.678 -12345.6789 -12345.6789 +12345.6789 12350 12300 12000 10000 0 +12345.6789 12350 12300 12000 10000 0 +12345.6789 12350 12400 13000 20000 100000 +12345.6789 12340 12300 12000 10000 0 +12345.6789 12340 12300 12000 10000 0 +-12345.6789 -12350 -12300 -12000 -10000 0 +-12345.6789 -12350 -12300 -12000 -10000 0 +-12345.6789 -12340 -12300 -12000 -10000 0 +-12345.6789 -12350 -12400 -13000 -20000 -100000 +-12345.6789 -12340 -12300 -12000 -10000 0 +12345.6789 12346 12345.7 12345.68 12345.679 12345.6789 12345.6789 +12345.6789 12346 12345.7 12345.68 12345.679 12345.6789 12345.6789 +12345.6789 12346 12345.7 12345.68 12345.679 12345.6789 12345.6789 +12345.6789 12345 12345.6 12345.67 12345.678 12345.6789 12345.6789 +12345.6789 12345 12345.6 12345.67 12345.678 12345.6789 12345.6789 +-12345.6789 -12346 -12345.7 -12345.68 -12345.679 -12345.6789 -12345.6789 +-12345.6789 -12346 -12345.7 -12345.68 -12345.679 -12345.6789 -12345.6789 +-12345.6789 -12345 -12345.6 -12345.67 -12345.678 -12345.6789 -12345.6789 +-12345.6789 -12346 -12345.7 -12345.68 -12345.679 -12345.6789 -12345.6789 +-12345.6789 -12345 -12345.6 -12345.67 -12345.678 -12345.6789 -12345.6789 +12345.6789 12350 12300 12000 10000 0 +12345.6789 12350 12300 12000 10000 0 +12345.6789 12350 12400 13000 20000 100000 +12345.6789 12340 12300 12000 10000 0 +12345.6789 12340 12300 12000 10000 0 +-12345.6789 -12350 -12300 -12000 -10000 0 +-12345.6789 -12350 -12300 -12000 -10000 0 +-12345.6789 -12340 -12300 -12000 -10000 0 +-12345.6789 -12350 -12400 -13000 -20000 -100000 +-12345.6789 -12340 -12300 -12000 -10000 0 +12345.6789 12346 12345.7 12345.68 12345.679 12345.6789 12345.6789 +12345.6789 12346 12345.7 12345.68 12345.679 12345.6789 12345.6789 +12345.6789 12346 12345.7 12345.68 12345.679 12345.6789 12345.6789 +12345.6789 12345 12345.6 12345.67 12345.678 12345.6789 12345.6789 +12345.6789 12345 12345.6 12345.67 12345.678 12345.6789 12345.6789 +-12345.6789 -12346 -12345.7 -12345.68 -12345.679 -12345.6789 -12345.6789 +-12345.6789 -12346 -12345.7 -12345.68 -12345.679 -12345.6789 -12345.6789 +-12345.6789 -12345 -12345.6 -12345.67 -12345.678 -12345.6789 -12345.6789 +-12345.6789 -12346 -12345.7 -12345.68 -12345.679 -12345.6789 -12345.6789 +-12345.6789 -12345 -12345.6 -12345.67 -12345.678 -12345.6789 -12345.6789 +12345.6789 12350 12300 12000 10000 0 +12345.6789 12350 12300 12000 10000 0 +12345.6789 12350 12400 13000 20000 100000 +12345.6789 12340 12300 12000 10000 0 +12345.6789 12340 12300 12000 10000 0 +-12345.6789 -12350 -12300 -12000 -10000 0 +-12345.6789 -12350 -12300 -12000 -10000 0 +-12345.6789 -12340 -12300 -12000 -10000 0 +-12345.6789 -12350 -12400 -13000 -20000 -100000 +-12345.6789 -12340 -12300 -12000 -10000 0 +123456789.123456789 -123456789.123456789 123456789 -123456789 123456789.12346 -123456789.12346 123500000 -123500000 +123456789.123456789 -123456789.123456789 123456789 -123456789 123456789.12346 -123456789.12346 123500000 -123500000 +123456789.123456789 -123456789.123456789 123456790 -123456789 123456789.12346 -123456789.12345 123500000 -123400000 +123456789.123456789 -123456789.123456789 123456789 -123456790 123456789.12345 -123456789.12346 123400000 -123500000 +123456789.123456789 -123456789.123456789 123456789 -123456789 123456789.12345 -123456789.12345 123400000 -123400000 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789 -12345678901234567890123456789 12345678901234567890123456789.123 -12345678901234567890123456789.123 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789 -12345678901234567890123456789 12345678901234567890123456789.123 -12345678901234567890123456789.123 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456790 -12345678901234567890123456789 12345678901234567890123456789.124 -12345678901234567890123456789.123 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789 -12345678901234567890123456790 12345678901234567890123456789.123 -12345678901234567890123456789.124 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789 -12345678901234567890123456789 12345678901234567890123456789.123 -12345678901234567890123456789.123 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789 -12345678901234567890123456789 12345678901234567890123457000 -12345678901234567890123457000 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789 -12345678901234567890123456789 12345678901234567890123457000 -12345678901234567890123457000 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456790 -12345678901234567890123456789 12345678901234567890123457000 -12345678901234567890123456000 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789 -12345678901234567890123456790 12345678901234567890123456000 -12345678901234567890123457000 +12345678901234567890123456789.123456789 -12345678901234567890123456789.123456789 12345678901234567890123456789 -12345678901234567890123456789 12345678901234567890123456000 -12345678901234567890123456000 diff --git a/tests/queries/0_stateless/00700_to_decimal_or_something.reference b/tests/queries/0_stateless/00700_to_decimal_or_something.reference index 7a6ff87d096..89ded7bd6d4 100644 --- a/tests/queries/0_stateless/00700_to_decimal_or_something.reference +++ b/tests/queries/0_stateless/00700_to_decimal_or_something.reference @@ -1,8 +1,8 @@ -1.1 1.10 1.10000000 +1.1 1.1 1.1 0 0 0.42 -0 0.420 -0 0.4200 +0 0.42 +0 0.42 999999999 0 -999999999 0 999999999999999999 0 @@ -12,11 +12,11 @@ -99999999999999999999999999999999999999 0 ---- -1.1 1.10 1.10000000 +1.1 1.1 1.1 \N \N -0.42 -\N -0.420 -\N -0.4200 +\N -0.42 +\N -0.42 999999999 \N -999999999 \N 999999999999999999 \N diff --git a/tests/queries/0_stateless/00732_decimal_summing_merge_tree.reference b/tests/queries/0_stateless/00732_decimal_summing_merge_tree.reference index 1644f50993c..551ef8f59c5 100644 --- a/tests/queries/0_stateless/00732_decimal_summing_merge_tree.reference +++ b/tests/queries/0_stateless/00732_decimal_summing_merge_tree.reference @@ -1,2 +1,2 @@ -2001-01-01 2.0000 0.00000000 -2.0000000000 -2001-01-01 0.0000 1.00000000 0.0000000000 +2001-01-01 2 0 -2 +2001-01-01 0 1 0 diff --git a/tests/queries/0_stateless/00737_decimal_group_by.reference b/tests/queries/0_stateless/00737_decimal_group_by.reference index 2f838f4bcdd..3e7ca2bf83b 100644 --- a/tests/queries/0_stateless/00737_decimal_group_by.reference +++ b/tests/queries/0_stateless/00737_decimal_group_by.reference @@ -1,11 +1,11 @@ -1.10 -2.1000 -3.100000000000 -1.20 -2.2000 -3.200000000000 -1.30 -2.3000 -3.300000000000 -1 1.000000000000000000 10.000000000000000000 -1 1.000000000000000000 10.000000000000000000 +1.1 +2.1 +3.1 +1.2 +2.2 +3.2 +1.3 +2.3 +3.3 +1 1 10 +1 1 10 diff --git a/tests/queries/0_stateless/00804_test_custom_compression_codecs.reference b/tests/queries/0_stateless/00804_test_custom_compression_codecs.reference index 6470739db21..7bd91e5a69b 100644 --- a/tests/queries/0_stateless/00804_test_custom_compression_codecs.reference +++ b/tests/queries/0_stateless/00804_test_custom_compression_codecs.reference @@ -11,7 +11,7 @@ 9175437371954010821 CREATE TABLE default.compression_codec_multiple_more_types\n(\n `id` Decimal(38, 13) CODEC(ZSTD(1), LZ4, ZSTD(1), ZSTD(1), Delta(2), Delta(4), Delta(1), LZ4HC(0)),\n `data` FixedString(12) CODEC(ZSTD(1), ZSTD(1), NONE, NONE, NONE, LZ4HC(0)),\n `ddd.age` Array(UInt8) CODEC(LZ4, LZ4HC(0), NONE, NONE, NONE, ZSTD(1), Delta(8)),\n `ddd.Name` Array(String) CODEC(LZ4, LZ4HC(0), NONE, NONE, NONE, ZSTD(1), Delta(8))\n)\nENGINE = MergeTree\nORDER BY tuple()\nSETTINGS index_granularity = 8192 1.5555555555555 hello world! [77] ['John'] -7.1000000000000 xxxxxxxxxxxx [127] ['Henry'] +7.1 xxxxxxxxxxxx [127] ['Henry'] ! 222 !ZSTD diff --git a/tests/queries/0_stateless/00805_round_down.reference b/tests/queries/0_stateless/00805_round_down.reference index 0ed04c7757f..dafbf4255fc 100644 --- a/tests/queries/0_stateless/00805_round_down.reference +++ b/tests/queries/0_stateless/00805_round_down.reference @@ -51,33 +51,33 @@ 7 6.25 8 7.5 9 8.75 -0.00000 4.00000 -0.01000 4.00000 -0.02000 4.00000 -0.03000 4.00000 -0.04000 4.00000 -0.05000 4.00000 -0.06000 4.00000 -0.07000 4.00000 -0.08000 4.00000 -0.09000 4.00000 -0.00000 0.04000 -0.01000 0.04000 -0.02000 0.04000 -0.03000 0.04000 -0.04000 0.04000 -0.05000 0.05000 -0.06000 0.06000 -0.07000 0.06000 -0.08000 0.06000 -0.09000 0.06000 -0.00000 0.04000 -0.01000 0.04000 -0.02000 0.04000 -0.03000 0.04000 -0.04000 0.04000 -0.05000 0.05000 -0.06000 0.06000 -0.07000 0.06000 -0.08000 0.06000 -0.09000 0.06000 +0 4 +0.01 4 +0.02 4 +0.03 4 +0.04 4 +0.05 4 +0.06 4 +0.07 4 +0.08 4 +0.09 4 +0 0.04 +0.01 0.04 +0.02 0.04 +0.03 0.04 +0.04 0.04 +0.05 0.05 +0.06 0.06 +0.07 0.06 +0.08 0.06 +0.09 0.06 +0 0.04 +0.01 0.04 +0.02 0.04 +0.03 0.04 +0.04 0.04 +0.05 0.05 +0.06 0.06 +0.07 0.06 +0.08 0.06 +0.09 0.06 diff --git a/tests/queries/0_stateless/00837_minmax_index.reference b/tests/queries/0_stateless/00837_minmax_index.reference index 0f5a8eb904e..8bde896b02a 100644 --- a/tests/queries/0_stateless/00837_minmax_index.reference +++ b/tests/queries/0_stateless/00837_minmax_index.reference @@ -1,6 +1,6 @@ -0 5 4.7 6.50 cba b 2014-01-04 -1 5 4.7 6.50 cba b 2014-03-11 -11 5 4.7 6.50 cba b 2014-06-11 -12 5 4.7 6.50 cba b 2015-01-01 +0 5 4.7 6.5 cba b 2014-01-04 +1 5 4.7 6.5 cba b 2014-03-11 +11 5 4.7 6.5 cba b 2014-06-11 +12 5 4.7 6.5 cba b 2015-01-01 "rows_read": 4, "rows_read": 2, diff --git a/tests/queries/0_stateless/00838_unique_index.reference b/tests/queries/0_stateless/00838_unique_index.reference index df890188102..7183a3b7370 100644 --- a/tests/queries/0_stateless/00838_unique_index.reference +++ b/tests/queries/0_stateless/00838_unique_index.reference @@ -1,24 +1,24 @@ -0 5 4.7 6.50 cba b 2014-01-04 -1 5 4.7 6.50 cba b 2014-03-11 -12 5 4.7 6.50 cba b 2014-06-11 -13 5 4.7 6.50 cba b 2015-01-01 +0 5 4.7 6.5 cba b 2014-01-04 +1 5 4.7 6.5 cba b 2014-03-11 +12 5 4.7 6.5 cba b 2014-06-11 +13 5 4.7 6.5 cba b 2015-01-01 "rows_read": 4, -2 2 4.5 2.50 abc a 2014-01-01 -6 2 4.5 2.50 abc a 2014-02-11 +2 2 4.5 2.5 abc a 2014-01-01 +6 2 4.5 2.5 abc a 2014-02-11 7 5 6.9 1.57 bac c 2014-04-11 -8 2 4.5 2.50 abc a 2014-05-11 +8 2 4.5 2.5 abc a 2014-05-11 9 5 6.9 1.57 bac c 2014-07-11 5 5 6.9 1.57 bac c 2014-11-11 -4 2 4.5 2.50 abc a 2016-01-01 +4 2 4.5 2.5 abc a 2016-01-01 3 5 6.9 1.57 bac c 2017-01-01 "rows_read": 8, "rows_read": 2, -2 2 4.5 2.50 abc a 2014-01-01 -6 2 4.5 2.50 abc a 2014-02-11 +2 2 4.5 2.5 abc a 2014-01-01 +6 2 4.5 2.5 abc a 2014-02-11 7 5 6.9 1.57 bac c 2014-04-11 -8 2 4.5 2.50 abc a 2014-05-11 +8 2 4.5 2.5 abc a 2014-05-11 9 5 6.9 1.57 bac c 2014-07-11 5 5 6.9 1.57 bac c 2014-11-11 -4 2 4.5 2.50 abc a 2016-01-01 +4 2 4.5 2.5 abc a 2016-01-01 3 5 6.9 1.57 bac c 2017-01-01 "rows_read": 8, diff --git a/tests/queries/0_stateless/00861_decimal_quoted_csv.reference b/tests/queries/0_stateless/00861_decimal_quoted_csv.reference index 6a219226835..3ff285acef8 100644 --- a/tests/queries/0_stateless/00861_decimal_quoted_csv.reference +++ b/tests/queries/0_stateless/00861_decimal_quoted_csv.reference @@ -1,5 +1,5 @@ -1 1.00 1.00 1.00 -2 -1.00 -1.00 -1.00 -3 1.00 1.00 1.00 -4 -0.10 -0.10 -0.10 +1 1 1 1 +2 -1 -1 -1 +3 1 1 1 +4 -0.1 -0.1 -0.1 5 0.01 0.01 0.01 diff --git a/tests/queries/0_stateless/00862_decimal_in.reference b/tests/queries/0_stateless/00862_decimal_in.reference index 2e4eb5e6dc7..0cd93f69c38 100644 --- a/tests/queries/0_stateless/00862_decimal_in.reference +++ b/tests/queries/0_stateless/00862_decimal_in.reference @@ -1,18 +1,18 @@ -128.00 128.00 -128.00 128.00 -128.00 128.00 -128.00 128.00 -128.00 128.00 -128.00 128.00 -32.00 32.00 -32.00 32.00 -32.00 32.00 -32.00 32.00 -32.00 32.00 -32.00 32.00 -64.00 64.00 -64.00 64.00 -64.00 64.00 -64.00 64.00 -64.00 64.00 -64.00 64.00 +128 128 +128 128 +128 128 +128 128 +128 128 +128 128 +32 32 +32 32 +32 32 +32 32 +32 32 +32 32 +64 64 +64 64 +64 64 +64 64 +64 64 +64 64 diff --git a/tests/queries/0_stateless/00910_decimal_group_array_crash_3783.reference b/tests/queries/0_stateless/00910_decimal_group_array_crash_3783.reference index 232d9aa7974..47e910f691d 100644 --- a/tests/queries/0_stateless/00910_decimal_group_array_crash_3783.reference +++ b/tests/queries/0_stateless/00910_decimal_group_array_crash_3783.reference @@ -1,9 +1,9 @@ -[1.00] -[1.00000] -[1.0000000000] -[499500.00] -[499500.00000] -[499500.0000000000] +[1] +[1] +[1] +[499500] +[499500] +[499500] 1545081300 [('ed87e57c-9331-462a-80b4-9f0c005e88c8',0.44)] -4341757 5657967 2018-11-01 16:47:46 txt 321.380000000000 315.080000000000 0.000000000000 2018-11-02 00:00:00 -4360430 5681495 2018-11-02 09:00:07 txt 274.350000000000 268.970000000000 0.000000000000 2018-11-02 00:00:00 +4341757 5657967 2018-11-01 16:47:46 txt 321.38 315.08 0 2018-11-02 00:00:00 +4360430 5681495 2018-11-02 09:00:07 txt 274.35 268.97 0 2018-11-02 00:00:00 diff --git a/tests/queries/0_stateless/00927_asof_join_other_types.reference b/tests/queries/0_stateless/00927_asof_join_other_types.reference index a34437f66c2..83ee534ff91 100644 --- a/tests/queries/0_stateless/00927_asof_join_other_types.reference +++ b/tests/queries/0_stateless/00927_asof_join_other_types.reference @@ -13,15 +13,15 @@ 2 1970-01-01 03:00:01 1 0 2 1970-01-01 03:00:03 3 3 2 1970-01-01 03:00:05 5 3 -2 1.00000 1 0 -2 3.00000 3 3 -2 5.00000 5 3 -2 1.00000 1 0 -2 3.00000 3 3 -2 5.00000 5 3 -2 1.00000 1 0 -2 3.00000 3 3 -2 5.00000 5 3 +2 1 1 0 +2 3 3 3 +2 5 5 3 +2 1 1 0 +2 3 3 3 +2 5 5 3 +2 1 1 0 +2 3 3 3 +2 5 5 3 2 1970-01-01 03:00:00.001 1 0 2 1970-01-01 03:00:00.003 3 3 2 1970-01-01 03:00:00.005 5 3 diff --git a/tests/queries/0_stateless/00950_dict_get.reference b/tests/queries/0_stateless/00950_dict_get.reference index c1b502bf773..191eb40a889 100644 --- a/tests/queries/0_stateless/00950_dict_get.reference +++ b/tests/queries/0_stateless/00950_dict_get.reference @@ -31,18 +31,18 @@ dictGetOrDefault complex_hashed_strings 0 * * dictGet complex_cache_strings 1 1 1 dictGetOrDefault complex_cache_strings 1 1 1 dictGetOrDefault complex_cache_strings 0 * * -dictGet flat_decimals 1 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault flat_decimals 1 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault flat_decimals 0 42.0000 42.000000 42.0 (42.0000,42.000000,42.0) -dictGet hashed_decimals 1 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault hashed_decimals 1 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault hashed_decimals 0 42.0000 42.000000 42.0 (42.0000,42.000000,42.0) -dictGet cache_decimals 1 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault cache_decimals 1 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault cache_decimals 0 42.0000 42.000000 42.0 (42.0000,42.000000,42.0) -dictGet complex_hashed_decimals (1) 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault complex_hashed_decimals (1) 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault complex_hashed_decimals (0) 42.0000 42.000000 42.0 (42.0000,42.000000,42.0) -dictGet complex_cache_decimals (1) 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault complex_cache_decimals (1) 1.0000 1.000000 1.0 (1.0000,1.000000,1.0) -dictGetOrDefault complex_cache_decimals (0) 42.0000 42.000000 42.0 (42.0000,42.000000,42.0) +dictGet flat_decimals 1 1 1 1 (1,1,1) +dictGetOrDefault flat_decimals 1 1 1 1 (1,1,1) +dictGetOrDefault flat_decimals 0 42 42 42 (42,42,42) +dictGet hashed_decimals 1 1 1 1 (1,1,1) +dictGetOrDefault hashed_decimals 1 1 1 1 (1,1,1) +dictGetOrDefault hashed_decimals 0 42 42 42 (42,42,42) +dictGet cache_decimals 1 1 1 1 (1,1,1) +dictGetOrDefault cache_decimals 1 1 1 1 (1,1,1) +dictGetOrDefault cache_decimals 0 42 42 42 (42,42,42) +dictGet complex_hashed_decimals (1) 1 1 1 (1,1,1) +dictGetOrDefault complex_hashed_decimals (1) 1 1 1 (1,1,1) +dictGetOrDefault complex_hashed_decimals (0) 42 42 42 (42,42,42) +dictGet complex_cache_decimals (1) 1 1 1 (1,1,1) +dictGetOrDefault complex_cache_decimals (1) 1 1 1 (1,1,1) +dictGetOrDefault complex_cache_decimals (0) 42 42 42 (42,42,42) diff --git a/tests/queries/0_stateless/00975_values_list.reference b/tests/queries/0_stateless/00975_values_list.reference index f8ada08d130..d0811d264b0 100644 --- a/tests/queries/0_stateless/00975_values_list.reference +++ b/tests/queries/0_stateless/00975_values_list.reference @@ -10,5 +10,5 @@ cadabra abracadabra 23 23 23 24 24 24 -1.6660 a b +1.666 a b \N diff --git a/tests/queries/0_stateless/00979_toFloat_monotonicity.reference b/tests/queries/0_stateless/00979_toFloat_monotonicity.reference index 7d9895ef9f3..b8ec6976930 100644 --- a/tests/queries/0_stateless/00979_toFloat_monotonicity.reference +++ b/tests/queries/0_stateless/00979_toFloat_monotonicity.reference @@ -2,5 +2,5 @@ 7777 7777 7777 -7777.000 -7777.000 +7777 +7777 diff --git a/tests/queries/0_stateless/00980_crash_nullable_decimal.reference b/tests/queries/0_stateless/00980_crash_nullable_decimal.reference index be6e399c4d9..fcb49fa9945 100644 --- a/tests/queries/0_stateless/00980_crash_nullable_decimal.reference +++ b/tests/queries/0_stateless/00980_crash_nullable_decimal.reference @@ -1,7 +1,7 @@ -1.00 -1.00 -1.00 -1.00 -1.00 -1.00 -1.00 +1 +1 +1 +1 +1 +1 +1 diff --git a/tests/queries/0_stateless/01018_empty_aggregation_filling.reference b/tests/queries/0_stateless/01018_empty_aggregation_filling.reference index 4595c3b9112..c29807a7e15 100644 --- a/tests/queries/0_stateless/01018_empty_aggregation_filling.reference +++ b/tests/queries/0_stateless/01018_empty_aggregation_filling.reference @@ -45,7 +45,7 @@ nan \N 0 \N -0.00 +0 \N --- Other Types Non-empty --- hello diff --git a/tests/queries/0_stateless/01055_minmax_index_compact_parts.reference b/tests/queries/0_stateless/01055_minmax_index_compact_parts.reference index 0f5a8eb904e..8bde896b02a 100644 --- a/tests/queries/0_stateless/01055_minmax_index_compact_parts.reference +++ b/tests/queries/0_stateless/01055_minmax_index_compact_parts.reference @@ -1,6 +1,6 @@ -0 5 4.7 6.50 cba b 2014-01-04 -1 5 4.7 6.50 cba b 2014-03-11 -11 5 4.7 6.50 cba b 2014-06-11 -12 5 4.7 6.50 cba b 2015-01-01 +0 5 4.7 6.5 cba b 2014-01-04 +1 5 4.7 6.5 cba b 2014-03-11 +11 5 4.7 6.5 cba b 2014-06-11 +12 5 4.7 6.5 cba b 2015-01-01 "rows_read": 4, "rows_read": 2, diff --git a/tests/queries/0_stateless/01087_storage_generate.reference b/tests/queries/0_stateless/01087_storage_generate.reference index 3680d8d943d..78c6784f7d2 100644 --- a/tests/queries/0_stateless/01087_storage_generate.reference +++ b/tests/queries/0_stateless/01087_storage_generate.reference @@ -4,7 +4,7 @@ [88] 34528.4014 ('2031-12-09 00:40:39.898','9ef777c8-de0e-d25e-e16c-5b624f88523c') [-1] 121968.7945 ('2060-02-05 09:18:12.011','7655e515-d2ca-2f06-0950-e4f44f69aca7') [-103,75] -135033.4349 ('2038-12-19 20:38:58.695','86b57d15-292d-2517-9acf-47cd053e7a3a') -[110] -202668.6900 ('2009-06-18 01:53:29.808','bc630f78-7d58-0c46-dd4b-27fc35625e96') +[110] -202668.69 ('2009-06-18 01:53:29.808','bc630f78-7d58-0c46-dd4b-27fc35625e96') [-22,2] 168636.9728 ('2074-09-03 09:20:20.936','7624ce27-9bff-4e9d-3f18-6851a97dd0ca') [-22,-62] -75192.4989 ('2085-10-11 21:51:12.855','a4c4d0ed-f448-244e-1723-ca1bba816f2b') [-2,-90] 133592.5064 ('2010-10-28 21:18:04.633','8ba9103b-f90c-b49b-38c1-223ae5f42bf7') @@ -25,23 +25,23 @@ [95,38] -65083.7371 ('2015-03-10 13:33:16.429','47bd199c-f99e-51ea-84e9-b65cce9d167c') [91,110,72] 130908.9643 ('2036-03-16 15:17:53.679','0dd4ca31-1e09-d7e0-f3df-60cad3cfa805') [] 208972.3779 ('2034-03-05 22:29:21.994','1069d77c-dfd2-912e-60b8-3c5b964f7e11') -[-32] 167938.5050 ('2093-09-10 20:39:39.050','9d1025b6-2d0c-1d84-dafd-02668eb29270') +[-32] 167938.505 ('2093-09-10 20:39:39.050','9d1025b6-2d0c-1d84-dafd-02668eb29270') [] 153744.6987 ('2088-10-02 11:02:11.024','a88e6cb7-2210-5ce5-6bcf-24afc0eca5b6') -[67] -74220.6650 ('2074-12-30 18:43:40.817','68096065-18c8-8aca-fd21-15330ead669d') +[67] -74220.665 ('2074-12-30 18:43:40.817','68096065-18c8-8aca-fd21-15330ead669d') [6] 66759.8938 ('2091-09-01 19:07:18.219','bb14f4cc-0b54-9a8c-e835-71333b28c03b') [-28,-82,9] 168625.3131 ('2002-03-20 21:02:30.321','405bb877-6e28-8b91-cb62-bd82a3fa797c') -[] -19760.1670 ('2044-11-08 07:52:03.325','13769348-9e58-0e75-3972-8bbadc150715') +[] -19760.167 ('2044-11-08 07:52:03.325','13769348-9e58-0e75-3972-8bbadc150715') [] 160663.7797 ('2025-04-12 13:17:53.501','e6370321-94f5-97e6-0348-a84e72ff5b42') [-17,18] 99105.9856 ('1972-05-01 12:23:11.688','02618b9e-97cd-4698-d2e8-3f52f4c5a09a') [86,77] -116990.3914 ('1981-12-31 05:06:54.198','3ac42bb4-8652-b1a8-10bb-98f0337261f8') [-109,69,-63] -151527.3587 ('2001-01-17 11:19:56.504','77fe7ee2-f279-2855-bfd2-a7d7cee678cc') [] -57762.3928 ('1978-08-16 18:47:37.660','ab9a110a-fd8d-3c4c-5a49-34c2005536ce') [-77] 107274.6407 ('2017-01-12 12:03:02.657','c1ad4f17-cc54-45f3-9410-9c1011653f6d') -[] 107133.6410 ('2050-10-05 06:29:27.154','36e576aa-c77f-994e-1925-4a4c40da3a0f') +[] 107133.641 ('2050-10-05 06:29:27.154','36e576aa-c77f-994e-1925-4a4c40da3a0f') [] 46672.2176 ('2094-01-21 20:25:39.144','e9ba850d-604e-bc7d-417c-1078e89d4615') [-87,-122,-65] -86258.4663 ('2081-06-17 03:37:45.498','64795221-9719-7937-b4d2-be5f30065ece') [-53] -48672.1424 ('1992-06-27 17:27:23.602','7c67bc31-c7bb-6197-fdca-f73329b976f2') -[34] -108954.7820 ('2096-07-03 23:06:30.632','9c1b37d7-4ced-9428-a0ae-34c5436b14c4') +[34] -108954.782 ('2096-07-03 23:06:30.632','9c1b37d7-4ced-9428-a0ae-34c5436b14c4') [] -168124.2364 ('1987-06-03 06:47:12.945','d1c39af4-f920-5095-b8e2-0f878950167b') [] -112431.4799 ('2021-07-26 07:04:58.527','da07a72d-7e1f-8890-4c4b-326835d11b39') [-35,-95,58] -181254.9139 ('2086-11-12 17:17:14.473','22f74d0b-dfc0-3f7a-33f4-8055d8fa7846') @@ -61,10 +61,10 @@ [-35,-58,-101] -9101.5369 ('2023-08-24 20:56:11.695','87fbe3f9-b1f0-c030-a4c0-8662045923b4') [-58,87] 122510.9099 ('2019-08-09 17:40:29.849','c1d3a2cc-878f-c2c3-4a0b-10e98cda8b4a') [4,19,58] -13496.8672 ('2027-05-01 09:11:48.659','8996ae31-d670-cbfe-b735-b16b7c3b3476') -[23,-75,-89] -51218.2860 ('2010-06-02 02:49:03.396','d32b8b61-cc3e-31fa-2a2a-abefa60bfcee') +[23,-75,-89] -51218.286 ('2010-06-02 02:49:03.396','d32b8b61-cc3e-31fa-2a2a-abefa60bfcee') [50] -45297.4315 ('2087-04-15 06:46:08.247','04fe9603-97fc-07a4-6248-0f21e408c884') [-23,17,63] 89185.9462 ('2065-10-26 08:27:12.817','a5fbf764-70b4-8b65-4a8f-7550abca3859') -[-6] -129925.3690 ('2013-11-05 07:44:45.233','11db26b3-e2b5-b9fa-6b0e-79c43a2e67ab') +[-6] -129925.369 ('2013-11-05 07:44:45.233','11db26b3-e2b5-b9fa-6b0e-79c43a2e67ab') [-72,-108] 203171.5475 ('2000-01-28 09:34:58.032','14d5399e-7949-20c7-0e47-85e2fce5836c') [-73,34,-27] 2676.7265 ('2057-10-25 14:37:10.049','00049a92-4350-badb-3764-dd7f019b9b31') [65,-7] -153472.9461 ('1973-04-12 02:34:41.245','e0a0324d-1552-d11e-f3a5-fbd822d206c5') @@ -73,13 +73,13 @@ [107] 9694.1102 ('1984-11-02 13:11:34.034','e973db18-07b7-2117-f3ba-e7002adfa939') [] -76460.9664 ('2051-02-10 09:54:42.143','b8344c22-9e8a-7052-c644-9c3e5989cdf1') [59,59,0] 27041.7606 ('2083-02-17 18:21:22.547','4d6b137b-a3e1-f36d-2c0c-c8d718dda388') -[-114] 133673.9630 ('2005-10-02 20:34:27.452','04785b75-30e5-af8b-547e-d15bcb7f49fb') -[43] -169861.2000 ('2006-12-13 09:26:13.923','cb865d38-d961-d7f9-acbb-583b9f31252f') +[-114] 133673.963 ('2005-10-02 20:34:27.452','04785b75-30e5-af8b-547e-d15bcb7f49fb') +[43] -169861.2 ('2006-12-13 09:26:13.923','cb865d38-d961-d7f9-acbb-583b9f31252f') [] 197115.2174 ('2060-04-08 04:17:00.488','0f26c4b4-b24c-1fd5-c619-31bcf71a4831') [-25] -200081.9506 ('2055-12-25 02:30:16.276','0b32ad69-2c84-4269-9718-e3171482878a') [14,110] -40196.4463 ('2084-08-13 19:37:07.588','ed882071-acba-b3ab-5d77-d79a9544a834') [-62,-71,-82] -154958.9747 ('2100-07-08 02:32:53.741','7711c7c1-0d22-e302-fc86-61ef5e68db96') -[96,-114,-101] 78910.3320 ('2100-07-19 15:02:27.109','756bfd26-c4b3-94b8-e991-c7ab7a833b76') +[96,-114,-101] 78910.332 ('2100-07-19 15:02:27.109','756bfd26-c4b3-94b8-e991-c7ab7a833b76') [49] 80117.2267 ('1970-07-04 03:50:56.748','aebac019-9054-4a77-2ccd-8801fc4a7496') [] 102078.4801 ('2055-01-07 01:22:33.624','21f2e59a-a1ca-5df3-27fd-aa95456cfbe5') [-106] -108728.4237 ('2020-05-27 11:56:18.121','6b7b6674-9342-2360-4cc0-f7ef8a2404de') @@ -91,13 +91,13 @@ [] 212557.3762 ('2069-03-03 07:21:08.439','9e676cac-36e6-2962-f7b1-578214f0dfbd') [-128,55] 80471.0777 ('1970-04-01 18:54:40.257','ca358854-416b-9c95-0b9b-c7fed7bb7cb5') [-30,-54] -132205.4512 ('2017-12-15 22:54:15.750','3558faa4-2d2f-c533-437f-1e03d3600f1d') -[-116,-72] -91499.6670 ('2105-09-23 21:06:17.755','07bb6e47-3234-c268-40d7-332388dc06f8') +[-116,-72] -91499.667 ('2105-09-23 21:06:17.755','07bb6e47-3234-c268-40d7-332388dc06f8') [] -201636.5228 ('2085-01-27 07:54:42.717','86c3bdc3-ff0f-1723-07c2-845aa3c02370') [-103,-39] 44330.7722 ('2064-07-02 11:08:28.068','0869c79d-6bdd-5d2d-a3d1-ffe13f6aa810') [99] -31035.5391 ('2093-07-26 01:50:23.026','aeb59338-254f-dc09-fbd7-263da415e211') [101] 157961.4729 ('2036-05-04 02:35:07.845','8b6221a9-8dad-4655-7460-6b3031b06893') [111] 84732.4403 ('1997-04-06 16:10:18.624','08806a79-59f4-c833-eedc-a200bb851767') -[9,-48] -190491.5590 ('2031-11-03 19:47:03.757','914e6166-c96e-e0e4-101a-0bb516cf5a2f') +[9,-48] -190491.559 ('2031-11-03 19:47:03.757','914e6166-c96e-e0e4-101a-0bb516cf5a2f') [-41] -132501.8311 ('2089-11-21 21:38:28.848','6de6cc8d-3c49-641e-fb12-87ed5ecb97b0') [77] 64903.6579 ('1985-04-17 17:08:03.998','26484b8a-f3f1-587f-7777-bc7a57a689c3') - diff --git a/tests/queries/0_stateless/01087_table_function_generate.reference b/tests/queries/0_stateless/01087_table_function_generate.reference index bf301d34eb3..ea4162e4840 100644 --- a/tests/queries/0_stateless/01087_table_function_generate.reference +++ b/tests/queries/0_stateless/01087_table_function_generate.reference @@ -86,7 +86,7 @@ Decimal(9, 4) Decimal(18, 8) Decimal(18, 8) -18731.5032 81241713112.39967992 -10576027963457111164764.0798899532879521 65289.5061 -27889310937.24180887 5807515838469365530027.7612329616030438 -197586.1517 -751754543.85331084 3835903211857734974086.0358362773591932 -183596.0063 8217353434.41964030 13633006218585943284268.9826084812209912 +183596.0063 8217353434.4196403 13633006218585943284268.9826084812209912 73041.2674 -88881500366.49430454 -148702703925022894263.3187064158377476 101454.4494 -27768337.71540858 -634829280961262229789.4961995996929358 -174012.0101 -13636289325.35403038 -3611949395160064991369.2765012316944096 @@ -226,12 +226,12 @@ RL,{Xs\\tw [124] -114719.5228 ('2010-11-11 22:57:23.722','c1046ffb-3415-cc3a-509a-e0005856d7d7') - [] 1900051923 { -189530.5846 h -5.6279699579452485e47 ('1984-12-06','2028-08-17 06:05:01','2036-04-02 23:52:28.468','4b3d498c-dd44-95c1-5b75-921504ec5d8d') F743 -[-102,-118] 392272782 Eb -14818.0200 o -2.664492247169164e59 ('2082-12-26','2052-09-09 06:50:50','2088-04-21 05:07:08.245','aeb9c26e-0ee7-2b8e-802b-2a96319b8e60') CBF4 +[-102,-118] 392272782 Eb -14818.02 o -2.664492247169164e59 ('2082-12-26','2052-09-09 06:50:50','2088-04-21 05:07:08.245','aeb9c26e-0ee7-2b8e-802b-2a96319b8e60') CBF4 [-71] 775049089 \N -158115.1178 w 4.1323844687113747e-305 ('2108-04-19','2090-07-31 16:45:26','2076-07-10 09:11:06.385','57c69bc6-dddd-0975-e932-a7b5173a1304') EB1D [-28,100] 3675466147 { -146685.1749 h 3.6676044396877755e142 ('2017-10-25','2100-02-28 18:07:18','2055-10-14 06:36:20.056','14949dae-dfa8-a124-af83-887348b2f609') 6D88 [-23] 2514120753 (`u, -119659.6174 w 1.3231258347475906e34 ('2141-04-06','2074-08-10 06:25:12','1976-12-04 18:31:55.745','86a9b3c1-4593-4d56-7762-3aa1dd22cbbf') AD43 [11,-36] 3308237300 \N 171205.1896 \N 5.634708707075817e195 ('1974-10-31','1993-12-24 09:38:45','2038-07-15 05:22:51.805','63d999b8-8cca-e237-c4a4-4dd7d0096f65') 609E -[39] 1614362420 `4A8P 157144.0630 o -1.1843143253872814e-255 ('2147-08-18','2072-09-28 18:27:27','2073-07-10 12:19:58.146','6483f5c0-8733-364c-4fa0-9948d32e8903') A886 +[39] 1614362420 `4A8P 157144.063 o -1.1843143253872814e-255 ('2147-08-18','2072-09-28 18:27:27','2073-07-10 12:19:58.146','6483f5c0-8733-364c-4fa0-9948d32e8903') A886 [48,-120] 3848918261 1 Date: Sun, 15 Aug 2021 10:54:30 +0300 Subject: [PATCH 03/13] Update more tests --- tests/queries/0_stateless/01273_arrow_decimal.reference | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/queries/0_stateless/01273_arrow_decimal.reference b/tests/queries/0_stateless/01273_arrow_decimal.reference index a512796de07..1358d3fa841 100644 --- a/tests/queries/0_stateless/01273_arrow_decimal.reference +++ b/tests/queries/0_stateless/01273_arrow_decimal.reference @@ -1,2 +1,2 @@ -0.1230 0.12312312 0.1231231231230000 0.12312312312312312300000000000000 -0.1230 0.12312312 0.1231231231230000 0.12312312312312312300000000000000 +0.123 0.12312312 0.123123123123 0.123123123123123123 +0.123 0.12312312 0.123123123123 0.123123123123123123 From e24087526b6bc9b5524806c6e98563e7cc73da25 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 15 Aug 2021 11:59:53 +0300 Subject: [PATCH 04/13] Update test --- .../0_stateless/01658_read_file_to_stringcolumn.reference | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/queries/0_stateless/01658_read_file_to_stringcolumn.reference b/tests/queries/0_stateless/01658_read_file_to_stringcolumn.reference index 1d0901cf9f6..579c0dcb270 100644 --- a/tests/queries/0_stateless/01658_read_file_to_stringcolumn.reference +++ b/tests/queries/0_stateless/01658_read_file_to_stringcolumn.reference @@ -13,13 +13,13 @@ ccccccccc :35 :35 :233 -699415 +695071 aaaaaaaaa bbbbbbbbb ccccccccc aaaaaaaaa bbbbbbbbb ccccccccc aaaaaaaaa bbbbbbbbb ccccccccc aaaaaaaaa bbbbbbbbb ccccccccc aaaaaaaaa bbbbbbbbb -699415 0 +695071 0 :0 :70 :79 From 28027c732318bb9192e2ccb915adc544e0561e39 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 16 Aug 2021 05:00:39 +0300 Subject: [PATCH 05/13] Fix some tests --- src/IO/WriteHelpers.h | 10 +++++----- .../test_postgresql_replica_database_engine/test.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/IO/WriteHelpers.h b/src/IO/WriteHelpers.h index 891a8d1f073..feafe87d47d 100644 --- a/src/IO/WriteHelpers.h +++ b/src/IO/WriteHelpers.h @@ -910,17 +910,17 @@ void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr) { if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); return; } else if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); return; } else if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); return; } } @@ -928,12 +928,12 @@ void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr) { if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); return; } else if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); return; } } diff --git a/tests/integration/test_postgresql_replica_database_engine/test.py b/tests/integration/test_postgresql_replica_database_engine/test.py index 3763b503b60..40324089b1b 100644 --- a/tests/integration/test_postgresql_replica_database_engine/test.py +++ b/tests/integration/test_postgresql_replica_database_engine/test.py @@ -258,7 +258,7 @@ def test_different_data_types(started_cluster): check_tables_are_synchronized('test_data_types', 'id'); result = instance.query('SELECT * FROM test_database.test_data_types ORDER BY id LIMIT 1;') - assert(result == '0\t-32768\t-2147483648\t-9223372036854775808\t1.12345\t1.123456789\t2147483647\t9223372036854775807\t2000-05-12 12:12:12.012345\t2000-05-12\t0.20000\t0.20000\n') + assert(result == '0\t-32768\t-2147483648\t-9223372036854775808\t1.12345\t1.123456789\t2147483647\t9223372036854775807\t2000-05-12 12:12:12.012345\t2000-05-12\t0.2\t0.2\n') for i in range(10): col = random.choice(['a', 'b', 'c']) From bdab932f972201e647e69763153f84dd1f9a56df Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 16 Aug 2021 08:56:42 +0300 Subject: [PATCH 06/13] Fix some tests --- src/IO/WriteHelpers.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/IO/WriteHelpers.h b/src/IO/WriteHelpers.h index feafe87d47d..97fd7b77ba6 100644 --- a/src/IO/WriteHelpers.h +++ b/src/IO/WriteHelpers.h @@ -910,17 +910,17 @@ void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr) { if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); + writeDecimalFractional(static_cast(x), scale, ostr); return; } else if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); + writeDecimalFractional(static_cast(x), scale, ostr); return; } else if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); + writeDecimalFractional(static_cast(x), scale, ostr); return; } } @@ -928,17 +928,17 @@ void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr) { if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); + writeDecimalFractional(static_cast(x), scale, ostr); return; } else if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), std::min(scale, std::numeric_limits::digits10), ostr); + writeDecimalFractional(static_cast(x), scale, ostr); return; } } - constexpr size_t max_digits = std::numeric_limits::digits10; + constexpr size_t max_digits = std::numeric_limits::digits10; assert(scale <= max_digits); char buf[max_digits]; memset(buf, '0', scale); From 8adaef7c8ef23647b10cc63091797be2488a522d Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 16 Aug 2021 11:03:23 +0300 Subject: [PATCH 07/13] Make text format for Decimal tuneable --- src/Common/FieldVisitorDump.cpp | 2 +- src/Common/FieldVisitorToString.cpp | 2 +- src/Core/Field.cpp | 108 ++++++++++++------ src/Core/Field.h | 4 +- src/Core/Settings.h | 1 + .../Serializations/SerializationDecimal.cpp | 4 +- src/Formats/FormatFactory.cpp | 1 + src/Formats/FormatSettings.h | 1 + src/Formats/ProtobufSerializer.cpp | 6 +- src/Functions/FunctionsConversion.h | 2 +- src/IO/WriteHelpers.h | 20 ++-- 11 files changed, 94 insertions(+), 57 deletions(-) diff --git a/src/Common/FieldVisitorDump.cpp b/src/Common/FieldVisitorDump.cpp index 5e767cf30c1..660677404ad 100644 --- a/src/Common/FieldVisitorDump.cpp +++ b/src/Common/FieldVisitorDump.cpp @@ -20,7 +20,7 @@ template static inline void writeQuoted(const DecimalField & x, WriteBuffer & buf) { writeChar('\'', buf); - writeText(x.getValue(), x.getScale(), buf); + writeText(x.getValue(), x.getScale(), buf, {}); writeChar('\'', buf); } diff --git a/src/Common/FieldVisitorToString.cpp b/src/Common/FieldVisitorToString.cpp index 74dfc55e1db..b8750d95e5e 100644 --- a/src/Common/FieldVisitorToString.cpp +++ b/src/Common/FieldVisitorToString.cpp @@ -26,7 +26,7 @@ template static inline void writeQuoted(const DecimalField & x, WriteBuffer & buf) { writeChar('\'', buf); - writeText(x.getValue(), x.getScale(), buf); + writeText(x.getValue(), x.getScale(), buf, {}); writeChar('\'', buf); } diff --git a/src/Core/Field.cpp b/src/Core/Field.cpp index b7b03951ac9..8739f56d991 100644 --- a/src/Core/Field.cpp +++ b/src/Core/Field.cpp @@ -23,65 +23,99 @@ inline Field getBinaryValue(UInt8 type, ReadBuffer & buf) { switch (type) { - case Field::Types::Null: { - return DB::Field(); + case Field::Types::Null: + { + return Field(); } - case Field::Types::UInt64: { + case Field::Types::UInt64: + { UInt64 value; - DB::readVarUInt(value, buf); + readVarUInt(value, buf); return value; } - case Field::Types::UInt128: { + case Field::Types::UInt128: + { UInt128 value; - DB::readBinary(value, buf); + readBinary(value, buf); return value; } - case Field::Types::Int64: { + case Field::Types::UInt256: + { + UInt256 value; + readBinary(value, buf); + return value; + } + case Field::Types::UUID: + { + UUID value; + readBinary(value, buf); + return value; + } + case Field::Types::Int64: + { Int64 value; - DB::readVarInt(value, buf); + readVarInt(value, buf); return value; } - case Field::Types::Float64: { + case Field::Types::Int128: + { + Int128 value; + readBinary(value, buf); + return value; + } + case Field::Types::Int256: + { + Int256 value; + readBinary(value, buf); + return value; + } + case Field::Types::Float64: + { Float64 value; - DB::readFloatBinary(value, buf); + readFloatBinary(value, buf); return value; } - case Field::Types::String: { + case Field::Types::String: + { std::string value; - DB::readStringBinary(value, buf); + readStringBinary(value, buf); return value; } - case Field::Types::Array: { + case Field::Types::Array: + { Array value; - DB::readBinary(value, buf); + readBinary(value, buf); return value; } - case Field::Types::Tuple: { + case Field::Types::Tuple: + { Tuple value; - DB::readBinary(value, buf); + readBinary(value, buf); return value; } - case Field::Types::Map: { + case Field::Types::Map: + { Map value; - DB::readBinary(value, buf); + readBinary(value, buf); return value; } - case Field::Types::AggregateFunctionState: { + case Field::Types::AggregateFunctionState: + { AggregateFunctionStateData value; - DB::readStringBinary(value.name, buf); - DB::readStringBinary(value.data, buf); + readStringBinary(value.name, buf); + readStringBinary(value.data, buf); return value; } } - return DB::Field(); + return Field(); } void readBinary(Array & x, ReadBuffer & buf) { size_t size; UInt8 type; - DB::readBinary(type, buf); - DB::readBinary(size, buf); + readBinary(type, buf); + readBinary(size, buf); for (size_t index = 0; index < size; ++index) x.push_back(getBinaryValue(type, buf)); @@ -93,8 +127,8 @@ void writeBinary(const Array & x, WriteBuffer & buf) size_t size = x.size(); if (size) type = x.front().getType(); - DB::writeBinary(type, buf); - DB::writeBinary(size, buf); + writeBinary(type, buf); + writeBinary(size, buf); for (const auto & elem : x) Field::dispatch([&buf] (const auto & value) { FieldVisitorWriteBinary()(value, buf); }, elem); @@ -102,19 +136,19 @@ void writeBinary(const Array & x, WriteBuffer & buf) void writeText(const Array & x, WriteBuffer & buf) { - DB::String res = applyVisitor(FieldVisitorToString(), DB::Field(x)); + String res = applyVisitor(FieldVisitorToString(), Field(x)); buf.write(res.data(), res.size()); } void readBinary(Tuple & x, ReadBuffer & buf) { size_t size; - DB::readBinary(size, buf); + readBinary(size, buf); for (size_t index = 0; index < size; ++index) { UInt8 type; - DB::readBinary(type, buf); + readBinary(type, buf); x.push_back(getBinaryValue(type, buf)); } } @@ -122,30 +156,30 @@ void readBinary(Tuple & x, ReadBuffer & buf) void writeBinary(const Tuple & x, WriteBuffer & buf) { const size_t size = x.size(); - DB::writeBinary(size, buf); + writeBinary(size, buf); for (const auto & elem : x) { const UInt8 type = elem.getType(); - DB::writeBinary(type, buf); + writeBinary(type, buf); Field::dispatch([&buf] (const auto & value) { FieldVisitorWriteBinary()(value, buf); }, elem); } } void writeText(const Tuple & x, WriteBuffer & buf) { - writeFieldText(DB::Field(x), buf); + writeFieldText(Field(x), buf); } void readBinary(Map & x, ReadBuffer & buf) { size_t size; - DB::readBinary(size, buf); + readBinary(size, buf); for (size_t index = 0; index < size; ++index) { UInt8 type; - DB::readBinary(type, buf); + readBinary(type, buf); x.push_back(getBinaryValue(type, buf)); } } @@ -153,19 +187,19 @@ void readBinary(Map & x, ReadBuffer & buf) void writeBinary(const Map & x, WriteBuffer & buf) { const size_t size = x.size(); - DB::writeBinary(size, buf); + writeBinary(size, buf); for (const auto & elem : x) { const UInt8 type = elem.getType(); - DB::writeBinary(type, buf); + writeBinary(type, buf); Field::dispatch([&buf] (const auto & value) { FieldVisitorWriteBinary()(value, buf); }, elem); } } void writeText(const Map & x, WriteBuffer & buf) { - writeFieldText(DB::Field(x), buf); + writeFieldText(Field(x), buf); } template diff --git a/src/Core/Field.h b/src/Core/Field.h index 744675d6e86..0023497e970 100644 --- a/src/Core/Field.h +++ b/src/Core/Field.h @@ -974,9 +974,9 @@ __attribute__ ((noreturn)) inline void writeText(const AggregateFunctionStateDat } template -inline void writeText(const DecimalField & value, WriteBuffer & buf) +inline void writeText(const DecimalField & value, WriteBuffer & buf, bool trailing_zeros = false) { - writeText(value.getValue(), value.getScale(), buf); + writeText(value.getValue(), value.getScale(), buf, trailing_zeros); } template diff --git a/src/Core/Settings.h b/src/Core/Settings.h index 19f9f2a94c8..f2f0c946b82 100644 --- a/src/Core/Settings.h +++ b/src/Core/Settings.h @@ -560,6 +560,7 @@ class IColumn; M(UInt64, output_format_avro_sync_interval, 16 * 1024, "Sync interval in bytes.", 0) \ M(Bool, output_format_tsv_crlf_end_of_line, false, "If it is set true, end of line in TSV format will be \\r\\n instead of \\n.", 0) \ M(String, output_format_tsv_null_representation, "\\N", "Custom NULL representation in TSV format", 0) \ + M(Bool, output_format_decimal_trailing_zeros, false, "Output trailing zeros when printing Decimal values. E.g. 1.230000 instead of 1.23.", 0) \ \ M(UInt64, input_format_allow_errors_num, 0, "Maximum absolute amount of errors while reading text formats (like CSV, TSV). In case of error, if at least absolute or relative amount of errors is lower than corresponding value, will skip until next line and continue.", 0) \ M(Float, input_format_allow_errors_ratio, 0, "Maximum relative amount of errors while reading text formats (like CSV, TSV). In case of error, if at least absolute or relative amount of errors is lower than corresponding value, will skip until next line and continue.", 0) \ diff --git a/src/DataTypes/Serializations/SerializationDecimal.cpp b/src/DataTypes/Serializations/SerializationDecimal.cpp index e0073c80aca..88c6d970980 100644 --- a/src/DataTypes/Serializations/SerializationDecimal.cpp +++ b/src/DataTypes/Serializations/SerializationDecimal.cpp @@ -44,10 +44,10 @@ void SerializationDecimal::readText(T & x, ReadBuffer & istr, UInt32 precisio } template -void SerializationDecimal::serializeText(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const +void SerializationDecimal::serializeText(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { T value = assert_cast(column).getData()[row_num]; - writeText(value, this->scale, ostr); + writeText(value, this->scale, ostr, settings.decimal_trailing_zeros); } template diff --git a/src/Formats/FormatFactory.cpp b/src/Formats/FormatFactory.cpp index 7b2aac78067..95270cb304f 100644 --- a/src/Formats/FormatFactory.cpp +++ b/src/Formats/FormatFactory.cpp @@ -81,6 +81,7 @@ FormatSettings getFormatSettings(ContextPtr context, const Settings & settings) format_settings.json.quote_64bit_integers = settings.output_format_json_quote_64bit_integers; format_settings.json.quote_denormals = settings.output_format_json_quote_denormals; format_settings.null_as_default = settings.input_format_null_as_default; + format_settings.decimal_trailing_zeros = settings.output_format_decimal_trailing_zeros; format_settings.parquet.row_group_size = settings.output_format_parquet_row_group_size; format_settings.parquet.import_nested = settings.input_format_parquet_import_nested; format_settings.pretty.charset = settings.output_format_pretty_grid_charset.toString() == "ASCII" ? FormatSettings::Pretty::Charset::ASCII : FormatSettings::Pretty::Charset::UTF8; diff --git a/src/Formats/FormatSettings.h b/src/Formats/FormatSettings.h index d77a7c95d69..3e1e00584c0 100644 --- a/src/Formats/FormatSettings.h +++ b/src/Formats/FormatSettings.h @@ -28,6 +28,7 @@ struct FormatSettings bool write_statistics = true; bool import_nested_json = false; bool null_as_default = true; + bool decimal_trailing_zeros = false; enum class DateTimeInputFormat { diff --git a/src/Formats/ProtobufSerializer.cpp b/src/Formats/ProtobufSerializer.cpp index c5781ee6c9f..baeefa8f98e 100644 --- a/src/Formats/ProtobufSerializer.cpp +++ b/src/Formats/ProtobufSerializer.cpp @@ -1239,7 +1239,7 @@ namespace else { WriteBufferFromOwnString buf; - writeText(decimal, scale, buf); + writeText(decimal, scale, buf, false); cannotConvertValue(buf.str(), TypeName, field_descriptor.type_name()); } }; @@ -1316,9 +1316,9 @@ namespace { WriteBufferFromString buf{str}; if constexpr (std::is_same_v) - writeDateTimeText(decimal, scale, buf); + writeDateTimeText(decimal, scale, buf); else - writeText(decimal, scale, buf); + writeText(decimal, scale, buf, false); } DecimalType stringToDecimal(const String & str) const diff --git a/src/Functions/FunctionsConversion.h b/src/Functions/FunctionsConversion.h index e57998e4a72..8f34abc0058 100644 --- a/src/Functions/FunctionsConversion.h +++ b/src/Functions/FunctionsConversion.h @@ -733,7 +733,7 @@ struct FormatImpl> template static ReturnType execute(const FieldType x, WriteBuffer & wb, const DataTypeDecimal * type, const DateLUTImpl *) { - writeText(x, type->getScale(), wb); + writeText(x, type->getScale(), wb, false); return ReturnType(true); } }; diff --git a/src/IO/WriteHelpers.h b/src/IO/WriteHelpers.h index 97fd7b77ba6..6a0050b061f 100644 --- a/src/IO/WriteHelpers.h +++ b/src/IO/WriteHelpers.h @@ -901,7 +901,7 @@ inline void writeText(const LocalDateTime & x, WriteBuffer & buf) { writeDateTim inline void writeText(const UUID & x, WriteBuffer & buf) { writeUUIDText(x, buf); } template -void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr) +void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr, bool trailing_zeros) { /// If it's big integer, but the number of digits is small, /// use the implementation for smaller integers for more efficient arithmetic. @@ -910,17 +910,17 @@ void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr) { if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), scale, ostr, trailing_zeros); return; } else if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), scale, ostr, trailing_zeros); return; } else if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), scale, ostr, trailing_zeros); return; } } @@ -928,12 +928,12 @@ void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr) { if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), scale, ostr, trailing_zeros); return; } else if (x <= std::numeric_limits::max()) { - writeDecimalFractional(static_cast(x), scale, ostr); + writeDecimalFractional(static_cast(x), scale, ostr, trailing_zeros); return; } } @@ -957,11 +957,11 @@ void writeDecimalFractional(const T & x, UInt32 scale, WriteBuffer & ostr) } writeChar('.', ostr); - ostr.write(buf, last_nonzero_pos + 1); + ostr.write(buf, trailing_zeros ? scale : last_nonzero_pos + 1); } template -void writeText(Decimal x, UInt32 scale, WriteBuffer & ostr) +void writeText(Decimal x, UInt32 scale, WriteBuffer & ostr, bool trailing_zeros) { T part = DecimalUtils::getWholePart(x, scale); @@ -975,8 +975,8 @@ void writeText(Decimal x, UInt32 scale, WriteBuffer & ostr) if (scale) { part = DecimalUtils::getFractionalPart(x, scale); - if (part) - writeDecimalFractional(part, scale, ostr); + if (part || trailing_zeros) + writeDecimalFractional(part, scale, ostr, trailing_zeros); } } From fabdcf7e71baab00020f1cb1321785179aef0958 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 16 Aug 2021 11:08:53 +0300 Subject: [PATCH 08/13] Update tests --- .../00825_protobuf_format_persons.reference | 104 +++---- ..._index_replicated_zookeeper_long.reference | 16 +- .../0_stateless/00900_long_parquet.reference | 12 +- .../00900_long_parquet_load.reference | 294 +++++++++--------- .../00900_orc_arrays_load.reference | 4 +- .../00900_orc_nullable_arrays_load.reference | 4 +- ...mpression_codecs_replicated_long.reference | 2 +- .../01307_orc_output_format.reference | 12 +- ...761_alter_decimal_zookeeper_long.reference | 14 +- 9 files changed, 231 insertions(+), 231 deletions(-) diff --git a/tests/queries/0_stateless/00825_protobuf_format_persons.reference b/tests/queries/0_stateless/00825_protobuf_format_persons.reference index 711980b3592..897fd9476e9 100644 --- a/tests/queries/0_stateless/00825_protobuf_format_persons.reference +++ b/tests/queries/0_stateless/00825_protobuf_format_persons.reference @@ -1,6 +1,6 @@ -a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 png +74951234567\0 1 2019-01-05 18:45:00 38 capricorn ['Yesterday','Flowers'] [255,0,0] Moscow [55.753215,37.622504] 3.14 214.10 0.1 5.8 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] +a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 png +74951234567\0 1 2019-01-05 18:45:00 38 capricorn ['Yesterday','Flowers'] [255,0,0] Moscow [55.753215,37.622504] 3.14 214.1 0.1 5.8 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] c694ad8a-f714-4ea3-907d-fd54fb25d9b5 Natalia Sokolova female 1992-03-08 jpg \N 0 \N 26 pisces [] [100,200,50] Plymouth [50.403724,-4.142123] 3.14159 \N 0.007 5.4 -20000000000000 [] [] \N [] -a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 bmp +442012345678 1 2018-12-30 00:00:00 23 leo ['Sunny'] [250,244,10] Murmansk [68.970682,33.074981] 3.14159265358979 100000000000.00 800 -3.2 154400000 ['pound'] [16] 503 [] +a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 bmp +442012345678 1 2018-12-30 00:00:00 23 leo ['Sunny'] [250,244,10] Murmansk [68.970682,33.074981] 3.14159265358979 100000000000 800 -3.2 154400000 ['pound'] [16] 503 [] Schema 00825_protobuf_format_persons:Person @@ -150,9 +150,9 @@ nestiness { Binary representation is as expected Roundtrip: -a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 png +74951234567\0 1 2019-01-05 18:45:00 38 capricorn ['Yesterday','Flowers'] [255,0,0] Moscow [55.753216,37.622504] 3.14 214.10 0.1 5.8 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] +a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 png +74951234567\0 1 2019-01-05 18:45:00 38 capricorn ['Yesterday','Flowers'] [255,0,0] Moscow [55.753216,37.622504] 3.14 214.1 0.1 5.8 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] c694ad8a-f714-4ea3-907d-fd54fb25d9b5 Natalia Sokolova female 1992-03-08 jpg \N 0 \N 26 pisces [] [100,200,50] Plymouth [50.403724,-4.142123] 3.14159 \N 0.007 5.4 -20000000000000 [] [] \N [] -a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 bmp +442012345678 1 2018-12-30 00:00:00 23 leo ['Sunny'] [250,244,10] Murmansk [68.970680,33.074982] 3.14159265358979 100000000000.00 800 -3.2 154400000 ['pound'] [16] 503 [] +a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 bmp +442012345678 1 2018-12-30 00:00:00 23 leo ['Sunny'] [250,244,10] Murmansk [68.97068,33.074982] 3.14159265358979 100000000000 800 -3.2 154400000 ['pound'] [16] 503 [] Schema 00825_protobuf_format_persons:AltPerson @@ -264,14 +264,14 @@ nestiness_a_b_c_d: 503 Binary representation is as expected Roundtrip: -a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 \N 74951234567\0\0 1 2019-01-05 18:45:00 38 capricorn [] [255,0,0] [55.000000,37.000000] 3.140000104904175 214.00 0.1 5.0 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] -c694ad8a-f714-4ea3-907d-fd54fb25d9b5 Natalia Sokolova female 1992-03-08 \N \N 0 \N 26 pisces [] [100,200,50] [50.000000,-4.000000] 3.141590118408203 \N 0.007 5.0 -20000000000000 [] [] \N [] -a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 \N 442012345678\0 1 2018-12-30 00:00:00 23 leo [] [250,244,10] [68.000000,33.000000] 3.1415927410125732 100000000000.00 800 -3.0 154400000 ['pound'] [16] 503 [] +a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 \N 74951234567\0\0 1 2019-01-05 18:45:00 38 capricorn [] [255,0,0] [55,37] 3.140000104904175 214 0.1 5 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] +c694ad8a-f714-4ea3-907d-fd54fb25d9b5 Natalia Sokolova female 1992-03-08 \N \N 0 \N 26 pisces [] [100,200,50] [50,-4] 3.141590118408203 \N 0.007 5 -20000000000000 [] [] \N [] +a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 \N 442012345678\0 1 2018-12-30 00:00:00 23 leo [] [250,244,10] [68,33] 3.1415927410125732 100000000000 800 -3 154400000 ['pound'] [16] 503 [] Schema 00825_protobuf_format_persons:StrPerson Binary representation: -00000000 a7 02 0a 24 61 37 35 32 32 31 35 38 2d 33 64 34 |...$a7522158-3d4| +00000000 a6 02 0a 24 61 37 35 32 32 31 35 38 2d 33 64 34 |...$a7522158-3d4| 00000010 31 2d 34 62 37 37 2d 61 64 36 39 2d 36 63 35 39 |1-4b77-ad69-6c59| 00000020 38 65 65 35 35 63 34 39 12 04 49 76 61 6e 1a 06 |8ee55c49..Ivan..| 00000030 50 65 74 72 6f 76 22 04 6d 61 6c 65 2a 0a 31 39 |Petrov".male*.19| @@ -283,42 +283,42 @@ Binary representation: 00000090 72 73 6a 03 32 35 35 6a 01 30 6a 01 30 72 06 4d |rsj.255j.0j.0r.M| 000000a0 6f 73 63 6f 77 7a 09 35 35 2e 37 35 33 32 31 35 |oscowz.55.753215| 000000b0 7a 09 33 37 2e 36 32 32 35 30 34 82 01 04 33 2e |z.37.622504...3.| -000000c0 31 34 8a 01 06 32 31 34 2e 31 30 92 01 03 30 2e |14...214.10...0.| -000000d0 31 9a 01 03 35 2e 38 a2 01 0b 31 37 30 36 30 30 |1...5.8...170600| -000000e0 30 30 30 30 30 aa 01 2d 0a 05 6d 65 74 65 72 0a |00000..-..meter.| -000000f0 0a 63 65 6e 74 69 6d 65 74 65 72 0a 09 6b 69 6c |.centimeter..kil| -00000100 6f 6d 65 74 65 72 12 01 31 12 04 30 2e 30 31 12 |ometer..1..0.01.| -00000110 04 31 30 30 30 b2 01 11 0a 0f 0a 03 35 30 30 12 |.1000.......500.| -00000120 03 35 30 31 12 03 35 30 32 b4 01 0a 24 63 36 39 |.501..502...$c69| -00000130 34 61 64 38 61 2d 66 37 31 34 2d 34 65 61 33 2d |4ad8a-f714-4ea3-| -00000140 39 30 37 64 2d 66 64 35 34 66 62 32 35 64 39 62 |907d-fd54fb25d9b| -00000150 35 12 07 4e 61 74 61 6c 69 61 1a 08 53 6f 6b 6f |5..Natalia..Soko| -00000160 6c 6f 76 61 22 06 66 65 6d 61 6c 65 2a 0a 31 39 |lova".female*.19| -00000170 39 32 2d 30 33 2d 30 38 42 01 30 52 02 32 36 5a |92-03-08B.0R.26Z| -00000180 06 70 69 73 63 65 73 6a 03 31 30 30 6a 03 32 30 |.piscesj.100j.20| -00000190 30 6a 02 35 30 72 08 50 6c 79 6d 6f 75 74 68 7a |0j.50r.Plymouthz| -000001a0 09 35 30 2e 34 30 33 37 32 34 7a 09 2d 34 2e 31 |.50.403724z.-4.1| -000001b0 34 32 31 32 33 82 01 07 33 2e 31 34 31 35 39 92 |42123...3.14159.| -000001c0 01 05 30 2e 30 30 37 9a 01 03 35 2e 34 a2 01 0f |..0.007...5.4...| -000001d0 2d 32 30 30 30 30 30 30 30 30 30 30 30 30 30 84 |-20000000000000.| -000001e0 02 0a 24 61 37 64 61 31 61 61 36 2d 66 34 32 35 |..$a7da1aa6-f425| -000001f0 2d 34 37 38 39 2d 38 39 34 37 2d 62 30 33 34 37 |-4789-8947-b0347| -00000200 38 36 65 64 33 37 34 12 06 56 61 73 69 6c 79 1a |86ed374..Vasily.| -00000210 07 53 69 64 6f 72 6f 76 22 04 6d 61 6c 65 2a 0a |.Sidorov".male*.| -00000220 31 39 39 35 2d 30 37 2d 32 38 3a 0d 2b 34 34 32 |1995-07-28:.+442| -00000230 30 31 32 33 34 35 36 37 38 42 01 31 4a 13 32 30 |012345678B.1J.20| -00000240 31 38 2d 31 32 2d 33 30 20 30 30 3a 30 30 3a 30 |18-12-30 00:00:0| -00000250 30 52 02 32 33 5a 03 6c 65 6f 62 05 53 75 6e 6e |0R.23Z.leob.Sunn| -00000260 79 6a 03 32 35 30 6a 03 32 34 34 6a 02 31 30 72 |yj.250j.244j.10r| -00000270 08 4d 75 72 6d 61 6e 73 6b 7a 09 36 38 2e 39 37 |.Murmanskz.68.97| -00000280 30 36 38 32 7a 09 33 33 2e 30 37 34 39 38 31 82 |0682z.33.074981.| -00000290 01 10 33 2e 31 34 31 35 39 32 36 35 33 35 38 39 |..3.141592653589| -000002a0 37 39 8a 01 0f 31 30 30 30 30 30 30 30 30 30 30 |79...10000000000| -000002b0 30 2e 30 30 92 01 03 38 30 30 9a 01 04 2d 33 2e |0.00...800...-3.| -000002c0 32 a2 01 09 31 35 34 34 30 30 30 30 30 aa 01 0b |2...154400000...| -000002d0 0a 05 70 6f 75 6e 64 12 02 31 36 b2 01 07 0a 05 |..pound..16.....| -000002e0 0a 03 35 30 33 |..503| -000002e5 +000000c0 31 34 8a 01 05 32 31 34 2e 31 92 01 03 30 2e 31 |14...214.1...0.1| +000000d0 9a 01 03 35 2e 38 a2 01 0b 31 37 30 36 30 30 30 |...5.8...1706000| +000000e0 30 30 30 30 aa 01 2d 0a 05 6d 65 74 65 72 0a 0a |0000..-..meter..| +000000f0 63 65 6e 74 69 6d 65 74 65 72 0a 09 6b 69 6c 6f |centimeter..kilo| +00000100 6d 65 74 65 72 12 01 31 12 04 30 2e 30 31 12 04 |meter..1..0.01..| +00000110 31 30 30 30 b2 01 11 0a 0f 0a 03 35 30 30 12 03 |1000.......500..| +00000120 35 30 31 12 03 35 30 32 b4 01 0a 24 63 36 39 34 |501..502...$c694| +00000130 61 64 38 61 2d 66 37 31 34 2d 34 65 61 33 2d 39 |ad8a-f714-4ea3-9| +00000140 30 37 64 2d 66 64 35 34 66 62 32 35 64 39 62 35 |07d-fd54fb25d9b5| +00000150 12 07 4e 61 74 61 6c 69 61 1a 08 53 6f 6b 6f 6c |..Natalia..Sokol| +00000160 6f 76 61 22 06 66 65 6d 61 6c 65 2a 0a 31 39 39 |ova".female*.199| +00000170 32 2d 30 33 2d 30 38 42 01 30 52 02 32 36 5a 06 |2-03-08B.0R.26Z.| +00000180 70 69 73 63 65 73 6a 03 31 30 30 6a 03 32 30 30 |piscesj.100j.200| +00000190 6a 02 35 30 72 08 50 6c 79 6d 6f 75 74 68 7a 09 |j.50r.Plymouthz.| +000001a0 35 30 2e 34 30 33 37 32 34 7a 09 2d 34 2e 31 34 |50.403724z.-4.14| +000001b0 32 31 32 33 82 01 07 33 2e 31 34 31 35 39 92 01 |2123...3.14159..| +000001c0 05 30 2e 30 30 37 9a 01 03 35 2e 34 a2 01 0f 2d |.0.007...5.4...-| +000001d0 32 30 30 30 30 30 30 30 30 30 30 30 30 30 81 02 |20000000000000..| +000001e0 0a 24 61 37 64 61 31 61 61 36 2d 66 34 32 35 2d |.$a7da1aa6-f425-| +000001f0 34 37 38 39 2d 38 39 34 37 2d 62 30 33 34 37 38 |4789-8947-b03478| +00000200 36 65 64 33 37 34 12 06 56 61 73 69 6c 79 1a 07 |6ed374..Vasily..| +00000210 53 69 64 6f 72 6f 76 22 04 6d 61 6c 65 2a 0a 31 |Sidorov".male*.1| +00000220 39 39 35 2d 30 37 2d 32 38 3a 0d 2b 34 34 32 30 |995-07-28:.+4420| +00000230 31 32 33 34 35 36 37 38 42 01 31 4a 13 32 30 31 |12345678B.1J.201| +00000240 38 2d 31 32 2d 33 30 20 30 30 3a 30 30 3a 30 30 |8-12-30 00:00:00| +00000250 52 02 32 33 5a 03 6c 65 6f 62 05 53 75 6e 6e 79 |R.23Z.leob.Sunny| +00000260 6a 03 32 35 30 6a 03 32 34 34 6a 02 31 30 72 08 |j.250j.244j.10r.| +00000270 4d 75 72 6d 61 6e 73 6b 7a 09 36 38 2e 39 37 30 |Murmanskz.68.970| +00000280 36 38 32 7a 09 33 33 2e 30 37 34 39 38 31 82 01 |682z.33.074981..| +00000290 10 33 2e 31 34 31 35 39 32 36 35 33 35 38 39 37 |.3.1415926535897| +000002a0 39 8a 01 0c 31 30 30 30 30 30 30 30 30 30 30 30 |9...100000000000| +000002b0 92 01 03 38 30 30 9a 01 04 2d 33 2e 32 a2 01 09 |...800...-3.2...| +000002c0 31 35 34 34 30 30 30 30 30 aa 01 0b 0a 05 70 6f |154400000.....po| +000002d0 75 6e 64 12 02 31 36 b2 01 07 0a 05 0a 03 35 30 |und..16.......50| +000002e0 33 |3| +000002e1 MESSAGE #1 AT 0x00000002 uuid: "a7522158-3d41-4b77-ad69-6c598ee55c49" @@ -340,7 +340,7 @@ hometown: "Moscow" location: "55.753215" location: "37.622504" pi: "3.14" -lotteryWin: "214.10" +lotteryWin: "214.1" someRatio: "0.1" temperature: "5.8" randomBigNumber: "17060000000" @@ -359,7 +359,7 @@ nestiness_a { e: "502" } } -MESSAGE #2 AT 0x0000012B +MESSAGE #2 AT 0x0000012A uuid: "c694ad8a-f714-4ea3-907d-fd54fb25d9b5" name: "Natalia" surname: "Sokolova" @@ -378,7 +378,7 @@ pi: "3.14159" someRatio: "0.007" temperature: "5.4" randomBigNumber: "-20000000000000" -MESSAGE #3 AT 0x000001E1 +MESSAGE #3 AT 0x000001E0 uuid: "a7da1aa6-f425-4789-8947-b034786ed374" name: "Vasily" surname: "Sidorov" @@ -397,7 +397,7 @@ hometown: "Murmansk" location: "68.970682" location: "33.074981" pi: "3.14159265358979" -lotteryWin: "100000000000.00" +lotteryWin: "100000000000" someRatio: "800" temperature: "-3.2" randomBigNumber: "154400000" @@ -414,9 +414,9 @@ nestiness_a { Binary representation is as expected Roundtrip: -a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 \N +74951234567\0 1 2019-01-05 18:45:00 38 capricorn ['Yesterday','Flowers'] [255,0,0] Moscow [55.753215,37.622504] 3.14 214.10 0.1 5.8 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] +a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 \N +74951234567\0 1 2019-01-05 18:45:00 38 capricorn ['Yesterday','Flowers'] [255,0,0] Moscow [55.753215,37.622504] 3.14 214.1 0.1 5.8 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] c694ad8a-f714-4ea3-907d-fd54fb25d9b5 Natalia Sokolova female 1992-03-08 \N \N 0 \N 26 pisces [] [100,200,50] Plymouth [50.403724,-4.142123] 3.14159 \N 0.007 5.4 -20000000000000 [] [] \N [] -a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 \N +442012345678 1 2018-12-30 00:00:00 23 leo ['Sunny'] [250,244,10] Murmansk [68.970682,33.074981] 3.14159265358979 100000000000.00 800 -3.2 154400000 ['pound'] [16] 503 [] +a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 \N +442012345678 1 2018-12-30 00:00:00 23 leo ['Sunny'] [250,244,10] Murmansk [68.970682,33.074981] 3.14159265358979 100000000000 800 -3.2 154400000 ['pound'] [16] 503 [] Schema 00825_protobuf_format_syntax2:Syntax2Person @@ -564,6 +564,6 @@ Nestiness { Binary representation is as expected Roundtrip: -a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 png +74951234567\0 1 2019-01-05 18:45:00 38 capricorn ['Yesterday','Flowers'] [255,0,0] Moscow [55.753216,37.622504] 3.14 214.10 0.1 5.8 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] +a7522158-3d41-4b77-ad69-6c598ee55c49 Ivan Petrov male 1980-12-29 png +74951234567\0 1 2019-01-05 18:45:00 38 capricorn ['Yesterday','Flowers'] [255,0,0] Moscow [55.753216,37.622504] 3.14 214.1 0.1 5.8 17060000000 ['meter','centimeter','kilometer'] [1,0.01,1000] 500 [501,502] c694ad8a-f714-4ea3-907d-fd54fb25d9b5 Natalia Sokolova female 1992-03-08 jpg \N 0 \N 26 pisces [] [100,200,50] Plymouth [50.403724,-4.142123] 3.14159 \N 0.007 5.4 -20000000000000 [] [] \N [] -a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 bmp +442012345678 1 2018-12-30 00:00:00 23 leo ['Sunny'] [250,244,10] Murmansk [68.970680,33.074982] 3.14159265358979 100000000000.00 800 -3.2 154400000 ['pound'] [16] 503 [] +a7da1aa6-f425-4789-8947-b034786ed374 Vasily Sidorov male 1995-07-28 bmp +442012345678 1 2018-12-30 00:00:00 23 leo ['Sunny'] [250,244,10] Murmansk [68.97068,33.074982] 3.14159265358979 100000000000 800 -3.2 154400000 ['pound'] [16] 503 [] diff --git a/tests/queries/0_stateless/00837_minmax_index_replicated_zookeeper_long.reference b/tests/queries/0_stateless/00837_minmax_index_replicated_zookeeper_long.reference index f5df12ad297..efae13c2a40 100644 --- a/tests/queries/0_stateless/00837_minmax_index_replicated_zookeeper_long.reference +++ b/tests/queries/0_stateless/00837_minmax_index_replicated_zookeeper_long.reference @@ -1,8 +1,8 @@ -0 5 4.7 6.50 cba b 2014-01-04 -1 5 4.7 6.50 cba b 2014-03-11 -12 5 4.7 6.50 cba b 2014-06-11 -13 5 4.7 6.50 cba b 2015-01-01 -0 5 4.7 6.50 cba b 2014-01-04 -1 5 4.7 6.50 cba b 2014-03-11 -12 5 4.7 6.50 cba b 2014-06-11 -13 5 4.7 6.50 cba b 2015-01-01 +0 5 4.7 6.5 cba b 2014-01-04 +1 5 4.7 6.5 cba b 2014-03-11 +12 5 4.7 6.5 cba b 2014-06-11 +13 5 4.7 6.5 cba b 2015-01-01 +0 5 4.7 6.5 cba b 2014-01-04 +1 5 4.7 6.5 cba b 2014-03-11 +12 5 4.7 6.5 cba b 2014-06-11 +13 5 4.7 6.5 cba b 2015-01-01 diff --git a/tests/queries/0_stateless/00900_long_parquet.reference b/tests/queries/0_stateless/00900_long_parquet.reference index d0cb71338af..9ee4fc11a55 100644 --- a/tests/queries/0_stateless/00900_long_parquet.reference +++ b/tests/queries/0_stateless/00900_long_parquet.reference @@ -60,17 +60,17 @@ dest from null: -108 108 -1016 1116 -1032 1132 -1064 1164 -1.032 -1.064 string-0 fixedstring\0\0\0\0 2001-02-03 2002-02-03 04:05:06 127 255 32767 65535 2147483647 4294967295 9223372036854775807 9223372036854775807 -1.032 -1.064 string-2 fixedstring-2\0\0 2004-06-07 2004-02-03 04:05:06 \N \N \N \N \N \N \N \N \N \N \N \N \N \N -1 [1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.20,10.00,4.00] [4.00,10000.10,10000.10] [1000000000.00,90.00,101001.01] -1 [1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.20,10.00,4.00] [4.00,10000.10,10000.10] [1000000000.00,90.00,101001.01] +1 [1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.2,10,4] [4,10000.1,10000.1] [1000000000,90,101001.01] +1 [1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.2,10,4] [4,10000.1,10000.1] [1000000000,90,101001.01] 2 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] 2 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] -1 [1,NULL,2] [NULL,'Some string',NULL] [0.00,NULL,42.42] -1 [1,NULL,2] [NULL,'Some string',NULL] [0.00,NULL,42.42] +1 [1,NULL,2] [NULL,'Some string',NULL] [0,NULL,42.42] +1 [1,NULL,2] [NULL,'Some string',NULL] [0,NULL,42.42] 2 [NULL] [NULL] [NULL] 2 [NULL] [NULL] [NULL] 3 [] [] [] 3 [] [] [] [[[1,2,3],[1,2,3]],[[1,2,3]],[[],[1,2,3]]] [[['Some string','Some string'],[]],[['Some string']],[[]]] [[NULL,1,2],[NULL],[1,2],[]] [['Some string',NULL,'Some string'],[NULL],[]] [[[1,2,3],[1,2,3]],[[1,2,3]],[[],[1,2,3]]] [[['Some string','Some string'],[]],[['Some string']],[[]]] [[NULL,1,2],[NULL],[1,2],[]] [['Some string',NULL,'Some string'],[NULL],[]] -0.1230 0.12312312 0.1231231231230000 0.12312312312312312300000000000000 -0.1230 0.12312312 0.1231231231230000 0.12312312312312312300000000000000 +0.123 0.12312312 0.123123123123 0.123123123123123123 +0.123 0.12312312 0.123123123123 0.123123123123123123 diff --git a/tests/queries/0_stateless/00900_long_parquet_load.reference b/tests/queries/0_stateless/00900_long_parquet_load.reference index f03f56c7125..0fc050891f6 100644 --- a/tests/queries/0_stateless/00900_long_parquet_load.reference +++ b/tests/queries/0_stateless/00900_long_parquet_load.reference @@ -3,8 +3,8 @@ 1 0 1 1 1 10 1.1 10.1 01/01/09 1 1230768060 === Try load data from alltypes_list.parquet [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] -[1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.20,10.00,4.00] [4.00,10000.10,10000.10] [1000000000.00,90.00,101001.01] -[1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.20,10.00,4.00] [4.00,10000.10,10000.10] [1000000000.00,90.00,101001.01] +[1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.2,10,4] [4,10000.1,10000.1] [1000000000,90,101001.01] +[1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.2,10,4] [4,10000.1,10000.1] [1000000000,90,101001.01] === Try load data from alltypes_plain.parquet 4 1 0 0 0 0 0 0 03/01/09 0 1235865600 5 0 1 1 1 10 1.1 10.1 03/01/09 1 1235865660 @@ -64,30 +64,30 @@ idx10 ['This','is','a','test'] \n === Try load data from byte_array_decimal.parquet -1.00 -2.00 -3.00 -4.00 -5.00 -6.00 -7.00 -8.00 -9.00 -10.00 -11.00 -12.00 -13.00 -14.00 -15.00 -16.00 -17.00 -18.00 -19.00 -20.00 -21.00 -22.00 -23.00 -24.00 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 === Try load data from datapage_v2.snappy.parquet Code: 33. DB::ParsingEx---tion: Error while reading Parquet data: IOError: Not yet implemented: Unsupported encoding.: While executing ParquetBlockInputFormat: data for INSERT was parsed from stdin. (CANNOT_READ_ALL_DATA) @@ -137,135 +137,135 @@ Code: 33. DB::ParsingEx---tion: Error while reading Parquet data: IOError: Not y 1552 1552 === Try load data from fixed_length_decimal.parquet -1.00 -2.00 -3.00 -4.00 -5.00 -6.00 -7.00 -8.00 -9.00 -10.00 -11.00 -12.00 -13.00 -14.00 -15.00 -16.00 -17.00 -18.00 -19.00 -20.00 -21.00 -22.00 -23.00 -24.00 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 === Try load data from fixed_length_decimal_1.parquet -1.00 -2.00 -3.00 -4.00 -5.00 -6.00 -7.00 -8.00 -9.00 -10.00 -11.00 -12.00 -13.00 -14.00 -15.00 -16.00 -17.00 -18.00 -19.00 -20.00 -21.00 -22.00 -23.00 -24.00 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 === Try load data from fixed_length_decimal_legacy.parquet -1.00 -2.00 -3.00 -4.00 -5.00 -6.00 -7.00 -8.00 -9.00 -10.00 -11.00 -12.00 -13.00 -14.00 -15.00 -16.00 -17.00 -18.00 -19.00 -20.00 -21.00 -22.00 -23.00 -24.00 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 === Try load data from hadoop_lz4_compressed.parquet 1593604800 abc 42 1593604800 def 7.7 1593604801 abc 42.125 1593604801 def 7.7 === Try load data from int32_decimal.parquet -1.00 -2.00 -3.00 -4.00 -5.00 -6.00 -7.00 -8.00 -9.00 -10.00 -11.00 -12.00 -13.00 -14.00 -15.00 -16.00 -17.00 -18.00 -19.00 -20.00 -21.00 -22.00 -23.00 -24.00 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 === Try load data from int64_decimal.parquet -1.00 -2.00 -3.00 -4.00 -5.00 -6.00 -7.00 -8.00 -9.00 -10.00 -11.00 -12.00 -13.00 -14.00 -15.00 -16.00 -17.00 -18.00 -19.00 -20.00 -21.00 -22.00 -23.00 -24.00 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 === Try load data from list_columns.parquet [1,2,3] ['abc','efg','hij'] [NULL,1] [] @@ -325,7 +325,7 @@ Code: 33. DB::ParsingEx---tion: Error while reading Parquet data: IOError: Not y 6 [] [] {} [] (NULL,[],([]),{}) 7 [] [[],[5,6]] {'k1':NULL,'k3':NULL} [] (7,[2,3,NULL],([[],[(NULL,NULL)],[]]),{}) === Try load data from nullable_list.parquet -[1,NULL,2] [NULL,'Some string',NULL] [0.00,NULL,42.42] +[1,NULL,2] [NULL,'Some string',NULL] [0,NULL,42.42] [NULL] [NULL] [NULL] [] [] [] === Try load data from nulls.snappy.parquet diff --git a/tests/queries/0_stateless/00900_orc_arrays_load.reference b/tests/queries/0_stateless/00900_orc_arrays_load.reference index 9b20ef98164..f894669fa0c 100644 --- a/tests/queries/0_stateless/00900_orc_arrays_load.reference +++ b/tests/queries/0_stateless/00900_orc_arrays_load.reference @@ -1,4 +1,4 @@ -[1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.20,10.00,4.00] [4.00,10000.10,10000.10] [1000000000.00,90.00,101001.01] +[1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.2,10,4] [4,10000.1,10000.1] [1000000000,90,101001.01] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] -[1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.20,10.00,4.00] [4.00,10000.10,10000.10] [1000000000.00,90.00,101001.01] +[1,-2,3] [1,2,3] [100,-200,300] [100,200,300] [10000000,-20000000,30000000] [10000000,2000000,3000000] [100000000000000,-200000000000,3000000000000] [100000000000000,20000000000000,3000000000000] ['Some string','Some string','Some string'] ['0000','1111','2222'] [42.42,424.2,0.4242] [424242.424242,4242042420.242424,42] ['2000-01-01','2001-01-01','2002-01-01'] ['2000-01-01 00:00:00','2001-01-01 00:00:00','2002-01-01 00:00:00'] [0.2,10,4] [4,10000.1,10000.1] [1000000000,90,101001.01] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] diff --git a/tests/queries/0_stateless/00900_orc_nullable_arrays_load.reference b/tests/queries/0_stateless/00900_orc_nullable_arrays_load.reference index 62e95652040..44b19f616d0 100644 --- a/tests/queries/0_stateless/00900_orc_nullable_arrays_load.reference +++ b/tests/queries/0_stateless/00900_orc_nullable_arrays_load.reference @@ -1,6 +1,6 @@ -[1,NULL,2] [NULL,'Some string',NULL] [0.00,NULL,42.42] +[1,NULL,2] [NULL,'Some string',NULL] [0,NULL,42.42] [NULL] [NULL] [NULL] [] [] [] -[1,NULL,2] [NULL,'Some string',NULL] [0.00,NULL,42.42] +[1,NULL,2] [NULL,'Some string',NULL] [0,NULL,42.42] [NULL] [NULL] [NULL] [] [] [] diff --git a/tests/queries/0_stateless/00910_zookeeper_custom_compression_codecs_replicated_long.reference b/tests/queries/0_stateless/00910_zookeeper_custom_compression_codecs_replicated_long.reference index 3b7faecbba4..6b7bddf2ac5 100644 --- a/tests/queries/0_stateless/00910_zookeeper_custom_compression_codecs_replicated_long.reference +++ b/tests/queries/0_stateless/00910_zookeeper_custom_compression_codecs_replicated_long.reference @@ -22,6 +22,6 @@ 9175437371954010821 CREATE TABLE default.compression_codec_multiple_more_types_replicated\n(\n `id` Decimal(38, 13) CODEC(ZSTD(1), LZ4, ZSTD(1), ZSTD(1), Delta(2), Delta(4), Delta(1), LZ4HC(0)),\n `data` FixedString(12) CODEC(ZSTD(1), ZSTD(1), Delta(1), Delta(1), Delta(1), NONE, NONE, NONE, LZ4HC(0)),\n `ddd.age` Array(UInt8) CODEC(LZ4, LZ4HC(0), NONE, NONE, NONE, ZSTD(1), Delta(8)),\n `ddd.Name` Array(String) CODEC(LZ4, LZ4HC(0), NONE, NONE, NONE, ZSTD(1), Delta(8))\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/default/test_00910/compression_codec_multiple_more_types_replicated\', \'1\')\nORDER BY tuple()\nSETTINGS index_granularity = 8192 1.5555555555555 hello world! [77] ['John'] -7.1000000000000 xxxxxxxxxxxx [127] ['Henry'] +7.1 xxxxxxxxxxxx [127] ['Henry'] ! 222 diff --git a/tests/queries/0_stateless/01307_orc_output_format.reference b/tests/queries/0_stateless/01307_orc_output_format.reference index da719072eb2..e185c02a3e5 100644 --- a/tests/queries/0_stateless/01307_orc_output_format.reference +++ b/tests/queries/0_stateless/01307_orc_output_format.reference @@ -1,6 +1,6 @@ -255 65535 4294967295 100000000000 -128 -32768 -2147483648 -100000000000 2.02 10000.0000001 String 2020 2021-12-19 2021-12-19 03:00:00 1.0001 1.0000000100 100000.00000000000001000000 1 -4 1234 3244467295 500000000000 -1 -256 -14741221 -7000000000 100.1 14321.032141201 Another string 2000 2024-10-04 2028-04-21 01:20:00 34.1234 123123.1231231230 123123123.12312312312312300000 \N -42 42 42 42 42 42 42 42 42.42 42.42 42 4242 1970-02-12 1970-01-01 03:00:42 42.4200 42.4242424200 424242.42424242424242000000 42 -255 65535 4294967295 100000000000 -128 -32768 -2147483648 -100000000000 2.02 10000.0000001 String 2020 2021-12-19 2021-12-19 03:00:00 1.0001 1.0000000100 100000.00000000000001000000 1 -4 1234 3244467295 500000000000 -1 -256 -14741221 -7000000000 100.1 14321.032141201 Another string 2000 2024-10-04 2028-04-21 01:20:00 34.1234 123123.1231231230 123123123.12312312312312300000 \N -42 42 42 42 42 42 42 42 42.42 42.42 42 4242 1970-02-12 1970-01-01 03:00:42 42.4200 42.4242424200 424242.42424242424242000000 42 +255 65535 4294967295 100000000000 -128 -32768 -2147483648 -100000000000 2.02 10000.0000001 String 2020 2021-12-19 2021-12-19 03:00:00 1.0001 1.00000001 100000.00000000000001 1 +4 1234 3244467295 500000000000 -1 -256 -14741221 -7000000000 100.1 14321.032141201 Another string 2000 2024-10-04 2028-04-21 01:20:00 34.1234 123123.123123123 123123123.123123123123123 \N +42 42 42 42 42 42 42 42 42.42 42.42 42 4242 1970-02-12 1970-01-01 03:00:42 42.42 42.42424242 424242.42424242424242 42 +255 65535 4294967295 100000000000 -128 -32768 -2147483648 -100000000000 2.02 10000.0000001 String 2020 2021-12-19 2021-12-19 03:00:00 1.0001 1.00000001 100000.00000000000001 1 +4 1234 3244467295 500000000000 -1 -256 -14741221 -7000000000 100.1 14321.032141201 Another string 2000 2024-10-04 2028-04-21 01:20:00 34.1234 123123.123123123 123123123.123123123123123 \N +42 42 42 42 42 42 42 42 42.42 42.42 42 4242 1970-02-12 1970-01-01 03:00:42 42.42 42.42424242 424242.42424242424242 42 diff --git a/tests/queries/0_stateless/01761_alter_decimal_zookeeper_long.reference b/tests/queries/0_stateless/01761_alter_decimal_zookeeper_long.reference index ea3f608b6c7..ad5f224bc73 100644 --- a/tests/queries/0_stateless/01761_alter_decimal_zookeeper_long.reference +++ b/tests/queries/0_stateless/01761_alter_decimal_zookeeper_long.reference @@ -1,9 +1,9 @@ -1 5.00000000 -2 6.00000000 +1 5 +2 6 CREATE TABLE default.test_alter_decimal\n(\n `n` UInt64,\n `d` Decimal(18, 8)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/default/01761_alter_decimal_zookeeper\', \'r1\')\nORDER BY tuple()\nSETTINGS index_granularity = 8192 -1 5.00000000 -2 6.00000000 +1 5 +2 6 CREATE TABLE default.test_alter_decimal\n(\n `n` UInt64,\n `d` Decimal(18, 8)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/default/01761_alter_decimal_zookeeper\', \'r1\')\nORDER BY tuple()\nSETTINGS index_granularity = 8192 -1 5.00000000 -2 6.00000000 -3 7.00000000 +1 5 +2 6 +3 7 From 0b7f6c008ac4e9f2ae5655039139a7761c0f48bc Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 16 Aug 2021 11:10:59 +0300 Subject: [PATCH 09/13] Update test --- tests/integration/test_mysql_database_engine/test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_mysql_database_engine/test.py b/tests/integration/test_mysql_database_engine/test.py index 8f305fa8463..a093c2a0125 100644 --- a/tests/integration/test_mysql_database_engine/test.py +++ b/tests/integration/test_mysql_database_engine/test.py @@ -232,7 +232,7 @@ uint16_values = [0, 1, 65535] int8_values = [0, 1, -1, 127, -128] uint8_values = [0, 1, 255] # string_values = ["'ClickHouse'", 'NULL'] -string_values = ["'ClickHouse'"] +string_values = ["'ClickHouse'"] decimal_values = [0, 0.123, 0.4, 5.67, 8.91011, 123456789.123, -0.123, -0.4, -5.67, -8.91011, -123456789.123] @@ -319,7 +319,8 @@ def test_mysql_types(started_cluster, case_name, mysql_type, expected_ch_type, m ) clickhouse_query_settings = dict( - mysql_datatypes_support_level=setting_mysql_datatypes_support_level + mysql_datatypes_support_level=setting_mysql_datatypes_support_level, + output_format_decimal_trailing_zeros=1 ) def execute_query(node, query, **kwargs): From 43602a838a37e45e6ce9b69d86beee96e840c47f Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Mon, 16 Aug 2021 18:14:47 +0300 Subject: [PATCH 10/13] Update compare.sh --- docker/test/performance-comparison/compare.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker/test/performance-comparison/compare.sh b/docker/test/performance-comparison/compare.sh index a6e1ee482d6..e5c9f349ce3 100755 --- a/docker/test/performance-comparison/compare.sh +++ b/docker/test/performance-comparison/compare.sh @@ -628,6 +628,9 @@ cat analyze/errors.log >> report/errors.log ||: cat profile-errors.log >> report/errors.log ||: clickhouse-local --query " +-- We use decimals specifically to get fixed-point, fixed-width formatting. +set output_format_decimal_trailing_zeros = 1; + create view query_display_names as select * from file('analyze/query-display-names.tsv', TSV, 'test text, query_index int, query_display_name text') @@ -975,6 +978,9 @@ for version in {right,left} do rm -rf data clickhouse-local --query " +-- We use decimals specifically to get fixed-point, fixed-width formatting. +set output_format_decimal_trailing_zeros = 1; + create view query_profiles as with 0 as left, 1 as right select * from file('analyze/query-profiles.tsv', TSV, @@ -1170,6 +1176,9 @@ rm -rf metrics ||: mkdir metrics clickhouse-local --query " +-- We use decimals specifically to get fixed-point, fixed-width formatting. +set output_format_decimal_trailing_zeros = 1; + create view right_async_metric_log as select * from file('right-async-metric-log.tsv', TSVWithNamesAndTypes, '$(cat right-async-metric-log.tsv.columns)') From 6ea1bd1e8cabda9a602e0bd4a8d131a0220300bf Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 17 Aug 2021 09:02:37 +0300 Subject: [PATCH 11/13] More tests --- .../02009_decimal_no_trailing_zeros.reference | 32 +++++++++---------- .../02009_decimal_no_trailing_zeros.sql | 19 +++++++++++ 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference index d41682b62ce..7986d51bfda 100644 --- a/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference +++ b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference @@ -1,32 +1,30 @@ --- { echo } - -SELECT 1.123::Decimal64(1); 1.1 -SELECT 1.123::Decimal64(2); 1.12 -SELECT 1.123::Decimal64(3); 1.123 -SELECT 1.123::Decimal64(4); 1.123 -SELECT 1.123::Decimal64(5); 1.123 -SELECT 1.123::Decimal64(10); 1.123 -SELECT 1::Decimal64(0); 1 -SELECT 1::Decimal64(1); 1 -SELECT 1::Decimal64(10); 1 -SELECT 1.1234567::Decimal32(8); 1.1234567 -SELECT 1.1234567890::Decimal64(10); 1.123456789 -SELECT 1.1234567890::Decimal128(10); 1.123456789 -SELECT 1.1234567890::Decimal256(10); 1.123456789 -SELECT 1.123456789012345678901::Decimal256(20); 1.1234567890123456789 -SELECT 1.123456789012345678901::Decimal256(22); 1.123456789012345678901 +1.1 +1.12 +1.123 +1.1230 +1.12300 +1.1230000000 +1 +1.0 +1.0000000000 +1.12345670 +1.1234567890 +1.1234567890 +1.1234567890 +1.12345678901234567890 +1.1234567890123456789010 diff --git a/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.sql b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.sql index 556e355e7d8..e88e878b378 100644 --- a/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.sql +++ b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.sql @@ -16,3 +16,22 @@ SELECT 1.1234567890::Decimal128(10); SELECT 1.1234567890::Decimal256(10); SELECT 1.123456789012345678901::Decimal256(20); SELECT 1.123456789012345678901::Decimal256(22); + +SET output_format_decimal_trailing_zeros = 1; + +SELECT 1.123::Decimal64(1); +SELECT 1.123::Decimal64(2); +SELECT 1.123::Decimal64(3); +SELECT 1.123::Decimal64(4); +SELECT 1.123::Decimal64(5); +SELECT 1.123::Decimal64(10); +SELECT 1::Decimal64(0); +SELECT 1::Decimal64(1); +SELECT 1::Decimal64(10); + +SELECT 1.1234567::Decimal32(8); +SELECT 1.1234567890::Decimal64(10); +SELECT 1.1234567890::Decimal128(10); +SELECT 1.1234567890::Decimal256(10); +SELECT 1.123456789012345678901::Decimal256(20); +SELECT 1.123456789012345678901::Decimal256(22); From 4051db8eabfe5aec12c4f2ab8d7b890e0f2cfcc0 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 17 Aug 2021 09:11:35 +0300 Subject: [PATCH 12/13] Add performance test --- tests/performance/decimal_format.xml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/performance/decimal_format.xml diff --git a/tests/performance/decimal_format.xml b/tests/performance/decimal_format.xml new file mode 100644 index 00000000000..6841ea93d12 --- /dev/null +++ b/tests/performance/decimal_format.xml @@ -0,0 +1,3 @@ + + SELECT count() FROM zeros(10000000) WHERE NOT ignore(toString((rand() / 1000000)::Decimal64(6))) + From 1a3b72fa09b63be64e6e3ff734279fd01997ba33 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 17 Aug 2021 10:15:17 +0300 Subject: [PATCH 13/13] Update test --- .../02009_decimal_no_trailing_zeros.reference | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference index 7986d51bfda..58f5180322a 100644 --- a/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference +++ b/tests/queries/0_stateless/02009_decimal_no_trailing_zeros.reference @@ -1,30 +1,63 @@ +-- { echo } + +SELECT 1.123::Decimal64(1); 1.1 +SELECT 1.123::Decimal64(2); 1.12 +SELECT 1.123::Decimal64(3); 1.123 +SELECT 1.123::Decimal64(4); 1.123 +SELECT 1.123::Decimal64(5); 1.123 +SELECT 1.123::Decimal64(10); 1.123 +SELECT 1::Decimal64(0); 1 +SELECT 1::Decimal64(1); 1 +SELECT 1::Decimal64(10); 1 +SELECT 1.1234567::Decimal32(8); 1.1234567 +SELECT 1.1234567890::Decimal64(10); 1.123456789 +SELECT 1.1234567890::Decimal128(10); 1.123456789 +SELECT 1.1234567890::Decimal256(10); 1.123456789 +SELECT 1.123456789012345678901::Decimal256(20); 1.1234567890123456789 +SELECT 1.123456789012345678901::Decimal256(22); 1.123456789012345678901 +SET output_format_decimal_trailing_zeros = 1; +SELECT 1.123::Decimal64(1); 1.1 +SELECT 1.123::Decimal64(2); 1.12 +SELECT 1.123::Decimal64(3); 1.123 +SELECT 1.123::Decimal64(4); 1.1230 +SELECT 1.123::Decimal64(5); 1.12300 +SELECT 1.123::Decimal64(10); 1.1230000000 +SELECT 1::Decimal64(0); 1 +SELECT 1::Decimal64(1); 1.0 +SELECT 1::Decimal64(10); 1.0000000000 +SELECT 1.1234567::Decimal32(8); 1.12345670 +SELECT 1.1234567890::Decimal64(10); 1.1234567890 +SELECT 1.1234567890::Decimal128(10); 1.1234567890 +SELECT 1.1234567890::Decimal256(10); 1.1234567890 +SELECT 1.123456789012345678901::Decimal256(20); 1.12345678901234567890 +SELECT 1.123456789012345678901::Decimal256(22); 1.1234567890123456789010