Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Use the timestamp logical types for timestamp and clientTimestamp #6

Open
asnare opened this issue Apr 13, 2018 · 0 comments
Open

Use the timestamp logical types for timestamp and clientTimestamp #6

asnare opened this issue Apr 13, 2018 · 0 comments
Assignees
Milestone

Comments

@asnare
Copy link
Member

asnare commented Apr 13, 2018

Avro 1.8 introduced logical types, including support for timestamps. This was done in a way that allows for backwards compatibility; clients that don't understand logical types simply see the underlying primitive type.

In our case this would mean updating the relevant lines in the schema:

{ "name": "timestamp",       "type": { "type": "long", "logicalType": "timestamp-millis" }},
{ "name": "clientTimestamp", "type": { "type": "long", "logicalType": "timestamp-millis" }},

Unfortunately we can't just turn this on due to some issue in Avro's code generation. Specifically, enabling logical types makes the generated code depend on Joda-Time. There's an open issue (addressed by apache/avro#248) that will address this, but it seems to have lost momentum.

At this point I don't think the benefit of the cleaner types is justified by extra dependency on Joda-Time; hopefully it won't be too long before this is addressed.

@asnare asnare self-assigned this Apr 13, 2018
@asnare asnare added this to the 0.10 milestone May 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant