estebanz01 commented on issue #11457:
URL: https://github.com/apache/pulsar/issues/11457#issuecomment-1806002113
I managed to setup the following Avro schema and it still not able to render
data, everything is `null`:
```json
{
"name": "clickhouse-schema",
"type": "AVRO",
"schema": "{\"type\": \"record\", \"namespace\":
\"iot\",\"name\":\"exampleAvro\",\"fields\":[{\"name\":
\"device_name\",\"type\": \"string\", \"default\": \"\"},{\"name\":
\"data_content\", \"type\":{\"type\":\"map\", \"values\": \"string\",
\"default\": {}}},{\"name\": \"device_properties\", \"type\":{ \"type\":
\"map\", \"values\": \"string\", \"default\": {}}},{\"name\":\"datetime_info\",
\"type\": \"string\", \"default\": \"\"}, {\"name\": \"topicName\", \"type\":
\"string\", \"default\": \"\"}]}",
"properties": {
"__jsr310ConversionEnabled": "false"
}
}
```
Running the sink in `localrun` mode I get the following error:
```java
023-11-10T10:56:24,865-0500 [pool-3-thread-1] ERROR
org.apache.pulsar.io.jdbc.JdbcAbstractSink - Got exception Cannot set null to
non-nullable column #1 [datetime_info String] after 0 ms, failing 200 messages
java.sql.SQLException: Cannot set null to non-nullable column #1
[datetime_info String]
at
com.clickhouse.jdbc.SqlExceptionUtils.clientError(SqlExceptionUtils.java:73)
~[clickhouse-jdbc-0.4.6-all.jar:clickhouse-jdbc 0.4.6 (revision: dd91e17)]
at
com.clickhouse.jdbc.internal.InputBasedPreparedStatement.addBatch(InputBasedPreparedStatement.java:340)
~[clickhouse-jdbc-0.4.6-all.jar:clickhouse-jdbc 0.4.6 (revision: dd91e17)]
at
com.clickhouse.jdbc.internal.InputBasedPreparedStatement.executeAny(InputBasedPreparedStatement.java:113)
~[clickhouse-jdbc-0.4.6-all.jar:clickhouse-jdbc 0.4.6 (revision: dd91e17)]
at
com.clickhouse.jdbc.internal.InputBasedPreparedStatement.execute(InputBasedPreparedStatement.java:312)
~[clickhouse-jdbc-0.4.6-all.jar:clickhouse-jdbc 0.4.6 (revision: dd91e17)]
at
org.apache.pulsar.io.jdbc.JdbcAbstractSink.flush(JdbcAbstractSink.java:289)
~[pulsar-io-jdbc-core-3.1.1.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) ~[?:?]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
```
here's my clickhouse table definition:
```SQL
SET allow_experimental_object_type = 1;
CREATE TABLE mqtt.pulsar_data(datetime_info String, topicName String,
data_content JSON, device_properties JSON, device_name String) ENGINE =
MergeTree ORDER BY(topicName, datetime_info);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]