Hi all, Thanks for the FLIP Ramin. I would be +1 for this. It creates a consistent experience for SQL users, because they only have to prefix their earlier SQL statement with EXPLAIN in order to get the result.
@Ron I don't think it's so much about the efforts that's required to remove the EXECUTE keyword, but it's about the mental model of users. If you can always add EXPLAIN to begin with, it's easier to comprehend for users. We have a lot of users who are confused and are asking questions about how they can get the query plan for statement sets and why it's not supported. It requires every user to go to the docs, find the documentation on EXPLAIN and then interpret the docs. The docs [1] also don't make it clear that you specifically need to modify the syntax for EXPLAIN, but users are required to compare the differences between a regular statement set syntax [2] and the one for EXPLAIN Best regards, Martijn [1] https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sql/explain/#syntax [2] https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sqlclient/#execute-a-set-of-sql-statements On Tue, Apr 29, 2025 at 4:03 AM Ron Liu <ron9....@gmail.com> wrote: > Hi, Ramin > > Thanks for starting this proposal. > > After glancing at the content of FLIP, I have a question, how valuable is > it to introduce this new syntax, if users want to EXPLAIN STATEMENT SET, > the EXPLAIN keyword itself has to be written, > how much does it cost to remove the EXECUTE keyword at this time? From this > point of view, I don't think it makes much sense to introduce this syntax. > > Best, > Ron > > David Radley <david_rad...@uk.ibm.com> 于2025年4月28日周一 21:51写道: > > > Hi Ramin, > > Thanks for making the changes. > > As far as I can see the EXECUTE STATEMENT SET is Flink specific; so I am > > not sure this is part of the SQL standard. So, I guess adding the explain > > syntax as an alias for the existing explain would be ok. > > > > I assume Flink decided not to use stored procedures syntax to run the > > multiple inserts – which would be what I would have expected here. > > > > Kind regards David. > > > > From: Ramin Gharib <rgha...@confluent.io.INVALID> > > Date: Monday, 28 April 2025 at 13:41 > > To: dev@flink.apache.org <dev@flink.apache.org> > > Subject: [EXTERNAL] Re: [DISCUSS] FLIP-527 Support EXPLAIN EXECUTE > > STATEMENT SET Syntax in Flink SQL > > Hello David, > > > > Many thanks for the response! I have moved the discussion to a new link. > > The FLIP number was wrong (now it is at 528). You can find the new > > link below > > > > https://lists.apache.org/thread/28llyjdks9hrj5rvpbxhd3zd7bfqwrw8 > > > > I have fixed the inconsistency in the text. > > > > Thanks for raising the point about SQL standard compliance with EXPLAIN > > EXECUTE STATEMENT SET. I appreciate your concern. > > > > I've checked PostgreSQL, MySQL, SQL Server, and Oracle, and found that > > their EXPLAIN is designed for single queries. EXECUTE STATEMENT SET > appears > > to be specific to Flink SQL. > > > > Best, > > > > On Mon, Apr 28, 2025 at 1:57 PM David Radley <david_rad...@uk.ibm.com> > > wrote: > > > > > Hi Ramin, > > > Thanks for the Flip. > > > > > > In the text you say > > > EXECUTE STATEMENT SET > > > BEGIN > > > INSERT INTO `sales` SELECT ...; > > > INSERT INTO `products` SELECT ...; > > > END; > > > > > > Twice, I think you are intending the 2nd text to be different. Maybe > > > EXPLAIN STATEMENT SET > > > > > > I am worried that in the SQL standard EXECUTE and EXPLAIN are at the > same > > > level when SQL parsing – so it would not be compliant SQL to allow > > EXPLAIN > > > EXECUTE. Is there precedence for this in another implementation / SQL > > > reference? > > > > > > Kind regards, David. > > > > > > > > > From: Ramin Gharib <rgha...@confluent.io> on behalf of Ramin Gharib > > > <rgha...@confluent.io.INVALID> > > > Date: Monday, 28 April 2025 at 12:04 > > > To: dev@flink.apache.org <dev@flink.apache.org> > > > Subject: [EXTERNAL] [DISCUSS] FLIP-527 Support EXPLAIN EXECUTE > STATEMENT > > > SET Syntax in Flink SQL > > > Hi Flink Community, > > > > > > > > > I want to discuss FLIP-527: Support EXPLAIN EXECUTE STATEMENT SET > Syntax > > in > > > Flink SQL. > > > > > > This FLIP proposes to extend the EXPLAIN statement in Flink SQL to > > support > > > the EXECUTE STATEMENT SET syntax. The goal is to provide users with a > way > > > to understand the execution plan of a batch of SQL statements before > they > > > are executed together. This will enhance debugging, optimization, and > > > overall understanding of how Flink processes a series of dependent > > > operations. > > > > > > > > > You can find the full proposal details on the Flink Wiki at: > > > > > > > > > > > > https://cwiki.apache.org/confluence/display/FLINK/FLIP-527%3A+Support+%60EXPLAIN+EXECUTE+STATEMENT+SET%60+Syntax+in+Flink+SQL > > > > > > > > > I'm eager to hear your thoughts, feedback, and potential concerns > > > regarding this proposal. > > > > > > Thanks, > > > > > > > > > Ramin Gharib > > > > > > [image: Confluent] <https://www.confluent.io> > > > > > > *Ramin Gharib *he/him/his > > > > > > Senior Software Engineer > > > > > > *Follow us: *[image: Blog] > > > < > > > > > > https://www.confluent.io/blog?utm_source=footer&utm_medium=email&utm_campaign=ch.email-signature_type.community_content.blog > > > >[image: > > > Twitter] <https://twitter.com/ConfluentInc>[image: LinkedIn] > > > <https://www.linkedin.com/company/confluent/>[image: Slack] > > > <https://slackpass.io/confluentcommunity>[image: YouTube] > > > <https://youtube.com/confluent> > > > > > > [image: Try Confluent Cloud for Free] > > > < > > > > > > https://www.confluent.io/get-started?utm_campaign=tm.fm-apac_cd.inbound&utm_source=gmail&utm_medium=organic > > > > > > > > > > Sent with Notion Mail <https://www.notion.so/product/mail> > > > > > > Unless otherwise stated above: > > > > > > IBM United Kingdom Limited > > > Registered in England and Wales with number 741598 > > > Registered office: Building C, IBM Hursley Office, Hursley Park Road, > > > Winchester, Hampshire SO21 2JN > > > > > > > > > -- > > > > [image: Confluent] <https://www.confluent.io> > > Ramin Gharib he/him/his > > Senior Software Engineer > > Follow us: [image: Blog] > > < > > > https://www.confluent.io/blog?utm_source=footer&utm_medium=email&utm_campaign=ch.email-signature_type.community_content.blog > > >[image: > > Twitter] <https://twitter.com/ConfluentInc>[image: LinkedIn] > > <https://www.linkedin.com/company/confluent/>[image: Slack] > > <https://slackpass.io/confluentcommunity>[image: YouTube] > > <https://youtube.com/confluent> > > > > [image: Try Confluent Cloud for Free] > > < > > > https://www.confluent.io/get-started?utm_campaign=tm.fm-apac_cd.inbound&utm_source=gmail&utm_medium=organic > > > > > > > Unless otherwise stated above: > > > > IBM United Kingdom Limited > > Registered in England and Wales with number 741598 > > Registered office: Building C, IBM Hursley Office, Hursley Park Road, > > Winchester, Hampshire SO21 2JN > > >