clintropolis commented on a change in pull request #7258: #5884 Avro Maps can't 
be flattened in Kafka Indexing on master
URL: https://github.com/apache/incubator-druid/pull/7258#discussion_r265322105
 
 

 ##########
 File path: 
extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/GenericAvroJsonProvider.java
 ##########
 @@ -137,7 +138,15 @@ public void setArrayIndex(final Object o, final int i, 
final Object o1)
       throw new UnsupportedOperationException();
     }
   }
-
+  
+  private Object transformAvroMapKey(String keyToTransform, Map avroMapObj) {
+    Object key = avroMapObj.keySet().iterator().next();
 
 Review comment:
   Will this work if the map is empty? 
   
   It might be more straightforward to just do something like this in 
`getMapValue`
   
   ```
   ...
   } else if (o instanceof Map) {
     final Map theMap = (Map) o;
     if (theMap.containsKey(s)) {
       return theMap.get(s);
     } else {
       final Utf8 utf8Key = new Utf8(s);
       return theMap.get(utf8Key);
     }
   }
   ...
   ```

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to