b-slim commented on a change in pull request #1386:
URL: https://github.com/apache/samza/pull/1386#discussion_r457599989



##########
File path: 
samza-sql/src/main/java/org/apache/samza/sql/avro/AvroRelConverter.java
##########
@@ -194,10 +194,12 @@ public static Object convertToAvroObject(Object relObj, 
Schema schema) {
             .collect(Collectors.toList());
         return avroList;
       case MAP:
-        return ((Map<String, ?>) relObj).entrySet()
-            .stream()
-            .collect(Collectors.toMap(Map.Entry::getKey,
-              e -> convertToAvroObject(e.getValue(), 
getNonNullUnionSchema(schema).getValueType())));
+        // If you ask why not using String and that is because some strings 
are Wrapped into org.apache.avro.util.Utf8
+        // TODO looking at the Utf8 code base it is not immutable, having it 
as a key is calling for trouble!
+        final Map<Object, Object> outputMap = new HashMap<>();

Review comment:
       @atoomula The code as of today does that, in fact the reason I run into 
it is because I changed to String but tested failed. To avoid making this PR a 
fix everything pr I added the comment and base fix for the null case needed by 
my work. But I agree we need to move out of Avro String especially that is is 
mutable. 




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to