"When ingesting data into a table with a JSON column with extra settings, ClickHouse won’t automatically cast the incoming data to the right type, but that will be fixed in a future version. For now, we need to define the JSON column type in our import query explicitly:"
source: https://clickhouse.com/blog/clickhouse-release-24-08#contributed-by-pavel-kruglov
I'm using ClickHouse 26.3.3.20. So it seems this hasn't been fixed yet.
DB::Exception: Type of 'value' must be JSON(max_dynamic_types=254, max_dynamic_paths=10000), not JSON
In this case, the Ch.Types.decode function should convert it to a {:json, settings} tuple, probably.
current
iex> Ch.Types.decode("JSON(max_dynamic_types=254, max_dynamic_paths=10000)")
:json
possibility
iex> Ch.Types.decode("JSON(max_dynamic_types=254, max_dynamic_paths=10000)")
{:json, [{"max_dynamic_types", 254}, {"max_dynamic_paths", 10000}]}
"When ingesting data into a table with a JSON column with extra settings, ClickHouse won’t automatically cast the incoming data to the right type, but that will be fixed in a future version. For now, we need to define the JSON column type in our import query explicitly:"
source: https://clickhouse.com/blog/clickhouse-release-24-08#contributed-by-pavel-kruglov
I'm using ClickHouse 26.3.3.20. So it seems this hasn't been fixed yet.
In this case, the
Ch.Types.decodefunction should convert it to a{:json, settings}tuple, probably.current
possibility