Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagesql
titleSyntax: TRIGGER CREATE SAVEPOINT
TRIGGERCREATE SAVEPOINT <query_id>

The result would the savepoint path.

Code Block
languagesql
titleResult: TIGGER CREATE SAVEPOINT
+------------------------------------------------------|
|            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
languagesql
titleSyntax: DISPOSE DROP SAVEPOINT
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

...

  1. Support the new statements and operations in SQL parser and Planner.
  2. 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)

...