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
Post a Comment