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

Xuefu Zhang commented on AVRO-1402:
-----------------------------------

Since the logical type approach proposed here isn't really providing a native 
type for decimal in Avro, it seems a little stretching when trying to 
accommodate decimal concepts. I understand the intention of providing 
interoperability between applications for decimal data, but from the point of 
view at storage layer, it shouldn't care. All it needs to provide the 
capability of annotating the binary type to the application so that the 
application can annotate whatever it needs, such as decimal/precision for 
decimal, timezone for datatime, etc. It's up to the application to do any 
validation. This certainly leaves interoperability to applications, but it 
relieves Avro from enforcing whatever it cannot guarantee anyway.

Thus, I'd think that there are two possible approaches, one at each end:
1. provide native type decimal in Avro, which can provide interoperability.
2. provide just annotation capability for binary type, and leaves everything 
else to the application.

The proposal here seems sit in the middle of the two, which makes me think 
twice when deciding if it's the best.

> 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.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)

Reply via email to