bpereto opened a new issue, #20247:
URL: https://github.com/apache/pulsar/issues/20247

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Version
   
   Rocky Linux 8
   Pulsar 2.11.1
   
   ### Minimal reproduce step
   
   - Add ProtobufNative Schema to topic with "bytes" field.
   - Use Pulsar IO JDBC Clickhouse Sink
   
   ### What did you expect to see?
   
   Event is sinked/inserted to clickhouse.
   
   ### What did you see instead?
   
   ```
   2023-05-07T13:06:54,039+0200 [pool-2-thread-1] ERROR 
org.apache.pulsar.io.jdbc.JdbcAbstractSink - Update count 0 not match total 
number of records 1005
   2023-05-07T13:06:54,098+0200 [pool-2-thread-1] ERROR 
org.apache.pulsar.io.jdbc.JdbcAbstractSink - Got exception 
   java.lang.Exception: Not support value type, need to add it. class 
com.google.protobuf.ByteString$LiteralByteString
           at 
org.apache.pulsar.io.jdbc.BaseJdbcAutoSchemaSink.setColumnValue(BaseJdbcAutoSchemaSink.java:186)
 ~[pulsar-io-jdbc-core-2.11.1.jar:?]
           at 
org.apache.pulsar.io.jdbc.BaseJdbcAutoSchemaSink.bindValue(BaseJdbcAutoSchemaSink.java:81)
 ~[pulsar-io-jdbc-core-2.11.1.jar:?]
           at 
org.apache.pulsar.io.jdbc.JdbcAbstractSink.flush(JdbcAbstractSink.java:247) 
~[pulsar-io-jdbc-core-2.11.1.jar:?]
           at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
           at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
           at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
 ~[?:?]
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) 
~[?:?]
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) 
~[?:?]
           at java.lang.Thread.run(Thread.java:833) ~[?:?]
   ```
   
   ### Anything else?
   
   As i'm aware of, clickhouse supports "ByteString": 
https://clickhouse.com/docs/en/sql-reference/data-types/fixedstring
   
   Maybe adding `.setBytes` does the job, but i'm not aware how to build the 
pulsar io `.nar` files to test it. How do I build the connectors?
   
   
https://github.com/apache/pulsar/blob/master/pulsar-io/jdbc/core/src/main/java/org/apache/pulsar/io/jdbc/BaseJdbcAutoSchemaSink.java#L170
   ```
           } else if (value instanceof ByteArray) {
               statement.setBytes(index, (ByteArray) value);
   ```
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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]

Reply via email to