问题
How can we declare a simple timestamp in Avro please.
type:timestamp doesnt work. So I actually use a simple string but I want it as a timestamp. (this is my variable: 27/01/1999 08:45:34 )
Thank you
回答1:
Use Avro's logical type:
{"name":"timestamp","type": {"type": "string", "logicalType": "timestamp-millis"}
Few useful links:
Avro timestamp-millis
Avro Logical types
Hortonworks community question about Avro timestamp
来源:https://stackoverflow.com/questions/55607244/what-is-the-proper-way-to-declare-a-simple-timestamp-in-avro