nicoloboschi opened a new pull request, #15430: URL: https://github.com/apache/pulsar/pull/15430
### Motivation Avro native objects for Arrays and Maps are not supported by the sink. If you try to use a Java POJO with a java.util.List/java.util.Set field with Avro Schema, you get: ``` 022-04-26T11:56:51.477776276Z Caused by: java.lang.ClassCastException: class org.apache.avro.generic.GenericData$Array cannot be cast to class [Ljava.lang.Object; (org.apache.avro.generic.GenericData$Array is in unnamed module of loader 'app'; [Ljava.lang.Object; is in module java.base of loader 'bootstrap') 2022-04-26T11:56:51.477782027Z at org.apache.pulsar.io.elasticsearch.JsonConverter.toJson(JsonConverter.java:90) ~[?:? ``` For java.util.Map ``` ERROR org.apache.pulsar.io.elasticsearch.ElasticSearchSink - write error: 2022-04-26T12:03:34.776219894Z java.lang.IllegalArgumentException: Error while converting a value of type class java.util.HashMap to a MAP: java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast to class java.lang.String (org.apache.avro.util.Utf8 is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap') ``` ### Modifications * Handle GenericData.Array instances * Handle Map with UUID as entry key - [x] `no-need-doc` -- 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]
