Configure SQL Statements for Confluent Manager for Apache Flink
Confluent Manager for Apache Flink (CMF) provides several configuration properties that control the lifecycle of SQL statements.
You can set these properties in your Helm values file under the cmf.sql key,
or pass them directly with --set during helm install or helm upgrade.
Statement cleanup
CMF periodically removes old statements that have reached a terminal phase
(COMPLETED or FAILED). This prevents the metadata database
from growing indefinitely.
When cleanup runs, it deletes statement records that have been in a terminal phase
for longer than the configured retention period. Both the statement metadata and any
associated Kubernetes resources are removed.
Cleanup does not remove INSERT INTO statements or statement sets that were
deployed to a Flink cluster. It removes SELECT statements and statements that
CMF executes directly, such as SHOW and DDL statements.
Property |
Default |
Description |
|---|---|---|
|
|
Enables periodic cleanup of old terminal statements. |
|
|
Number of days to retain terminal statements before they are eligible for cleanup. |
|
|
How often, in hours, the cleanup job runs. |
INSERT statement resource cleanup
When an INSERT INTO statement reaches the COMPLETED phase, CMF can
automatically delete the associated Flink deployment resources (such as FlinkDeployment
or FlinkSessionJob) from Kubernetes. This prevents resource leakage from completed
bounded INSERT jobs.
The statement record itself is retained in CMF and can still be queried through the REST API or Confluent CLI. Only the underlying Kubernetes resources are removed.
Note
The Confluent Platform for Apache Flink Kubernetes Operator also provides a kubernetes.operator.jm-deployment.shutdown-ttl
configuration parameter that controls how long JobManager deployments are retained after a job
finishes. The CMF auto-cleanup acts immediately on completion, whereas the operator TTL is
time-based. When both are active, whichever triggers first removes the resources.
Property |
Default |
Description |
|---|---|---|
|
|
When enabled, Kubernetes deployment resources are deleted immediately after
|
SELECT statement auto-termination
SELECT statements run as Flink jobs that buffer results in memory. To prevent
idle SELECT statements from remaining on the cluster indefinitely when no client
is consuming their results, CMF can automatically terminate them after a
configurable timeout.
Property |
Default |
Description |
|---|---|---|
|
|
Enables automatic termination of idle |
|
|
Number of minutes before an idle |
|
|
How often, in minutes, CMF checks for idle |
Example Helm configuration
The following example shows how to customize SQL statement behavior in your Helm values file:
# sql-values.yaml
cmf:
sql:
# Statement cleanup
statement-cleanup-enabled: true
statement-retention-days: 14
statement-cleanup-interval-hrs: 12
# INSERT resource cleanup
insert-statement-auto-cleanup-enabled: true
# SELECT auto-termination
select-statement-auto-termination-enabled: true
select-statement-timeout-mins: 15
select-statement-auto-termination-check-frequency-mins: 2
You can also pass individual properties directly:
helm upgrade --install cmf confluentinc/confluent-manager-for-apache-flink \
--set cmf.sql.statement-retention-days=14 \
--set cmf.sql.select-statement-timeout-mins=15