11SET allow_experimental_object_type = 1 ;
2+
3+ -- Test with the setting being disabled
24DROP TABLE IF EXISTS t_json_complex;
35CREATE TABLE t_json_complex (id UInt32, arr Array(Object(' json' )))
4- ENGINE = MergeTree ORDER BY id;
6+ ENGINE = MergeTree ORDER BY id
7+ SETTINGS write_marks_for_substreams_in_compact_parts= 0 ;
58
69-- Insert data with nested arrays inside JSON objects
710INSERT INTO t_json_complex FORMAT JSONEachRow {" id" : 1 , " arr" : [{" k1" : [{" k2" : " aaa" , " k3" : " bbb" }, {" k2" : " ccc" }]}]}
@@ -10,3 +13,20 @@ INSERT INTO t_json_complex FORMAT JSONEachRow {"id": 2, "arr": [{"k1": [{"k3": "
1013
1114-- This query used to crash the server
1215SELECT id, arr .k1 .k2, arr .k1 .k3, arr .k1 .k4, arr .k5 .k6 FROM t_json_complex ORDER BY id;
16+ DROP TABLE t_json_complex;
17+
18+ -- Now test with the setting explicitly enabled
19+ DROP TABLE IF EXISTS t_json_complex_compact_parts;
20+ CREATE TABLE t_json_complex_compact_parts (id UInt32, arr Array(Object(' json' )))
21+ ENGINE = MergeTree ORDER BY id
22+ SETTINGS write_marks_for_substreams_in_compact_parts= 1 ;
23+
24+ -- Insert data with nested arrays inside JSON objects
25+ INSERT INTO t_json_complex_compact_parts FORMAT JSONEachRow {" id" : 1 , " arr" : [{" k1" : [{" k2" : " aaa" , " k3" : " bbb" }, {" k2" : " ccc" }]}]}
26+
27+ INSERT INTO t_json_complex_compact_parts FORMAT JSONEachRow {" id" : 2 , " arr" : [{" k1" : [{" k3" : " ddd" , " k4" : 10 }, {" k4" : 20 }], " k5" : {" k6" : " foo" }}]}
28+
29+ -- This query used to crash the server
30+ SELECT id, arr .k1 .k2, arr .k1 .k3, arr .k1 .k4, arr .k5 .k6 FROM t_json_complex_compact_parts ORDER BY id;
31+ DROP TABLE t_json_complex_compact_parts;
32+
0 commit comments