troubleshooting

How to define epoch seconds in an Avro schema?

I'm working with Avro data in a Kafka topic and encountered an error when querying a source due to the way I've defined the created_at field as epoch seconds. What is the proper way to specify epoch seconds in an Avro schema?

Ma

Mark Needham

Asked on Apr 21, 2023

Avro doesn't have a logical type for second precision, so you can use int or long without a logical type and later convert it to a timestamp in your processing system. In my case, I changed the precision to milliseconds (time-millis) and updated the schema accordingly, which resolved the issue.

Apr 21, 2023Edited by