[
https://issues.apache.org/jira/browse/AVRO-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13968559#comment-13968559
]
Ryan Blue commented on AVRO-1402:
---------------------------------
bq. I think we should allow writing unspecified logical types, so that new
logical types can be implemented in the application when the spec is updated
without upgrading the library.
For now, I've just updated the spec for how readers should behave, not writers.
This will probably depend on the level of support we end up building into avro
vs. on top of the format. Right now with no implementation support, there is
little need to update the library just to get a new version of the spec with a
type. But in the future, we may have consistency checks on logical types (like
the parquet implementation is adding) so we can revisit this at that point.
bq. I suggest we either have a default value (such as 10) as we do for scale,
or make precision a required attribute
I think the most reasonable implementation for a default precision is either 9
(fits in 4 bytes) or 18 (fits in 8 bytes), or the maximum number of digits that
can be stored in a fixed array. (I think MySQL's default is 10 because it is
based on a different encoding.) Because the maximum precision varies with the
length of the fixed array, but that length can't be evolved, I think that this
should be required rather than defaulted. That way, users must specify the
expected maximum precision and we can validate that their expectation is
correct, before writing data.
> 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.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)