You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to insert a unix timestamp as a DateTime.
Kafka Connect does not have a DateTime value. How should you insert a DateTime value using the Clickhouse connector?
One way would be to insert string/int/long timestamps:
However this does not work with the Clickhouse connector, the following error is logged when trying to map a string/int field into a DateTime column:
loc_clickhouse_sink | [2023-02-13 10:15:23,434] ERROR [clickhouse-sink-13|task-1] Table column name [timestamp] type [NONE] is not matching data column type [STRING] (com.clickhouse.kafka.connect.sink.db.ClickHouseWriter:154)
The connector could allow mapping ints/longs/string to DateTime columns. What are your thoughts on this?
Workaround: I'm aware that with the current version of the connector (v0.0.8) I can use MATERIALIZED columns to map timestamps to a DateTime column:
create table `dev.thilo.materialize_test` (timestamp Int64, date DateTime MATERIALIZED toDateTime(timestamp), also_timestamp Int64 ALIAS timestamp) ENGINE = TinyLog;
More details:
Full Error:
loc_clickhouse_sink | [2023-02-13 10:15:23,434] ERROR [clickhouse-sink-13|task-1] Table column name [timestamp] type [NONE] is not matching data column type [STRING] (com.clickhouse.kafka.connect.sink.db.ClickHouseWriter:154)
...
loc_clickhouse_sink | org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.
loc_clickhouse_sink | at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:611)
loc_clickhouse_sink | at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:333)
loc_clickhouse_sink | at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:234)
loc_clickhouse_sink | at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:203)
loc_clickhouse_sink | at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:188)
loc_clickhouse_sink | at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:243)
loc_clickhouse_sink | at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
loc_clickhouse_sink | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
loc_clickhouse_sink | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
loc_clickhouse_sink | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
loc_clickhouse_sink | at java.base/java.lang.Thread.run(Thread.java:829)
loc_clickhouse_sink | Caused by: java.lang.RuntimeException
loc_clickhouse_sink | at com.clickhouse.kafka.connect.sink.db.ClickHouseWriter.doInsertRawBinary(ClickHouseWriter.java:267)
loc_clickhouse_sink | at com.clickhouse.kafka.connect.sink.db.ClickHouseWriter.doInsert(ClickHouseWriter.java:128)
loc_clickhouse_sink | at com.clickhouse.kafka.connect.sink.processing.Processing.doInsert(Processing.java:45)
loc_clickhouse_sink | at com.clickhouse.kafka.connect.sink.processing.Processing.doLogic(Processing.java:102)
loc_clickhouse_sink | at com.clickhouse.kafka.connect.sink.ProxySinkTask.put(ProxySinkTask.java:80)
loc_clickhouse_sink | at com.clickhouse.kafka.connect.sink.ClickHouseSinkTask.put(ClickHouseSinkTask.java:60)
loc_clickhouse_sink | at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:581)
I need to insert a unix timestamp as a DateTime.
Kafka Connect does not have a DateTime value. How should you insert a DateTime value using the Clickhouse connector?
One way would be to insert string/int/long timestamps:
However this does not work with the Clickhouse connector, the following error is logged when trying to map a string/int field into a DateTime column:
The connector could allow mapping ints/longs/string to DateTime columns. What are your thoughts on this?
Workaround: I'm aware that with the current version of the connector (v0.0.8) I can use MATERIALIZED columns to map timestamps to a DateTime column:
More details:
Full Error:
Avro schema:
Connector:
The text was updated successfully, but these errors were encountered: