Skip to content

[Feature] Support Apache Flink 2.x (2.0, 2.1, 2.2)#4368

Open
shangeyao wants to merge 5 commits into
apache:devfrom
shangeyao:feature/flink-2.x-support
Open

[Feature] Support Apache Flink 2.x (2.0, 2.1, 2.2)#4368
shangeyao wants to merge 5 commits into
apache:devfrom
shangeyao:feature/flink-2.x-support

Conversation

@shangeyao

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request

Issue Number: close #4367

This pull request adds support for Apache Flink 2.x series (2.0, 2.1, 2.2) to StreamPark.

Brief change log

  • Extend FlinkVersion.scala to recognize Flink 2.x versions
  • Create new shims modules: streampark-flink-shims_flink-2.0, streampark-flink-shims_flink-2.1, streampark-flink-shims_flink-2.2
  • Migrate to Java DataStream API (Scala DataStream API removed in Flink 2.x)
  • Handle ParameterTool relocation from org.apache.flink.api.java.utils to org.apache.flink.util
  • Implement Flink 2.1 Model API (createModel, fromCall, etc.)
  • Implement Flink 2.2 FunctionDescriptor and Materialized Tables APIs
  • Update console-service EnvInitializer.java regex to match 2.x shims JARs
  • Add 2.0/2.1/2.2 shims JAR dependencies to console-service pom.xml

Verifying this change

This change is already covered by existing tests, such as:

  • All shims modules (1.12-1.20 + 2.0-2.2) compile successfully
  • Unit tests in streampark-flink-shims-test pass
  • Console service compiles successfully

Does this pull request potentially affect one of the following parts

  • Dependencies (does it add or upgrade a dependency): yes (adds Flink 2.0.2, 2.1.2, 2.2.1 dependencies)
  • The FlinkVersion.scala version detection logic: yes
  • The shims module structure: yes (adds 3 new modules)

@wolfboys

Copy link
Copy Markdown
Member

Welcome to contribute to this PR. I'm curious—was this done with agentic coding? Which model did you use? >_<

@shangeyao shangeyao force-pushed the feature/flink-2.x-support branch from f34b01f to 0b1b111 Compare June 23, 2026 13:29
Closes apache#4367

Add support for Apache Flink 2.x series (2.0, 2.1, 2.2) to StreamPark.

Key changes:
- Extend FlinkVersion.scala to recognize 2.x versions
- Create new shims modules: streampark-flink-shims_flink-2.0/2.1/2.2
- Migrate to Java DataStream API (Scala DataStream API removed in Flink 2.x)
- Handle ParameterTool relocation from org.apache.flink.api.java.utils to org.apache.flink.util
- Implement Flink 2.1 Model API (createModel, fromCall, etc.)
- Implement Flink 2.2 FunctionDescriptor and Materialized Tables APIs
- Update console-service EnvInitializer regex to match 2.x shims JARs
- Add 2.0/2.1/2.2 shims JAR dependencies to console-service pom.xml

All shims modules (1.12-1.20 + 2.0-2.2) compile successfully and tests pass.
@shangeyao shangeyao force-pushed the feature/flink-2.x-support branch from 0b1b111 to 3a90adc Compare June 23, 2026 13:56
shangeyao and others added 3 commits June 24, 2026 23:33
- checkVersion: support Flink 2.x (2.0, 2.1, 2.2) versions
- version detection: fallback to parsing flink-dist JAR filename when
  CliFrontend fails (Flink 2.x requires Java 11+, but server may run Java 8)
- EnvInitializer: extend shims JAR pattern to match 2.x (2.0-2.2)

Fixes: java.lang.UnsupportedClassVersionError when adding Flink 2.2
Flink 2.x dependencies require JDK 11+ to compile. Gate the 2.0/2.1/2.2
shims modules and console packaging behind a JDK 11+ Maven profile so Java 8
CI matrices keep passing.

Generated-by: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
Document JDK 11+ requirements for Flink 2.x runtime, shims packaging on JDK 11+
builds, and manual configuration scenarios.

Generated-by: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
…ce JDK upgrade

Parse Flink version from flink-dist JAR names first and resolve Flink JAVA_HOME
from flink-env.sh for CLI fallback and job submission, so Console can stay on JDK 8.

Generated-by: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
69.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support Apache Flink 2.x (2.0, 2.1, 2.2)

2 participants