Hi Paul Sorry for the late response. I propose my thoughts here.
1. I think the keyword QUERY may confuse users because the statement also works for the DML statement. I find the Snowflakes[1] supports - CREATE TASK - DROP TASK - ALTER TASK - SHOW TASKS - DESCRIPE TASK I think we can follow snowflake to use `TASK` as the keyword or use the keyword `JOB`? 2. STOP/CANCEL is not very straightforward for the SQL users to terminate their jobs. ``` DROP TASK [IF EXISTS] <job id> PURGE; -- Forcely stop the job with drain DROP TASK [IF EXISTS] <job id>; -- Stop the task with savepoints ``` Oracle[2] uses the PURGE to clean up the table and users can't not recover. I think it also works for us to terminate the job permanently. 3. I think CREATE/DROP SAVEPOINTS statement is more SQL-like. Users can use the ``` SET 'state.savepoints.dir' = '<path_to_savepoint>'; SET 'state.savepoints.fomat' = 'native'; CREATE SAVEPOINT <job id>; DROP SAVEPOINT <path_to_savepoint>; ``` 4. SHOW TASKS can just list the job id and use the DESCRIPE to get more detailed job infos. ``` SHOW TASKS; +----------------------------------+ | job_id | +----------------------------------+ | 0f6413c33757fbe0277897dd94485f04 | +----------------------------------+ DESCRIPE TASK <job id>; +------------------------ | job name | status | +------------------------ | insert-sink | running | +------------------------ ``` It's better we can also get the infos about the cluster where the job is running on through the DESCRIBE statement. [1] https://docs.snowflake.com/en/sql-reference/ddl-pipeline.html#task-management [2] https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_9003.htm#SQLRF01806 Paul Lam <paullin3...@gmail.com> 于2022年4月21日周四 10:36写道: > ping @Timo @Jark @Shengkai > > Best, > Paul Lam > > > 2022年4月18日 17:12,Paul Lam <paullin3...@gmail.com> 写道: > > > > Hi team, > > > > I’d like to start a discussion about FLIP-222 [1], which adds query > lifecycle > > statements to SQL client. > > > > Currently, SQL client supports submitting queries (queries in a broad > sense, > > including DQLs and DMLs) but no further lifecycle statements, like > canceling > > a query or triggering a savepoint. That makes SQL users have to rely on > > CLI or REST API to manage theirs queries. > > > > Thus, I propose to introduce the following statements to fill the gap. > > SHOW QUERIES > > STOP QUERY <query_id> > > CANCEL QUERY <query_id> > > TRIGGER SAVEPOINT <savepoint_path> > > DISPOSE SAVEPOINT <savepoint_path> > > These statement would align SQL client with CLI, providing the full > lifecycle > > management for queries/jobs. > > > > Please see the FLIP page[1] for more details. Thanks a lot! > > (For reference, the previous discussion thread see [2].) > > > > [1] > https://cwiki.apache.org/confluence/display/FLINK/FLIP-222%3A+Support+full+query+lifecycle+statements+in+SQL+client > < > https://cwiki.apache.org/confluence/display/FLINK/FLIP-222:+Support+full+query+lifecycle+statements+in+SQL+client > > > > [2] https://lists.apache.org/thread/wr47ng0m2hdybjkrwjlk9ftwg403odqb < > https://lists.apache.org/thread/wr47ng0m2hdybjkrwjlk9ftwg403odqb> > > > > Best, > > Paul Lam > > > >