Skip to content

Conversation

arnaud-daroussin
Copy link
Contributor

Hi @novakov-alexey,

Here is the changes we talked about in this issue #252.

As expected in the issue, I was able to reunify all the code about:

  • functions (package function and function.util)
    • I had to create my own WrappingFunction because the one from Flink 1 was moved in Flink 2: not a big deal.
  • async functions (package async)
  • serializers (package serializer, mapper) including LowPrioImplicits classes and serializers object.
  • type informations (package typeinfo)
    • one trick: because we still have to implement TypeSerializer.createSerializer(ExecutionConfig) in Flink 1.19+, the method must be defined, but because of the fact the method was deleted in Flink 2, we cannot define the method as overriding. Luckily, it is legit to implement a method required in a trait without the override keyword, so the same code is valid for both Flink 1.19+ & Flink 2!
    • I merged together ProductTypeInformation and CaseClassTypeInfo.
  • some other classes like OutputTag or ClosureCleaner.
  • all associated tests.

So it lefts in specific Flink 1 & 2 project only what seems normal to be split: the Stream API and associated classes (conv object, ScalaStreamOps class, extensions package).


object serializers extends LowPrioImplicits {
override protected val config: ExecutionConfig = new ExecutionConfig()
trait serializers extends LowPrioImplicits {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to a trait to be overridable by users.

@novakov-alexey
Copy link
Collaborator

novakov-alexey commented Aug 6, 2025

So it lefts in specific Flink 1 & 2 project only what seems normal to be split

I though we will get rid of flink-1 and flink-2 separation in the codebase, probably I was wrong.

Great effort, lots of duplicated code was removed, which is helpful!

@arnaud-daroussin
Copy link
Contributor Author

I though we will get rid of flink-1 and flink-2 separation in the codebase, probably I was wrong.

Actually it's completely rational and even desirable to have to maintain different APIs for Flink 1 & 2 because the whole point for Flink to go for a major release was to do breaking changes in their APIs, and now they will introduce new features in Flink 2, so the APIs will continue to diverge.

@novakov-alexey
Copy link
Collaborator

I though we will get rid of flink-1 and flink-2 separation in the codebase, probably I was wrong.

Actually it's completely rational and even desirable to have to maintain different APIs for Flink 1 & 2 because the whole point for Flink to go for a major release was to do breaking changes in their APIs, and now they will introduce new features in Flink 2, so the APIs will continue to diverge.

yes, it was probably unavoidable.

@novakov-alexey
Copy link
Collaborator

@arnaud-daroussin do you plan to comment or change something else?

@arnaud-daroussin
Copy link
Contributor Author

@novakov-alexey no, I think the work is done. Even the last commit was completely optional.
It can be merged if you are happy with the changes and have no RFC on this PR.

Actually I have a lot of things to propose that are waiting for this refactoring 😉

@novakov-alexey novakov-alexey merged commit 057d276 into flink-extended:master Aug 10, 2025
18 checks passed
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