avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Blue (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1402) Support for DECIMAL type
Date Wed, 16 Apr 2014 01:14:17 GMT

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

Ryan Blue updated AVRO-1402:
----------------------------

    Attachment: AVRO-1402-logical-type-spec-6.patch

Here is a patch with a basic implementation of the logical type enforcement in the Schema.
It isn't quite done, but it is working and I wanted to get something out for feedback as soon
as possible. Please let me know if this doesn't look right!

Changes:
* Add a LogicalType class, with "decimal" and "fromJsonNode" static factory methods
* Add setLogicalType and getLogicalType to Schema. The setter calls "validate" and only sets
a logical type if it is valid for the schema.
* Update the parsing code to check for "logicalType" and use "fromJsonNode" to deserialize.
Falls back to property representation if invalid.
* Add private method "writeLogicalType" to Schema and call when properties are written to
ensure logical types are in written Schemas.

Still to do:
* Update equals and hashCode
* Testing

> Support for DECIMAL 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
>            Assignee: Tom White
>            Priority: Minor
>              Labels: Hive
>             Fix For: 1.7.7
>
>         Attachments: AVRO-1402-logical-type-spec-2.patch, AVRO-1402-logical-type-spec-3.patch,
AVRO-1402-logical-type-spec-4.patch, AVRO-1402-logical-type-spec-5.patch, AVRO-1402-logical-type-spec-6.patch,
AVRO-1402-logical-type-spec.patch, AVRO-1402.patch, AVRO-1402.patch, AVRO-1402.patch, AVRO-1402.patch,
UnixEpochRecordMapping.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