You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2025/07/14 07:41:00 UTC

[jira] [Updated] (FLINK-38081) FLIP-528: Support EXPLAIN EXECUTE STATEMENT SET Syntax in Flink SQL

     [ https://issues.apache.org/jira/browse/FLINK-38081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated FLINK-38081:
-----------------------------------
    Labels: pull-request-available  (was: )

> FLIP-528: Support EXPLAIN EXECUTE STATEMENT SET Syntax in Flink SQL
> -------------------------------------------------------------------
>
>                 Key: FLINK-38081
>                 URL: https://issues.apache.org/jira/browse/FLINK-38081
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>            Reporter: Ramin Gharib
>            Priority: Minor
>              Labels: pull-request-available
>
> Apache Flink supports the {{STATEMENT SET}}  syntax to group and optimize multiple SQL statements, which is especially useful for reusing intermediate results in {{INSERT INTO}}  statements. Currently, a user can write and execute such a block using:
> {panel}
> {panel}
> |{{EXECUTE}} {{STATEMENT }}{{SET}}
> {{BEGIN}}
> {{   }}{{INSERT}} {{INTO}} {{`sales` }}{{SELECT}} {{...;}}
> {{   }}{{INSERT}} {{INTO}} {{`products` }}{{SELECT}} {{...;}}
> {{{}END{}}}{{{};{}}}|
> However, if a user wants to preview or debug the execution plan of such a block using {{{}EXPLAIN{}}}, the syntax must drop the {{EXECUTE}} keyword:
> {panel}
> {panel}
> |{{EXPLAIN STATEMENT }}{{SET}}
> {{BEGIN}}
> {{   }}{{INSERT}} {{INTO}} {{`sales` }}{{SELECT}} {{...;}}
> {{   }}{{INSERT}} {{INTO}} {{`products` }}{{SELECT}} {{...;}}
> {{{}END{}}}{{{};{}}}|
> This behavior is inconsistent and counterintuitive. Typically, {{EXPLAIN}} can be prepended to most SQL operations (e.g., {{{}EXPLAIN INSERT{}}}, {{{}EXPLAIN CREATE TABLE AS SELECT{}}}) without any syntactic modification. Requiring users to remove {{EXECUTE}} breaks this convention and leads to confusion.
> This FLIP proposes extending Flink SQL to support the syntax {{EXPLAIN EXECUTE STATEMENT SET}}  to improve usability and consistency.
> More details can be found under the [FLIP-528|https://cwiki.apache.org/confluence/display/FLINK/FLIP-528%3A+Support+EXPLAIN+EXECUTE+STATEMENT+SET+Syntax+in+Flink+SQL].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)