Skip to content
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

Add Support for logical duration type #98

Open
hsn10 opened this issue Aug 12, 2018 · 3 comments
Open

Add Support for logical duration type #98

hsn10 opened this issue Aug 12, 2018 · 3 comments

Comments

@hsn10
Copy link

hsn10 commented Aug 12, 2018

I need support for logical type duration.

 "fields": [
    {"name":"start","type" : {"type":"long", "logicalType":"timestamp-millis"}},
    {"name":"duration","type" : {"type":"fixed","size":12, "logicalType":"duration","name":"duration"}},

I see ticked that fixed type is not yet implemented. Can be duration type implemented without implementing fixed type first?

@julianpeeters
Copy link
Owner

I think so @hsn10. Some parts of the code path for fixed would need to be implemented, for example, in the TypeMatcher, but I don't think we'd need full support for fixed (although I'm not entirely sure).

@hsn10
Copy link
Author

hsn10 commented Aug 13, 2018

It is probably too early. I studied avro codebase and there is no converter for timestamp-micros and duration logical types. This means that schema to java generator will produce incorrect result and there is no point in implementing scala interface.

Because correct definition of duration type field is:

{"name":"duration","type" : {"type":"fixed","size":12, "logicalType":"duration"}},

which does not compile to Java files, compilator complains about missing name. If name is use then this statement is compiled into sub type.

@julianpeeters
Copy link
Owner

thanks for reporting your findings 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants