Skip to content

Conversation

@arnaud-daroussin
Copy link
Contributor

@arnaud-daroussin arnaud-daroussin commented Oct 14, 2025

Hi @novakov-alexey,

I'm continuing to complete issue #286 with these serializers:

  • scala.concurrent.duration.Duration & scala.concurrent.duration.FiniteDuration
  • scala.math.Ordering & subclasses
  • scala.collection.mutable.SortedSet & scala.collection.mutable.TreeSet
  • and org.apache.flink.types.Nothing & scala.Nothing as bonus.

I decided to add mutable.SortedSet serializer in this PR to test all Ordering serializers more easily through the mutable.SortedSet serializer.

Some design choices to consider:

  • serializers for default natural orderings are not implicitly available in the context because we cannot presume the user wants to use them. Additionally, there are already two orderings available for Float and Double: default and IEEE ordering.
  • I wasn't able to create serializers for tuple orderings because they are too well encapsulated and I cannot access underlying orderings to serialize them, it's a pity!
  • I added a simple utility method OrderingTypeInfo.deriveOrdering() to help to derive custom orderings, it only ensures the type to derive is a subclass of Ordering and can be derived, and simply do the "safe" cast.
  • I also fixed a small bug: CollectionSerializerSnapshot was not handling char and void in collections correctly.
  • I had to create a plain ScalaNothingTypeInfo because SimpleTypeInfo requires a class tag and classTag[scala.Nothing] is not allowed in Scala 3.

…iteDurationSerializer, Ordering and SortedSet
@arnaud-daroussin arnaud-daroussin force-pushed the issue-286-add-duration-ordering-sortedset-serializers branch from f3776d6 to 018c204 Compare October 14, 2025 16:25
@novakov-alexey novakov-alexey merged commit 49277c4 into flink-extended:master Oct 16, 2025
18 checks passed
@arnaud-daroussin arnaud-daroussin deleted the issue-286-add-duration-ordering-sortedset-serializers branch October 21, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants