Skip to content

Drop Flink 1.18 support to reduce code duplication and improve testability #252

@arnaud-daroussin

Description

@arnaud-daroussin

Hi @novakov-alexey,

You told me a few weeks ago you were looking for a way to improve testing for Flink1 and Flink2 without duplicating the tests.

I think the way to improve testability is to reduce code duplication. If we duplicate the code, we also need to duplicate associated tests.

I looked at the code to understand why so many classes have been duplicated between Flink 1.x and 2.x. I'm seeing many methods and APIs that were deprecated in Flink 1.19 and removed in Flink 2.0, so you had to duplicate the code to handle old APIs of Flink 1.18 where the replacement is not yet available and duplicate the code to handle the new APIs of Flink 2.0 when the old ones have been removed.

So if we drop Flink 1.18 support, we can reunify classes that were duplicated due to:

  • the deprecation of ExecutionConfig in favor of SerializerConfig,
  • the deprecation of Time in favor of Duration,
  • the deprecation of Configuration in favor of OpenContext,
  • the deprecation of resolveSchemaCompatibility(newSerializer: TypeSerializer[T]) in favor of resolveSchemaCompatibility(oldSerializerSnapshot: TypeSerializerSnapshot[T]) in TypeSerializerSnapshot.

It means we could reunify almost all the code, most notably all the typeinfo, serializers, snapshots, LowPrioImplicits. There is only some API that cannot be reunified like CoGroupedStreams or ScalaAllWindowFunctionWrapper because of a breaking change in Flink 2.0 without proper replacement before.

What do you think of this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions