You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Scott Carey (JIRA)" <ji...@apache.org> on 2013/09/06 21:12:55 UTC

[jira] [Commented] (AVRO-739) Add Date/Time data types

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

Scott Carey commented on AVRO-739:
----------------------------------

There are two types of interest, one that is a UTC coordinate -- a long like this one without any timezone or other 'date' information, and one that is a date-time, and therefore must contain timezone information.   The latter would probably best be some ISO8601 subset.  The former is a long (which is only 5 bytes for 'today', if in ms since 1970 UTC. 

We should decide on the names for these two things now.  I think that "Datetime" is probably the thing that includes dates, times, and therefore time zones.   The pure long universal time coordinate is perhaps "Instant" or "timestamp" -- it has nothing to do with dates except that in Java the typical class used to hold such an instant is Date (or a long).


I wish these were fundamental Avro primitive types.  To work well with database systems we need these two types.   The syntax as a special Record in the schema is klunky, but more backwards compatible.   If we assume that some version of Avro in the future requires all language implementations to support new primitive types for these, how would we migrate from this klunky form to "type":"instant" ?

This proposal isn't all that backwards compatible:  If Python doesn't know what "org.apache.avro.Datetime" is, it won't be able to decode the type.   Perhaps {"type":"instant"} is better -- other than colliding with existing schemas with a custom type of that name.  Perhaps {"type":"org.apache.avro.instant"}  Rather than the record with nested field?
                
> 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