[DISCUSS] SQL Syntax for Table API StatementSet

2020-06-15 Thread Fabian Hueske
Hi everyone, FLIP-84 [1] added the concept of a "statement set" to group multiple INSERT INTO statements (SQL or Table API) together. The statements in a statement set are jointly optimized and executed as a single Flink job. I would like to start a discussion about a SQL syntax to group multiple

Re: [DISCUSS] SQL Syntax for Table API StatementSet

2020-06-15 Thread Jark Wu
Hi Fabian, Thanks for starting this discussion. I think this is a very important syntax to support file mode and multi-statement for SQL Client. I'm +1 to introduce a syntax to group SQL statements to execute together. As a reference, traditional database systems also have similar syntax, such as

Re: [DISCUSS] SQL Syntax for Table API StatementSet

2020-06-17 Thread Fabian Hueske
Thanks for joining this discussion Jark! This feature is a bit different from BEGIN TRANSACTION / COMMIT and BEGIN / END. The only commonality is that all three group multiple statements. * BEGIN TRANSACTION / COMMIT creates a transactional context that guarantees atomicity, consistency, and isol

Re: [DISCUSS] SQL Syntax for Table API StatementSet

2020-06-17 Thread Timo Walther
Hi Fabian, thanks for the proposal. I agree that we should have consensus on the SQL syntax as well and thus finalize the concepts introduced in FLIP-84. I would favor Jark's proposal. I would like to propose the following syntax: BEGIN STATEMENT SET; INSERT INTO ...; INSERT INTO ...; END

Re: [DISCUSS] SQL Syntax for Table API StatementSet

2020-06-17 Thread godfrey he
Hi Fabian, Jack, Timo Thanks for the suggestions. Regarding the SQL syntax, BEGIN is more popular than START. I'm fine with the syntax Timo suggested. Regarding whether this should be implemented in Flink's SQL core. I think there are three things to consider: First one, do we need to unify the

Re: [DISCUSS] SQL Syntax for Table API StatementSet

2020-06-22 Thread Timo Walther
Hi Godfrey, 1) Of course we should have unified behavior for API and SQL file. However, this doesn't mean that `executeSql` needs to become blocking or support multi-statements. In a programmatic API, async is more useful as a user can control long running jobs (regardless of batch or streamin

Re: [DISCUSS] SQL Syntax for Table API StatementSet

2020-06-22 Thread Fabian Hueske
Thanks for the discussion Godfrey and Timo, I like the syntax proposed by Jark and Timo: BEGIN STATEMENT SET; INSERT INTO ...; INSERT INTO ...; END; (I didn't pay attention and didn't mean to propose START over BEGIN. I just wanted to make the point that the syntax should make it clear tha

Re: [DISCUSS] SQL Syntax for Table API StatementSet

2020-06-22 Thread Jark Wu
+1 to "BEGIN STATEMENT SET; ... END;" syntax. I also think sync/async execution is orthogonal to statement set syntax. This problem still stand there for individual statements. We can discuss this in a separate thread. Best, Jark On Mon, 22 Jun 2020 at 23:23, Fabian Hueske wrote: > Thanks for