diff --git a/tests/queries/0_stateless/02874_mutations_subcolumns.reference b/tests/queries/0_stateless/02874_mutations_subcolumns.reference deleted file mode 100644 index b702755e127..00000000000 --- a/tests/queries/0_stateless/02874_mutations_subcolumns.reference +++ /dev/null @@ -1,10 +0,0 @@ -6 1 -5 2 -4 3 -3 4 -4 ttt -5 ttt -6 ttt -{"a":"1","obj":{"k1":1,"k2":0,"k3":0}} -{"a":"3","obj":{"k1":0,"k2":0,"k3":1}} -{"a":"1","obj":{"k1":1,"k2":0,"k3":0}} diff --git a/tests/queries/0_stateless/02887_mutations_subcolumns.reference b/tests/queries/0_stateless/02887_mutations_subcolumns.reference new file mode 100644 index 00000000000..c2d6cbbd225 --- /dev/null +++ b/tests/queries/0_stateless/02887_mutations_subcolumns.reference @@ -0,0 +1,10 @@ +6 1 +5 2 +4 3 +3 4 +4 ttt +5 ttt +6 ttt +{"a":"1","obj":{"k1":1,"k2":null,"k3":null}} +{"a":"3","obj":{"k1":null,"k2":null,"k3":1}} +{"a":"1","obj":{"k1":1,"k2":null,"k3":null}} diff --git a/tests/queries/0_stateless/02874_mutations_subcolumns.sql b/tests/queries/0_stateless/02887_mutations_subcolumns.sql similarity index 85% rename from tests/queries/0_stateless/02874_mutations_subcolumns.sql rename to tests/queries/0_stateless/02887_mutations_subcolumns.sql index 54799f2481f..a01158e1b06 100644 --- a/tests/queries/0_stateless/02874_mutations_subcolumns.sql +++ b/tests/queries/0_stateless/02887_mutations_subcolumns.sql @@ -1,11 +1,8 @@ --- Tags: no-replicated-database --- This won't work in case there are misssing subcolumns in different shards - DROP TABLE IF EXISTS t_mutations_subcolumns; SET allow_experimental_object_type = 1; -CREATE TABLE t_mutations_subcolumns (id UInt64, n String, obj JSON) +CREATE TABLE t_mutations_subcolumns (id UInt64, n String, obj Object(Nullable('json'))) ENGINE = MergeTree ORDER BY id; INSERT INTO t_mutations_subcolumns VALUES (1, 'aaa', '{"k1": {"k2": "foo"}, "k3": 5}'); @@ -35,7 +32,7 @@ SELECT id, n FROM t_mutations_subcolumns; DROP TABLE IF EXISTS t_mutations_subcolumns; -CREATE TABLE t_mutations_subcolumns (a UInt64, obj JSON) +CREATE TABLE t_mutations_subcolumns (a UInt64, obj Object(Nullable('json'))) ENGINE = MergeTree ORDER BY a PARTITION BY a; INSERT INTO t_mutations_subcolumns VALUES (1, '{"k1": 1}'); @@ -45,7 +42,7 @@ INSERT INTO t_mutations_subcolumns VALUES (3, '{"k3": 1}'); ALTER TABLE t_mutations_subcolumns DELETE WHERE obj.k2 = 1; SELECT * FROM t_mutations_subcolumns ORDER BY a FORMAT JSONEachRow; -ALTER TABLE t_mutations_subcolumns DELETE WHERE obj.k1 = 0; +ALTER TABLE t_mutations_subcolumns DELETE WHERE isNull(obj.k1); SELECT * FROM t_mutations_subcolumns ORDER BY a FORMAT JSONEachRow; DROP TABLE t_mutations_subcolumns;