Flink Versions for Statements in Confluent Manager for Apache Flink
Starting with version 2.5.0, Confluent Manager for Apache Flink® (CMF) runs Flink SQL statements on Flink 1.19 or Flink 2.3. Flink 2.3 adds SQL features that Flink 1.19 does not have, such as process table functions and batch statements. Each statement runs on the Flink version of its compute pool, so statements on both versions can run side by side, and you can move workloads to Flink 2.3 one at a time.
Choose a Flink version
The compute pool sets the Flink version: set flinkVersion in its
clusterSpec to v2_3, and set image to a cp-flink-sql image for
Flink 2.3. A statement has no version setting of its own. It runs on the version
of the compute pool that you submit it to.
The following dedicated compute pool runs statements on Flink 2.3:
{
"apiVersion": "cmf.confluent.io/v1",
"kind": "ComputePool",
"metadata": {
"name": "pool-2-3"
},
"spec": {
"type": "DEDICATED",
"clusterSpec": {
"flinkVersion": "v2_3",
"image": "confluentinc/cp-flink-sql:2.3-cmf2.5-cp1",
"taskManager": {
"resource": {
"cpu": 1.0,
"memory": "1024m"
}
},
"jobManager": {
"resource": {
"cpu": 0.5,
"memory": "1024m"
}
}
}
}
}
You create it the same way as any other compute pool. For details, see Manage Compute Pools in Confluent Manager for Apache Flink.
Use an image for the same Flink version as
flinkVersion. CMF does not check that the two match.The
computePoolDefaultsof an environment take precedence over theclusterSpecof its compute pools. If they setflinkVersionorimage, every compute pool in the environment uses those values, so create Flink 2.3 compute pools in an environment whose defaults do not set these fields. For details, see Configure Environments in Confluent Manager for Apache Flink.
Compile statements for Flink 2.3
CMF compiles each statement for the Flink version of its compute pool. By
default, cmf.statementService.sharedCompilers in the Helm values has a
compiler for Flink 1.19 and a compiler for Flink 2.3, so Flink 2.3 compute pools
work without further setup. If you set cmf.statementService.sharedCompilers,
your list replaces the default list, so keep a compiler for Flink 2.3 in it.
Features that need Flink 2.3
The following features work only on compute pools that use Flink 2.3:
Batch statements
Topic-subject associations for Kafka databases
Built-in functions that Flink added after version 1.19, such as
BTRIM
Other features, such as user-defined functions, custom connectors, and the examples catalog, work on both versions, with the following differences:
A user-defined function that you compile for Java 11 runs on both versions, unless it uses an API that Flink 2.0 removed. Compute pools that use Flink 2.3 run Java 17, so a function for them can also target Java 17.
Build a custom connector or format JAR for the Flink version of the compute pool that uses it.
Move statements to Flink 2.3
A statement cannot move to another compute pool. While a compute pool has statements that can still be resumed, CMF also rejects a change of its Flink version, because their compiled plans and savepoints might not load on another version.
To move a workload to Flink 2.3, create a compute pool for Flink 2.3 and create new statements on it. The new statements start without the state of the old ones.