flink-scala-api icon indicating copy to clipboard operation
flink-scala-api copied to clipboard

Add more serializers

Open arnaud-daroussin opened this issue 3 months ago • 3 comments

Hi @novakov-alexey,

Now that the reunification of Flink 1 and 2 is complete, I’m opening this ticket to discuss the serializers we wrote for our needs and that we can share here.

These serializers are in production on our side and have been running for several months.

Serializers missing in Flink:

  • java.time.ZoneId
  • java.time.ZoneOffset
  • java.time.ZonedDateTime
  • java.time.OffsetDateTime

Serializers for the Scala standard library:

  • scala.concurrent.duration.Duration & scala.concurrent.duration.FiniteDuration
  • scala.Enumeration
  • scala.math.Ordering & subclasses (required for sorted sets)

Serializers for Scala mutable collections:

  • scala.collection.mutable.ArrayDeque
  • scala.collection.mutable.Buffer & scala.collection.mutable.ArrayBuffer
  • scala.collection.mutable.Queue
  • scala.collection.mutable.Map & scala.collection.mutable.HashMap
  • scala.collection.mutable.Set & scala.collection.mutable.HashSet
  • scala.collection.mutable.SortedSet & scala.collection.mutable.TreeSet

In fact, pretty much the only thing missing is SortedMap, which we apparently don’t use in our state.

So, let me know which serializers you’re interested in and which ones you want first. I think I’ll have less time to devote to this, but I’ll try to add them progressively.

Of course, all of this is up for discussion, and just because we implemented it a certain way internally doesn’t mean we can’t do better here.

arnaud-daroussin avatar Sep 12 '25 13:09 arnaud-daroussin

Hi @arnaud-daroussin ,

Please bring them all. Perhaps only Scala's 2 scala.Enumeration I would keep aside.

novakov-alexey avatar Sep 12 '25 14:09 novakov-alexey

Hi @novakov-alexey, I think this issue is almost fulfill but we can keep it open for SortedMap, the last missing Scala collection. I'm willing to add a serializer for it if you agree.

arnaud-daroussin avatar Nov 12 '25 08:11 arnaud-daroussin

Hi @arnaud-daroussin, sure, let's add it.

novakov-alexey avatar Nov 12 '25 11:11 novakov-alexey