nicoloboschi commented on code in PR #15845:
URL: https://github.com/apache/pulsar/pull/15845#discussion_r885061090
##########
pulsar-io/jdbc/core/src/main/java/org/apache/pulsar/io/jdbc/BaseJdbcAutoSchemaSink.java:
##########
@@ -185,5 +187,35 @@ private void
fillKeyValueSchemaData(org.apache.pulsar.client.api.Schema<GenericO
+ " with KeyValueSchema");
}
}
+
+ private static Object convertAvroField(Object avroValue, Schema schema) {
+ switch (schema.getType()) {
+ case NULL:
+ case INT:
+ case LONG:
+ case DOUBLE:
+ case FLOAT:
+ case BOOLEAN:
+ return avroValue;
+ case BYTES:
+ // system default charset
+ return new String((byte[]) avroValue);
Review Comment:
From [Avro doc](https://dmg.org/pfa/docs/avro_types/index.html)
>The bytes type is referred to as "bytes" and it can accept any byte
sequence. It is therefore a generalization of a string (though neither is a
subtype of the other).
Values of type "bytes" are not arrays and cannot be changed in-place (all
PFA values are immutable).
--
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]