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

    https://github.com/apache/carbondata/pull/2687#discussion_r216122590
  
    --- Diff: 
store/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java ---
    @@ -198,14 +199,35 @@ private Object avroFieldToObject(Schema.Field 
avroField, Object fieldValue) {
               if (unionField.getType().equals(Schema.Type.NULL)) {
                 continue;
               }
    -          if (checkFieldValueType(unionField.getType(), fieldValue)) {
    +          // Union may not contain more than one schema with the same type,
    +          // except for the named types record,fixed and enum
    +          // hence check for schema also in case of union of multiple 
record or enum or fixed type
    +          if (checkFieldValueType(unionField.getType(), fieldValue, 
unionField)) {
                 values[j] = avroFieldToObjectForUnionType(unionField, 
fieldValue, avroField);
                 break;
               }
               j++;
             }
             out = new StructObject(values);
             break;
    +      case BYTES:
    +        // DECIMAL type is defined in Avro as a BYTE type with the 
logicalType property
    +        // set to "decimal" and a specified precision and scale
    +        // As binary type is not supported yet,value will be null
    --- End diff --
    
    We should throw unsupported data type exception for bytes. Don't store null.


---

Reply via email to