-
Notifications
You must be signed in to change notification settings - Fork 123
Open
Description
Ran into this error deserializing Joda DateTime into an Avro model:
java.lang.Long cannot be cast to org.joda.time.DateTime
was able to serialize a record with this value: {"name": "eventTime", "type": {"type": "long", "logicalType": "timestamp-millis"}}, but calling injection.invert(the serialized byte[]).get() throws that error.
My injection object :
private static Injection<MyModel, byte[]> injection = SpecificAvroCodecs.toBinary(scala.reflect.ClassTag$.MODULE$.apply(MyModel.class));
Dug into the codebase ( DateBijectionLaws.scala ) looks like round trips were expected using 'String'. Changing the underlying Avro schema to type "string" worked. Should there be dual support for string/long given the timestamp-millis logical type?
Thanks,
Michael
Metadata
Metadata
Assignees
Labels
No labels