...
Since CANCEL QUERY
doesn’t trigger a savepoint, the result would be a simple OK, like the one returned by DDL.
...
CREATE SAVEPOINT
TRIGGER CREATE SAVEPOINT
statements trigger savepoints for the specified query, which is similar to `flink savepoint` in CLI.
Code Block | ||||
---|---|---|---|---|
| ||||
TRIGGERCREATE SAVEPOINT <query_id> |
The result would the savepoint path.
Code Block | ||||
---|---|---|---|---|
| ||||
+------------------------------------------------------| | savepoint_path | +------------------------------------------------------| | /tmp/flink-savepoints/savepoint-cca7bc-bb1e257f0dab | +------------------------------------------------------| |
...
DROP SAVEPOINT
DISPOSE DROP SAVEPOINT
statements delete the specified savepoint, which is similar to `flink savepoint –dispose` in CLI.
Syntax:
DISPOSE DROP SAVEPOINT <savepoint_path>
Code Block | ||||
---|---|---|---|---|
| ||||
DISPOSE SAVEPOINT <savepoint_path> |
...
SQL operator | SQL operation |
SqlShowQueries | ShowQueriesOperation |
SqlStopQuery | StopQueryOperation |
SqlCancelQuery | CancelQueryOperation |
SqlTriggerSavepointSqlCreateSavepoint | TriggerSavepointOperationCreateSavepointOperation |
SqlDisposeSavepointSqlDropSavepoint | DisposeSavepointOperationDropSavepointOperation |
Executor
Executor would need to convert the query lifecycle operations into ClusterClient commands.
SQL operation | Cluster Client Command |
ShowQueriesOperation | ClusterClient#listJobs |
StopQueryOperation | ClusterClient#stoplWithSavepoint |
CancelQueryOperation | ClusterClient#cancel |
TriggerSavepointOperationCreateSavepointOperation | ClusterClient#triggerSavepoint |
DisposeSavepointOperationDropSavepointOperation | ClusterClient#disposeSavepoint |
...
- Support the new statements and operations in SQL parser and Planner.
- Extend Executor to support the new operations.
Compatibility, Deprecation, and Migration Plan
This FLIP introduces new SQL keywords, which may cause troubles for the existing SQLs. Users need to escape the new keywords if they use them as SQL identifiers.
...
- QUERY (new)
- QUERIES (new)
- STOP (new)
- CANCEL (new)
- TIGGER (already reserved)
- DISPOSE (new)
- SAVEPOINT (already reserved)
- SAVEPOINTS (new)
...