I am trying to implement a ZonedDateTime conversion very similar to this post: https://stackoverflow.com/a/70088424/3926131
What I have noticed is that the toCharSequence method only gets called from classes that implement the avro MessageEncoder interface(e.g. BinaryMessageEncoder) but will not be called when I use a class that extends the avro Encoder abstract class (e.g. BinaryEncoder)
@Override
public CharSequence toCharSequence(ZonedDateTime value, Schema schema, LogicalType type) {
return value.format(DATE_TIME_FORMATTER);
}
Does anyone know if it is possible to use avro conversions for encoders that extend Encoder?
I found the issue - you need to use a datatum writer constructor that takes the schema and data e.g.