How do I use logical types in Avro IDL? -


i tried following code in avro idl references logical type timestamp-millis , doesn't work.

is there import required use logical types in avro idl? or logical types not useable, , need use primitive type (long in case) instead?

protocol test {     record test {         timestamp-millis time;     } } 

results in:

exception in thread "main" org.apache.avro.compiler.idl.parseexception: undefined name 'timestamp', @ line 3, column 9 

this works of course:

protocol test {     record test {         long time;     } } 

you can use generic annotation:

protocol test {     record test {         @logicaltype("timestamp-millis")         long time;     } } 

there's shorthand can use timestamp-millis , handful of other logical types (the documentation hasn't been released yet, see here full list of aliases):

protocol test {     record test {         timestamp_ms time;     } } 

Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -