Is there a way to distinguish between inserted values and values added by clickhouse in JSON type ? #62235
-
Hello Problem is that clickhouse adds fields with values to previously saved objects if I save a new object with additional fields. SET allow_experimental_object_type=1;
CREATE TABLE test_json (obj JSON) ENGINE = MergeTree ORDER BY tuple();
INSERT INTO test_json FORMAT JSONEachRow {"obj": {"key1": 1}};
INSERT INTO test_json FORMAT JSONEachRow {"obj": {"key1": 1, "key2": 2}};
SELECT obj FROM test_json FORMAT JSONEachRow SETTINGS output_format_json_named_tuples_as_objects=1; Output:
Is there a way to distinguish values that were inserted with the query and values added by clickhouse ? Or maybe there is an option to save such values as NULL? |
Beta Was this translation helpful? Give feedback.
Answered by
avelychko12
May 1, 2024
Replies: 1 comment 1 reply
-
Try to use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Derianer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try to use
Object(Nullable('json'))
type instead ofJSON