clickhouse_fdw
clickhouse_fdw copied to clipboard
Array insert error (HV004)
Getting an error when attempting to insert array data type.
ClickHouse (19.14.3.3):
CREATE TABLE arr_test (
ts Date,
arr Array(Nullable(String))
) ENGINE = MergeTree() PARTITION BY toYYYYMM(ts) ORDER BY (ts)
PostgreSQL (12.2):
CREATE SCHEMA click;
IMPORT FOREIGN SCHEMA "default" LIMIT TO ("arr_test")
FROM SERVER clickhouse_svr INTO click;
INSERT INTO click.arr_test SELECT now()::date, '{test}'::text[];
Message:
ERROR: cannot convert constant value to clickhouse value
HINT: Constant value data type: 1009
SQL state: HV004
Is this on binary or http protocol?
http
Sorry that the answer took so long. http for now supports only basic types for inserting, you can try binary protocol. I will add the support of more complex types to http eventually. Changing to binary is easy, just run the command ALTER SERVER server OPTIONS (SET driver 'binary'). But it requires checking with your clickhouse server. Some clickhouse versions are quite buggy.