diff --git a/dbms/tests/queries/0_stateless/00948_values_interpreter_template.reference b/dbms/tests/queries/0_stateless/00948_values_interpreter_template.reference new file mode 100644 index 00000000000..7bb92e22620 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00948_values_interpreter_template.reference @@ -0,0 +1,8 @@ +1970-01-02 hello 6 -20 nan [3,2,1] +1970-01-03 world 7 2 inf [] +1970-01-04 test 6 -9223372036854775807 3.14 [5,4] +1970-01-05 expressions 15 -9223372036854775807 1 [0,9,8,7,6] +1970-01-02 hello 6 +1970-01-03 warld 5 +1970-01-04 test 4 +1970-01-05 \N \N diff --git a/dbms/tests/queries/0_stateless/00948_values_interpreter_template.sql b/dbms/tests/queries/0_stateless/00948_values_interpreter_template.sql new file mode 100644 index 00000000000..1f69f7ec58d --- /dev/null +++ b/dbms/tests/queries/0_stateless/00948_values_interpreter_template.sql @@ -0,0 +1,22 @@ +DROP TABLE IF EXISTS values_template; +DROP TABLE IF EXISTS values_template_nullable; + +CREATE TABLE values_template (d Date, s String, u UInt8, i Int64, f Float64, a Array(UInt8)) ENGINE = Memory; +CREATE TABLE values_template_nullable (d Date, s Nullable(String), u Nullable(UInt8)) ENGINE = Memory; + +SET input_format_values_interpret_expressions = 0; + +--(1, lower(replaceAll(_STR_1, 'o', 'a')), _NUM_1 + _NUM_2 + _NUM_3, round(_NUM_4 / _NUM_5), _NUM_6 * CAST(_STR_7, 'Int8'), _ARR_8); +-- _NUM_1: UInt64 -> Int64 -> UInt64 +-- _NUM_4: Int64 -> UInt64 +-- _NUM_5: Float64 -> Int64 +INSERT INTO values_template VALUES ((1), lower(replaceAll('Hella', 'a', 'o')), 1 + 2 + 3, round(-4 * 5.0), nan / CAST('42', 'Int8'), reverse([1, 2, 3])), ((2), lower(replaceAll('Warld', 'a', 'o')), -4 + 5 + 6, round(18446744073709551615 * 1e-19), 1.0 / CAST('0', 'Int8'), reverse([])), ((3), lower(replaceAll('Test', 'a', 'o')), 3 + 2 + 1, round(9223372036854775807 * -1), 6.28 / CAST('2', 'Int8'), reverse([4, 5])), ((4), lower(replaceAll('Expressians', 'a', 'o')), 6 + 5 + 4, round(1 * -9223372036854775807), 127.0 / CAST('127', 'Int8'), reverse([6, 7, 8, 9, 0])); + + +INSERT INTO values_template_nullable VALUES ((1), lower(replaceAll('Hella', 'a', 'o')), 1 + 2 + 3), ((2), lower(replaceAll('Warld', 'b', 'o')), 4 - 5 + 6), ((3), lower(replaceAll('Test', 'c', 'o')), 3 + 2 - 1), ((4), lower(replaceAll(null, 'c', 'o')), 6 + 5 - null); + + +SELECT * FROM values_template ORDER BY d; +SELECT * FROM values_template_nullable ORDER BY d; +DROP TABLE values_template; +DROP TABLE values_template_nullable;