mymarilyn / clickhouse-driver

ClickHouse Python Driver with native interface support
https://clickhouse-driver.readthedocs.io
Other
1.21k stars 212 forks source link

Support the new JSON type #460

Open tahayk opened 1 week ago

tahayk commented 1 week ago

Describe the bug I'm testing the new JSON data type introduced by ClickHouse v24.8, but unfortunately I keep getting this error: clickhouse_driver.errors.UnknownTypeError: Code: 50. Unknown type JSON To Reproduce

CREATE TABLE test
(
    project_id UInt16,
    properties JSON,
    timestamp  DateTime64(6, 'UTC')
) ENGINE = Memory;

INSERT INTO test(project_id, properties, timestamp)
VALUES (1, '{
  "a": 22,
  "b": "lorem"
}', now64());

import clickhouse_driver

ch_client = clickhouse_driver.Client(host="",
                                     database="",
                                     user="",
                                     password="",
                                     port="")

result = ch_client.execute("SELECT * FROM test;")

Expected behavior I should be able to get data.

Versions

jpfortune commented 3 days ago

I'm also running into this issue!