Skip to content

Commit 0cb21ed

Browse files
committed
test with setting explicitly disabled and enabled
1 parent afbc938 commit 0cb21ed

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
1 [['aaa','ccc']] [['bbb','']] [[0,0]] ['']
22
2 [['','']] [['ddd','']] [[10,20]] ['foo']
3+
1 [['aaa','ccc']] [['bbb','']] [[0,0]] ['']
4+
2 [['','']] [['ddd','']] [[10,20]] ['foo']
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
SET allow_experimental_object_type = 1;
2+
3+
-- Test with the setting being disabled
24
DROP TABLE IF EXISTS t_json_complex;
35
CREATE 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
710
INSERT 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
1215
SELECT 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

Comments
 (0)