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] [Commented] (AVRO-1402) Support for DECIMAL primitive type
Date Thu, 20 Mar 2014 18:26:57 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13942095#comment-13942095
] 

Doug Cutting commented on AVRO-1402:
------------------------------------

For greatest interoperability we might use strings instead of bytes, with scientific notation.
 This would be bigger and slower to parse but would also greatly simplify implementation and
usability.  For example, so far as I can tell, Python's decimal facility does not support
a binary constructor, so we'd need to (carefully) implement our own there.  C# has a binary
constructor, but it's an array of ints, not bytes.  And so on.

Also:
 - GenericData#isString() or isBytes() should handle subtypes too, so unions will work;
 - GenericData#induce() should infer decimal subtypes;
 - ReflectData#createSchema should infer decimal subtypes.

With regards to the incompatiblity, I don't see how this breaks an application that's currently
works.  Another part of the application would need to be updated to generate data in the new
format, so the Hive part would need to be updated to handle that change, not because of Avro
changes alone.  The Avro feature would permit an incompatible change, but wouldn't create
it.  Or am I missing something?

> Support for DECIMAL primitive type
> ----------------------------------
>
>                 Key: AVRO-1402
>                 URL: https://issues.apache.org/jira/browse/AVRO-1402
>             Project: Avro
>          Issue Type: New Feature
>    Affects Versions: 1.7.5
>            Reporter: Mariano Dominguez
>            Priority: Minor
>              Labels: Hive
>         Attachments: AVRO-1402.patch
>
>
> Currently, Avro does not seem to support a DECIMAL type or equivalent.
> http://avro.apache.org/docs/1.7.5/spec.html#schema_primitive
> Adding DECIMAL support would be particularly interesting when converting types from Avro
to Hive, since DECIMAL is already a supported data type in Hive (0.11.0).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message