avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taras Bobrovytsky (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AVRO-1895) DeepCopy does not work with logical types
Date Thu, 04 Aug 2016 19:35:20 GMT
Taras Bobrovytsky created AVRO-1895:

             Summary: DeepCopy does not work with logical types
                 Key: AVRO-1895
                 URL: https://issues.apache.org/jira/browse/AVRO-1895
             Project: Avro
          Issue Type: Improvement
    Affects Versions: 1.8.1
            Reporter: Taras Bobrovytsky

AvroSchema is taken from a compiled avsc file which contains a decimal field.

AvroSchema.Builder builder = AvroSchema.newBuilder();
BigDecimal bd = new BigDecimal(new BigInteger("155"), 3);
AvroSchema source = builder.build();

//This line causes an exception
AvroSchema.Builder builder1 = AvroSchema.newBuilder(source);

InvocationTargetException: java.math.BigDecimal cannot be cast to java.nio.ByteBuffer

The same failure happens with GenericData as well:
GenericRecord copy = GenericData.get().deepCopy(AvroSchema.getClassSchema(), source);

This message was sent by Atlassian JIRA

View raw message