...
This statement stops a non-terminated SQL, which is similar to `flink stop` and `flink cancel` in CLI. As stop command has a `--drain` option, we should introduce a table config like `sql-client.stop-with-drain` to support the same functionality.
Code Block | ||||
---|---|---|---|---|
| ||||
STOP JOB '<job_id>' [WITH SAVEPOINT | WITH DRAIN] |
The result would the savepoint path.
Code Block | ||||
---|---|---|---|---|
| ||||
+-----------------------------------------------------------------| | savepoint_path | +-----------------------------------------------------------------| | hdfs://mycluster/flink-savepoints/savepoint-cca7bc-bb1e257f0dab | +-----------------------------------------------------------------| |
Related Table Options
In addition, thereThere're two related table options to control the fine-grained behavior:
1.
...
WITH SAVEPOINT
If specifiedIf it's true (true by default), the stop statement stops a SQL job without with a savepoint, which is similar to `flink cancel` stop` in CLI.
Otherwise, the stop statement stops a SQL job ungracefully, just like `flink cancel` In CLI. Since an ungrateful drop doesn’t trigger a savepoint, the result would be a simple OK, like the one returned by DDL.
2.
...
WITH DRAIN
If specified
...
If it's true (false by default), the stop statement stops a SQL job and increases the watermark to MAX_WATERMARK to trigger all the timers, which is similar to `flink stop .. --drain` in CLI.
...