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

    https://github.com/apache/carbondata/pull/2671#discussion_r213915304
  
    --- Diff: 
store/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java ---
    @@ -213,6 +218,225 @@ private Object avroFieldToObject(Schema.Field 
avroField, Object fieldValue) {
             }
             out = new ArrayObject(arrayChildObjects);
             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
    +        if (logicalType instanceof LogicalTypes.Decimal) {
    +          out = new BigDecimal(new String(((ByteBuffer) 
fieldValue).array(),
    +              CarbonCommonConstants.DEFAULT_CHARSET_CLASS));
    +          ;
    +        } else {
    +          out = fieldValue;
    --- End diff --
    
    else case handling is not required as Binary data type is not 
supported...so write a proper comment to say that only decimal logical type is 
support for avro Byte data type. Once binary data type is supported we can add 
the else block


---

Reply via email to