Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2649#discussion_r213566979
  
    --- Diff: 
store/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java ---
    @@ -134,6 +139,38 @@ private Object avroFieldToObject(Schema.Field 
avroField, Object fieldValue) {
             // also carbon internally needs float as double
             out = Double.parseDouble(fieldValue.toString());
             break;
    +      case MAP:
    +        // Note: Avro object takes care of removing the duplicates so we 
should not handle it again
    +        // Map will be internally stored as Array<Struct<Key,Value>>
    +        Map mapEntries = (HashMap) fieldValue;
    +        Object[] arrayMapChildObjects = new Object[mapEntries.size()];
    +        if (!mapEntries.isEmpty()) {
    +          Iterator iterator = ((HashMap) fieldValue).entrySet().iterator();
    --- End diff --
    
    Use `mapEntries` directly instead of typecast again


---

Reply via email to