raminqaf opened a new pull request, #26785: URL: https://github.com/apache/flink/pull/26785
## What is the purpose of the change This pull request implements [**FLIP-528**](https://cwiki.apache.org/confluence/display/FLINK/FLIP-528%3A+Support+EXPLAIN+EXECUTE+STATEMENT+SET+Syntax+in+Flink+SQL), adding support for the `EXPLAIN EXECUTE STATEMENT SET` syntax in Flink SQL to improve consistency and user experience. Currently, Flink supports `EXECUTE STATEMENT SET` for executing multiple SQL statements atomically, and users can view the execution plan using `EXPLAIN STATEMENT SET`. However, this creates an inconsistency: users must remove the `EXECUTE` keyword when switching from execution to explanation mode. This breaks the convention that `EXPLAIN` can typically be prepended to most SQL operations (e.g., `EXPLAIN INSERT`, `EXPLAIN SELECT`) without syntactic modifications. This change allows users to write `EXPLAIN EXECUTE STATEMENT SET` instead of having to remember to drop the `EXECUTE` keyword, making the SQL syntax more intuitive and consistent. --- ## Brief change log - Extended the SQL parser to recognize and accept the `EXPLAIN EXECUTE STATEMENT SET` syntax - Modified `SqlNodeToOperationConversion.convertRichExplain()` to handle `SqlExecute` nodes containing `STATEMENT SET` blocks - The new syntax is functionally equivalent to the existing `EXPLAIN STATEMENT SET` - this is purely a syntactic improvement with no runtime behavior changes - Added comprehensive test coverage for the new syntax --- ## Verifying this change This change added tests and can be verified as follows: - Added parser tests in `FlinkSqlParserImplTest` to validate correct parsing of `EXPLAIN EXECUTE STATEMENT SET` syntax - Added operation conversion tests in `SqlDmlToOperationConverterTest` to verify that `EXPLAIN EXECUTE STATEMENT SET` produces the same `ExplainOperation` as `EXPLAIN STATEMENT SET` - Verified backward compatibility: existing `EXPLAIN STATEMENT SET` syntax continues to work unchanged --- ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): **no** - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: **yes** (SQL syntax is part of the public API) - The serializers: **no** - The runtime per-record code paths (performance sensitive): **no** - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: **no** - The S3 file system connector: **no** --- ## Documentation - Does this pull request introduce a new feature? **yes** (new SQL syntax) - If yes, how is the feature documented? **not documented** (This is syntactic sugar that doesn't require separate documentation - the existing `EXPLAIN` and `STATEMENT SET` documentation covers the functionality) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org