Clickhouse: Can Array<T> accept null value for JSON-like formats ?

Created on 12 Jul 2018  Â·  3Comments  Â·  Source: ClickHouse/ClickHouse

These are valid in standard JSON https://www.json.org/

{"friends":[]} 
{"friends":null}

the datatype is Array(String), it will get exceptions when consuming

CREATE TABLE IF NOT EXISTS event(
  friends Array(String)
) ENGINE = Kafka('localhost:9092', 'topic', 'group', 'JSONEachRow');

it's better if null can be deserialized as empty Array

Thank you.

comp-formats feature

Most helpful comment

It can be implemented by adding various format options.
Possible options can be null_as_default.
We also have demand for similar options in CSV, like empty_as_default.
This is also loosely related to #1130

All 3 comments

It can be implemented by adding various format options.
Possible options can be null_as_default.
We also have demand for similar options in CSV, like empty_as_default.
This is also loosely related to #1130

Now we have empty_as_default but still don't have null_as_default.

Resolved in #7215

Was this page helpful?
0 / 5 - 0 ratings