Closed jmccance closed 3 years ago
When serializing an Avro message with fields that use the timestamp-millis or timestamp-micros logical types, the AvroSchemaCoercerer truncates Time types down to seconds since epoch instead of millis.
timestamp-millis
timestamp-micros
Example Schema
{ "namespace": "my.company", "name": "Payload", "type": "record", "fields": [ { "name": "timestamp-millis-field", "type": "long", "logicalType": "timestamp-millis" } ] }
Message Hash
{ 'timestamp-millis-field' => Time.utc(2020, 11, 12, 13, 14, 15, 999000) }
Expected Output
{ "timestamp-millis-field": 1605186855999 // 2020-11-12T13:14:15.999Z }
Actual Output
{ "timestamp-millis-field": 1605186855 // 1970-01-19T07:53:06.000Z }
When serializing an Avro message with fields that use the
timestamp-millis
ortimestamp-micros
logical types, the AvroSchemaCoercerer truncates Time types down to seconds since epoch instead of millis.Example Schema
Message Hash
Expected Output
Actual Output