-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fn][compute] Add support for Duration data type #28
Comments
Drafting duration logical type: 6b43217 |
With that we can add a field which is an AVRO duration to an AVRO datetime, is that correct ? |
Do you mean |
In the JDK, a Duration is an exact amount of time. So it can't be expressed in months or years because these have variable time lengths. |
Yes in general we'll need a Period based implementation, will take a look at the lib you proposed. |
The draft PR only proposes a new type called DURATION and maps to AVRO's logical duration type, the date utility methods for adding will need to be supported (the plus for example which the dateadd methods relies on understands absolute unit in time but not periods) |
I'm starting to realize that the Avro logical type called Duration is actually a Period in java terms... |
Yes it is. |
Support ISO 8601 Duration type: https://en.m.wikipedia.org/wiki/ISO_8601#Durations
In Avro, this is supported as built in logical type: https://avro.apache.org/docs/1.10.2/spec.html#Duration
Few notes:
PnDTnHnMn.nS
(notice no months or years)PnYnMnD
(notice no hours, min, seconds, etc)So if we wanna support a full ISO8601 duration format (like
PnYnMnDTnHnMnS
) we can use:Also Avro doesn't have the Duration logical type in their the API impl (although it is documented since Avro 2.8)
The text was updated successfully, but these errors were encountered: