avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1146) Can't use ReflectData to get schema when the type has a BigDecimal or BigInteger field
Date Wed, 05 Sep 2012 19:19:07 GMT

     [ https://issues.apache.org/jira/browse/AVRO-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Doug Cutting updated AVRO-1146:

    Attachment: AVRO-1146.patch

Here's a version that adds the ability to declare already-defined classes as stringable and
that pre-defines BigDecimal and BigInteger this way.

Strings are not an ideal representation for these as they'll not be sorted correctly, but
it's perhaps better than not serializing them at all.
> Can't use ReflectData to get schema when the type has a BigDecimal or BigInteger field
> --------------------------------------------------------------------------------------
>                 Key: AVRO-1146
>                 URL: https://issues.apache.org/jira/browse/AVRO-1146
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>              Labels: newbie
>         Attachments: AVRO-1146.patch, AVRO-1146.patch, TestReflectDataWithBigDecimal.java
> I'm using avro Reflection API for a specific use case and I have a bug where if the object
I'm trying to get the Schema for has a field of type BigDecimal. Because BigDecimal extends
java.lang.Number, we try to create a primitive schema for it but fail doing so with the following
> *{{org.apache.avro.AvroRuntimeException: Not a Specific class: class java.math.BigDecimal}}*
> I'm attaching a unit test that shows the problem with a basic type that has a single
BigDecimal field.
> This basically also applied to all subclasses of java.lang.Number that are not primitives.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message