-
-
Notifications
You must be signed in to change notification settings - Fork 141
Avro logical type support for Date/Time types #132
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
Comments
Great! I wish I had good pointers to give, but I don't really have much. Perhaps one starting point could be to first document here (or separate issue) of how these are represented in Avro: physical encoding, and then id(s) used for logical type. Jackson module has its representation of Avro schema, too, and the next step could be to import logical type information in some form. Although it is open ended in Avro, Jackson side could/should probably use enums to add support on case-by-case basis, once there is clear idea of how to support specific types. When metadata exists, I think decoders would then be able to handle mapping so that in cases where native Avro type would not work, decoder/parser can change how it is expressed at token level. (*) actually, for But with that, there are 2 things that can be done:
Come to think of it, sometimes additions as Does this help? I would be excited to get improved support here. |
This is helpful. I'm really familiar on the Avro side. The Jackson side is where I could use help navigating. BTW thanks for this project. It's one of the under appreciated gems of open source. |
@jcustenborder ah. Excellent! I haven't been following up things that much on Avro side, so while I was aware of logical types, I don't know how they are actually used. But I do know Jackson side of mappings quite well. I am also excited about making this format module more useful, and extending support to logical types seems like a good thing. Your expertise should be very useful with that. One caveat wrt current state of things: |
@cowtowncoder I believe you meant to tag @jcustenborder |
@JacekLach lol. Thanks. Yes. Stupid github auto-completion. |
@cowtowncoder Is there any reason NonBSGenericDatumWriter is public? I think I'm going to need to change it's constructor. Should I implement another class with LogicalType support or should I try to use this one? |
@jcustenborder It is not meant to be used by non-core package itself, so the only reason would be if it needs to be accessed from within another package. If you need to change for patch version (which I think is the idea here), please leave old one deprecated for 2.9, to be removed from 3.0 (master). I think using this one is fine; ideally we wouldn't need it, so if it turns out newer versions of avro stdlib don't require it, all the better. But you do not need to create separate one just wrt backwards compatibility. |
Hi @cowtowncoder , I tried to do this : A sample POJO :
The generated schema with Jackson :
But writing a value with Jackson fails :
Error :
After reading issues : I don't understand if you support this kind of schemas or not ? Am I doing something wrong ? |
Is this with version 2.10.3? There is also one change to behavior of schema generation in 2.11, so 2.11.0.rc1 (2.11.0 will be released very soon) might have differing handling. |
2.10.3 yes |
Hi there :)! I there still an interest to add What about extending
I use this solution with |
@MichalFoksa sounds like possible nice incremental improvement? Could you please file a separate issue for this specific aspect as there are multiple things that could be improved, and schema generation is one of areas. This issue can remain open for the general issue of improved logical type support. |
Ok, so, #283 added support for some of |
Should now be implemented via combination of issues/PRs (like #542) to be resolved in 2.19.0 release. |
I'm interested in helping out on this one. Are there any pointers you could give me getting started? I'm thinking about adding support for these logical types.
#25
The text was updated successfully, but these errors were encountered: