update test

This commit is contained in:
VanDarkholme7 2023-09-25 07:58:38 +00:00
parent db6e67073e
commit dbb5b23c2b
3 changed files with 13 additions and 16 deletions

View File

@ -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}}

View File

@ -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}}

View File

@ -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;