You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/30 19:56:59 UTC

[GitHub] [pulsar] eolivelli commented on a diff in pull request #15845: [improve][connector] JDBC sinks: support Avro specific datatypes

eolivelli commented on code in PR #15845:
URL: https://github.com/apache/pulsar/pull/15845#discussion_r885055797


##########
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:
   This looks wrong. In jdbc we have the array type. We should use that



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org