tencent cloud

Stream Compute Service

Releases Notes and Announcements
Release Notes
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Billing Mode
Refund
Configuration Adjustments
Getting Started
Preparations
Creating a Private Cluster
Creating a SQL Job
Creating a JAR Job
Creating an ETL Job
Creating a Python Job
Operation Guide
Managing Jobs
Developing Jobs
Monitoring Jobs
Job Logs
Events and Diagnosis
Managing Metadata
Managing Checkpoints
Tuning Jobs
Managing Dependencies
Managing Clusters
Managing Permissions
SQL Developer Guide
Overview
Glossary and Data Types
DDL Statements
DML Statements
Merging MySQL CDC Sources
Connectors
SET Statement
Operators and Built-in Functions
Identifiers and Reserved Words
Python Developer Guide
ETL Developer Guide
Overview
Glossary
Connectors
FAQ
Contact Us

Flink Configuration Items

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2023-11-08 14:23:08

Overview

The SET statement can be used to adjust some key job parameters. Currently, you can configure most parameters in advanced job parameters. Only a few need to be set using the SET statement.
Note
SET is an advanced statement. Improper configuration may cause your job to fail, so use it only when necessary.
Comments (--) are not supported for the SET statement.
A semicolon is required at the end of a SET clause.

Syntax

In a SET clause, string-type values must be quoted with single quotation marks. This is not necessary for Boolean or numeric values.
SET option = 'Value';

Example

Idle State Retention Time

For statements with large state, such as GROUP BY and JOIN, Flink offers the Idle State Retention Time mechanism. You can specify the minimum and maximum state retention time to avoid OOM caused by the continuous increase of states. The clause below sets the minimum retention time to 5 hours and the maximum retention time to 6 hours.
Note
The minimum and maximum retention time must be at least 5 minutes apart; otherwise, an error will occur and Flink will ignore the settings.
The format of time units should follow Flink's requirements. For example, you can set the time to 10min, 3h, 3hour, 7day, or 7d. Spaces between numbers and time units are optional.
SET execution.min-idle-state-retention = '5 h';
SET execution.max-idle-state-retention = '6 h';

Checkpoint timeout for SQL jobs

By default, the minimum timeout period for SQL jobs is 10 minutes and the maximum period is twice the checkpoint interval. That is to say, the timeout period for a job whose checkpoint interval is 60 seconds must be at least 10 minutes, and the timeout period for a job whose checkpoint interval is 10 minutes cannot exceed 20 minutes.
To customize a checkpoint timeout period, use the SET clause below.
SET CHECKPOINT_TIMEOUT = '300 s';
Note
The Flink option (advanced parameter) execution.checkpointing.timeout may not take effect for SQL jobs. Please use the SET clause above to configure the timeout period.

Mini-batch

Flink SQL supports mini-batch aggregation, which can significantly increase throughput. Mini-batch may increase delay and is therefore disabled by default. To enable mini-batch, add the following clauses to the edit page of your SQL job (the batch size and latency can be modified but cannot be omitted):
set table.exec.mini-batch.enabled = true;
set table.exec.mini-batch.size = 5000;
set table.exec.mini-batch.allow-latency = '200 ms';


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백