Skip to content

[KYUUBI #6995] Support Flink 2.0, 2.1, 2.2 and 2.3 - #7628

Closed
pan3793 wants to merge 5 commits into
apache:masterfrom
pan3793:kyuubi-flink-2
Closed

[KYUUBI #6995] Support Flink 2.0, 2.1, 2.2 and 2.3#7628
pan3793 wants to merge 5 commits into
apache:masterfrom
pan3793:kyuubi-flink-2

Conversation

@pan3793

@pan3793 pan3793 commented Aug 12, 2026

Copy link
Copy Markdown
Member

Why are the changes needed?

Closes #6995.

Extend the Flink SQL engine to support Flink 2.0, 2.1, 2.2 and 2.3, while keeping the existing
1.17 to 1.20 support. The engine keeps shipping a single jar that runs against all supported
Flink versions, so the version differences are bridged by reflection rather than by per-version
source trees.

Flink 2.x changes that the engine has to adapt to:

  • FLINK-14068 (2.0.0) removed org.apache.flink.api.common.time.Time in favor of Duration,
    which is a parameter of EmbeddedJobClient's constructor.
  • FLINK-33212 (2.0.0) added a Configuration parameter to EmbeddedExecutor's constructor.
  • FLINK-38974 (2.3.0) split EmbeddedExecutorFactory's and EmbeddedExecutor's job ids into the
    application, suspended and terminal ones, and made the dispatcher reject jobs that carry no
    registered application id. Flink resolves the factory constructor at compile time, so Kyuubi's
    copy of EmbeddedExecutorFactory declares both constructors and stamps the application id
    captured from the bootstrap job on every submitted StreamGraph, which enables application
    mode on Flink 2.3.
  • FLINK-35625 and FLINK-36310 (2.0.0) merged flink run-application into flink run and removed
    the former, so FlinkProcessBuilder picks the action by the version detected from the
    flink-dist jar under $FLINK_HOME/lib.
  • FLINK-36760 (2.0.0) removed CliOptionsParser#checkFilePath, which is now inlined into
    FlinkEngineUtils. Note that DefaultContext#load needs no adaption, its dependency list
    changed from List<URL> to List<URI> but both erase to the same descriptor, and Flink still
    reads the elements as URL in SessionContext#create.
  • Configuration#getString(ConfigOption) was removed, Configuration#get(ConfigOption) is used
    instead, which exists in all supported versions.

Flink 2.x requires Java 11 or higher and is compiled with Java 11 target, so the flink-2.x
profiles raise enforcer.maxJdkVersion to 11, and the Flink 2.x CI jobs run on Java 17.

How was this patch tested?

New UTs cover the Flink version detection and the application mode command selection in
FlinkProcessBuilderSuite.

FlinkOperationSuite asserts the result of ENCODE by version, since FLINK-38062 (2.2.0)
corrected its return type from BINARY to VARBINARY, before that the result was silently
truncated to the first byte.

externals/kyuubi-flink-sql-engine tests were run against each Flink binary distribution, with
FLINK_HOME pinned to the matching distribution:

Flink Result
1.20.5 111 passed
2.0.2 111 passed
2.1.3 111 passed
2.2.1 111 passed
2.3.0 111 passed

FlinkOperationOnYarnSuite covers application mode on Flink 2.3, and the cross-version job
compiles the engine against Flink 1.20 and runs it on the Flink 2.3 distribution.

The GA flink-it matrix now always compiles against the default Flink version and varies only
the runtime distribution, covering 1.17, 1.18, 1.19 on Java 8 and 2.0, 2.1, 2.2, 2.3 on Java 17.

Was this patch authored or co-authored using generative AI tooling?

Assisted-by: Claude Opus 5, Codex

@github-actions github-actions Bot added kind:documentation Documentation is a feature! kind:infra license, community building, project builds, asf infra related, etc. module:server module:flink kind:build labels Aug 12, 2026
FLINK-14068 (2.0.0) removed Configuration#setString/setInteger, use set
FLINK-38974 (2.3.0) rejects jobs that carry no application id in the dispatcher
assume in beforeAll aborts the whole suite and is reported as failure,
guard jdbcUrl instead so each test is canceled
@pan3793
pan3793 requested review from link3280 and wForget and removed request for link3280 August 13, 2026 05:14
@pan3793

pan3793 commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

After this, I'm going to drop support for Flink 1.17, 1.18, and 1.19, then mark Flink 2.0 as deprecated because it has been EOL

@pan3793 pan3793 changed the title [KYUUBI #6995][FLINK] Support Flink 2.0, 2.1, 2.2 and 2.3 [KYUUBI #6995] Support Flink 2.0, 2.1, 2.2 and 2.3 Aug 13, 2026
@pan3793
pan3793 requested a review from SteNicholas August 13, 2026 09:36
@pan3793 pan3793 self-assigned this Aug 13, 2026
@pan3793 pan3793 added this to the v1.13.0 milestone Aug 13, 2026

@wForget wForget left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @pan3793 , LGTM

FLINK-38974 (2.3.0) makes the dispatcher reject jobs that carry no
application registered in it. Kyuubi statements run through the SQL
gateway, which builds plain StreamExecutionEnvironments, so stamp the
application id captured from the bootstrap job on every submitted
StreamGraph.

Assisted-by: Codex
@pan3793

pan3793 commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Pushed a new commit to resolve the application mode with Flink 2.3

@pan3793 pan3793 closed this in 3df4e50 Aug 13, 2026
@pan3793

pan3793 commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

thanks, merged to master

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

Labels

kind:build kind:documentation Documentation is a feature! kind:infra license, community building, project builds, asf infra related, etc. module:flink module:integration-tests module:server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Support Flink 2.0

2 participants