-
-
Save tom-clickhouse/c52ab757aca15723427032f305c73656 to your computer and use it in GitHub Desktop.
JSON type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET allow_experimental_json_type = 1; | |
CREATE OR REPLACE TABLE test | |
( | |
c JSON(a.b UInt32, a.c String) | |
) | |
ENGINE = MergeTree | |
ORDER BY tuple() | |
SETTINGS | |
min_bytes_for_wide_part = 1, | |
min_rows_for_wide_part = 1; | |
INSERT INTO test VALUES | |
('{"a":{"b":10, "c":"str1", "d":42 }}'), | |
('{"a":{"b":20, "c":"str2", "d":43 }}'), | |
('{"a":{"b":30, "c":"str3", "e":44 }}'), | |
('{"a":{"b":40, "c":"str4", "d":"foo", "e":"baz"}}'), | |
('{"a":{"b":50, "c":"str5", "d":[23, 24] }}'), | |
('{"a":{"b":60, "c":"str6", "d":{"e":"bar"}, "e":45 }}'); | |
SELECT * FROM test; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment