avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Kovalev (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-739) Add Date/Time data types
Date Fri, 01 Aug 2014 09:17:40 GMT

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

Dmitry Kovalev commented on AVRO-739:

Hi Tom,

So basically you suggest to "mix" type and encoding, and have a logicalType for each combination,
correct? From pure design perspective, I still think my approach is better because it clearly
separates the "what it is" from the "how it is represented", and allows for more powerful
mapping logic in e.g. codegen scenario. 

Other than that, I agree that in general the single-attribute approach is more or less equivalent,
so if it gets more "votes" here than my original proposition, then I am happy to adopt it.
Even then, I would definitely changes some of the type names you have suggested.

For example:
{code} { "type": "int", "logicalType": "date" } // a bit vague - what exactly is a date here?
{code} - this one is vague as it doesn't tell you much about how the date is represented in
the int - presicely the thing we want to address with the attributes. I would go for smth
like {code} { "type": "int", "logicalType": "days-unix-epoch" } {code}

Likewise, {code} { "type": "long", "logicalType": "timestamp-millis" } //what is the epoch
from which the millis are counted? {code} doesn't tell you what is the epoch you count from,
I know in opensource context one can assume it is unix epoch, but we also have some databases
which use 1 January 1900, Excel/OLE automation uses 30 December 1899 etc - so more generally
I think it would improve clarity a lot if it was  {code} { "type": "long", "logicalType":
"millis-unix-epoch" } {code} as I suggested, or smth similar.

How problematic would it be to rename stuff in your project? Or could you support both sets
of names - one for backward compatibility, one to conform to whatever will be agreed as Avro

Doug, what is your opinion, both on single attribute vs two attributes and on the naming stuff?

> 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 was sent by Atlassian JIRA

View raw message