Description
Serdes.scala contains an implicit def timeWindowedSerde as below:
implicit def timeWindowedSerde[T]: WindowedSerdes.TimeWindowedSerde[T] = new WindowedSerdes.TimeWindowedSerde[T]()
It creates a new TimeWindowedSerde without inner serializer, which is a bug. Even in WindowedSerdes.java it says that empty constructor is for reflection.
// Default constructor needed for reflection object creation public TimeWindowedSerde() { super(new TimeWindowedSerializer<>(), new TimeWindowedDeserializer<>()); } public TimeWindowedSerde(final Serde<T> inner) { super(new TimeWindowedSerializer<>(inner.serializer()), new TimeWindowedDeserializer<>(inner.deserializer())); }
All above failes for me when I try to implicitly access the right Serde:
private val twSerde = implicitly[TimeWindowedSerde[String]]
and I have to create the object properly on my own
private val twSerde = new WindowedSerdes.TimeWindowedSerde[String](implicitly[Serde[String]])
it could be fixed with a proper call in Serdes.scala
implicit def timeWindowedSerde[T](implicit tSerde: Serde[T]): WindowedSerdes.TimeWindowedSerde[T] =
new WindowedSerdes.TimeWindowedSerde[T](tSerde)
But maybe also the scope of the default constructor for TimeWindowedSerde should be changed?
BR, Michał
Attachments
Issue Links
- links to