feat(#286): add serializers for Duration, FiniteDuration, Ordering and SortedSet #302
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @novakov-alexey,
I'm continuing to complete issue #286 with these serializers:
scala.concurrent.duration.Duration&scala.concurrent.duration.FiniteDurationscala.math.Ordering& subclassesscala.collection.mutable.SortedSet&scala.collection.mutable.TreeSetorg.apache.flink.types.Nothing&scala.Nothingas bonus.I decided to add
mutable.SortedSetserializer in this PR to test allOrderingserializers more easily through themutable.SortedSetserializer.Some design choices to consider:
OrderingTypeInfo.deriveOrdering()to help to derive custom orderings, it only ensures the type to derive is a subclass ofOrderingand can be derived, and simply do the "safe" cast.CollectionSerializerSnapshotwas not handlingcharandvoidin collections correctly.ScalaNothingTypeInfobecauseSimpleTypeInforequires a class tag andclassTag[scala.Nothing]is not allowed in Scala 3.