[
https://issues.apache.org/jira/browse/AVRO-739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Doug Cutting updated AVRO-739:
------------------------------
Attachment: AVRO-739.patch
Here's a patch that changes Java's specific & reflect to serialize and
deserialize java.util.Date using the following schema:
{code}
{"type":"record","name":"org.apache.avro.Datetime","fields":[{"name":"ms","type":"long"}]}"
{code}
This is implemented by adding a custom encodings feature to SpecificData that
permits a class to be mapped to a record schema. I had to modify reflect's
CustomEncoding API. To make this back-compatible, we'll perhaps need to copy
that API into specific, so this is not yet ready for commit.
Do folks like this approach? We proclaim a language-independent schema for
datetimes, then implementations can choose to map this into a native type or
not.
I did not extend Generic, since I believe there is value in keeping Generic's
representations a closed set of classes. This permits applications to be sure
they can process any data read using Generic. I might be convinced to add this
to Generic, but that would make it an incompatible change.
> Add Date/Time data types
> ------------------------
>
> Key: AVRO-739
> URL: https://issues.apache.org/jira/browse/AVRO-739
> Project: Avro
> Issue Type: New Feature
> Components: spec
> Reporter: Jeff Hammerbacher
> Attachments: AVRO-739.patch
>
>
--
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