Update tests

This commit is contained in:
slvrtrn 2023-11-16 14:58:52 +01:00
parent e2b25aab0c
commit 85d363fb28
7 changed files with 28 additions and 11 deletions

View File

@ -25,6 +25,7 @@ With bar
With foo
With bar
With 42
With 42
With fae310ca-d52a-4923-9e9b-02bf67f4b009
With 2023-11-14
With 2123-11-14
@ -41,6 +42,11 @@ With (42,43)
With [(0,0),(10,0),(10,10),(0,10)]
With [[(20,20),(50,20),(50,50),(20,50)],[(30,30),(50,50),(50,30)]]
With [[[(0,0),(10,0),(10,10),(0,10)]],[[(20,20),(50,20),(50,50),(20,50)],[(30,30),(50,50),(50,30)]]]
-- SimpleAggregateFunction
With 42
With 4
-- Nested
With [(\'foo\',\'qaz\'),(\'bar\',\'qux\')]
-- NULL arguments
\N
\N

View File

@ -1,8 +1,6 @@
-- Tags: no-fasttest
-- no-fasttest: json type needs rapidjson library, geo types need s2 geometry
-- not tested here: (Simple)AggregateFunction, Nested
SET allow_experimental_object_type = 1;
SET allow_suspicious_low_cardinality_types=1;
@ -33,11 +31,12 @@ SELECT concat('With ', materialize('bar' :: LowCardinality(FixedString(3))));
SELECT concat('With ', materialize('foo' :: LowCardinality(Nullable(String))));
SELECT concat('With ', materialize('bar' :: LowCardinality(Nullable(FixedString(3)))));
SELECT concat('With ', materialize(42 :: LowCardinality(Nullable(UInt32))));
SELECT concat('With ', materialize(42 :: LowCardinality(UInt32)));
SELECT concat('With ', materialize('fae310ca-d52a-4923-9e9b-02bf67f4b009' :: UUID));
SELECT concat('With ', materialize('2023-11-14' :: Date));
SELECT concat('With ', materialize('2123-11-14' :: Date32));
SELECT concat('With ', materialize('2023-11-14 05:50:12' :: DateTime));
SELECT concat('With ', materialize('2023-11-14 05:50:12.123' :: DateTime64(3)));
SELECT concat('With ', materialize('2023-11-14 05:50:12' :: DateTime('Europe/Amsterdam')));
SELECT concat('With ', materialize('2023-11-14 05:50:12.123' :: DateTime64(3, 'Europe/Amsterdam')));
SELECT concat('With ', materialize('hallo' :: Enum('hallo' = 1)));
SELECT concat('With ', materialize(['foo', 'bar'] :: Array(String)));
SELECT concat('With ', materialize('{"foo": "bar"}' :: JSON));
@ -50,14 +49,23 @@ SELECT concat('With ', materialize([(0,0),(10,0),(10,10),(0,10)] :: Ring));
SELECT concat('With ', materialize([[(20, 20), (50, 20), (50, 50), (20, 50)], [(30, 30), (50, 50), (50, 30)]] :: Polygon));
SELECT concat('With ', materialize([[[(0, 0), (10, 0), (10, 10), (0, 10)]], [[(20, 20), (50, 20), (50, 50), (20, 50)],[(30, 30), (50, 50), (50, 30)]]] :: MultiPolygon));
SELECT '-- SimpleAggregateFunction';
CREATE OR REPLACE TABLE concat_saf_test(x SimpleAggregateFunction(max, Int32)) ENGINE=MergeTree ORDER BY tuple();
INSERT INTO concat_saf_test VALUES (42);
INSERT INTO concat_saf_test SELECT max(number) FROM numbers(5);
SELECT concat('With ', x) FROM concat_saf_test ORDER BY x DESC;
SELECT '-- Nested';
CREATE OR REPLACE TABLE concat_nested_test(kv Nested(k String, v String)) ENGINE = MergeTree ORDER BY tuple();
INSERT INTO concat_nested_test VALUES (['foo', 'bar'], ['qaz', 'qux']);
SELECT concat('With ', kv) FROM concat_nested_test;
SELECT '-- NULL arguments';
SELECT concat(NULL, NULL);
SELECT concat(NULL, materialize(NULL :: Nullable(UInt64)));
SELECT concat(materialize(NULL :: Nullable(UInt64)), materialize(NULL :: Nullable(UInt64)));
SELECT concat(42, materialize(NULL :: Nullable(UInt64)));
SELECT concat('42', materialize(NULL :: Nullable(UInt64)));
SELECT concat(42, materialize(NULL :: Nullable(UInt64)), materialize(NULL :: Nullable(UInt64)));
SELECT concat('42', materialize(NULL :: Nullable(UInt64)), materialize(NULL :: Nullable(UInt64)));
@ -72,3 +80,6 @@ SELECT concat(42, 144);
SELECT concat(42, 144, 255);
SELECT CONCAT('Testing the ', 'alias');
SELECT concat(); -- { serverError 42 }
SELECT concat(1); -- { serverError 42 }

View File

@ -26,7 +26,7 @@ SELECT n, source, inter FROM (
# Test INTERPOLATE with incompatible expression - should produce error
SELECT n, source, inter FROM (
SELECT toFloat32(number % 10) AS n, 'original' AS source, number as inter FROM numbers(10) WHERE number % 3 = 1
) ORDER BY n WITH FILL FROM 0 TO 11.51 STEP 0.5 INTERPOLATE (inter AS inter||'inter'); -- { serverError 44 }
) ORDER BY n WITH FILL FROM 0 TO 11.51 STEP 0.5 INTERPOLATE (inter AS reverse(inter)); -- { serverError 44 }
# Test INTERPOLATE with column from WITH FILL expression - should produce error
SELECT n, source, inter FROM (

View File

@ -117,5 +117,5 @@ SELECT arrayMap(x -> concat(concat(concat(concat(concat(toString(id), '___\0____
FROM test_table WHERE concat(concat(concat(toString(id), '___\0_______\0____'), toString(id)), concat(toString(id), NULL), toString(id));
SELECT '--';
--
SELECT arrayMap(x -> concat(toString(id), arrayMap(x -> toString(1), [NULL])), [NULL]) FROM test_table; -- { serverError 44 };
SELECT arrayMap(x -> splitByChar(toString(id), arrayMap(x -> toString(1), [NULL])), [NULL]) FROM test_table; -- { serverError 44 };
DROP TABLE test_table;

View File

@ -122,7 +122,7 @@ FROM test_table WHERE concat(concat(concat(toString(id), '___\0_______\0____'),
SELECT '--';
SELECT arrayMap(x -> concat(toString(id), arrayMap(x -> toString(1), [NULL])), [NULL]) FROM test_table; -- { serverError 44 };
SELECT arrayMap(x -> splitByChar(toString(id), arrayMap(x -> toString(1), [NULL])), [NULL]) FROM test_table; -- { serverError 44 };
DROP TABLE test_table;

View File

@ -8,4 +8,4 @@ SELECT id, value_element, value FROM test_table ARRAY JOIN [[1,2,3]] AS value_el
0 [1,2,3] 3
SELECT value_element, value FROM test_table ARRAY JOIN [1048577] AS value_element, arrayMap(x -> value_element, ['']) AS value;
1048577 [1048577]
SELECT arrayFilter(x -> notEmpty(concat(x)), [NULL, NULL]) FROM system.one ARRAY JOIN [1048577] AS elem, arrayMap(x -> concat(x, elem, ''), ['']) AS unused; -- { serverError 44 }
SELECT arrayFilter(x -> notEmpty(concat(x)), [NULL, NULL]) FROM system.one ARRAY JOIN [1048577] AS elem, arrayMap(x -> splitByChar(x, elem), ['']) AS unused; -- { serverError 44 }

View File

@ -17,7 +17,7 @@ SELECT id, value_element, value FROM test_table ARRAY JOIN [[1,2,3]] AS value_el
SELECT value_element, value FROM test_table ARRAY JOIN [1048577] AS value_element, arrayMap(x -> value_element, ['']) AS value;
SELECT arrayFilter(x -> notEmpty(concat(x)), [NULL, NULL]) FROM system.one ARRAY JOIN [1048577] AS elem, arrayMap(x -> concat(x, elem, ''), ['']) AS unused; -- { serverError 44 }
SELECT arrayFilter(x -> notEmpty(concat(x)), [NULL, NULL]) FROM system.one ARRAY JOIN [1048577] AS elem, arrayMap(x -> splitByChar(x, elem), ['']) AS unused; -- { serverError 44 }
-- { echoOff }