Github user KanakaKumar commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2687#discussion_r216127832
--- Diff:
store/sdk/src/main/java/org/apache/carbondata/sdk/file/AvroCarbonWriter.java ---
@@ -407,6 +423,24 @@ private Object avroFieldToObjectForUnionType(Schema
avroField, Object fieldValue
out = null;
}
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
+ if (logicalType instanceof LogicalTypes.Decimal) {
+ BigDecimal dataValue = new BigDecimal(new
BigInteger(((ByteBuffer) fieldValue).array()),
--- End diff --
Please extract logic of constructing the BigDecimal value and validation to
a separate method and reuse in both places
---