Luca Castelli created FLINK-39556:
-------------------------------------
Summary: Make file path optional in COMPILE PLAN to return plan
inline as a result set
Key: FLINK-39556
URL: https://issues.apache.org/jira/browse/FLINK-39556
Project: Flink
Issue Type: Improvement
Components: Table SQL / API
Affects Versions: 2.2.0
Reporter: Luca Castelli
*Today:* COMPILE PLAN requires a file path argument and writes the compiled
ExecNodeGraph JSON to disk:
`COMPILE PLAN '/path/to/plan.json' FOR INSERT INTO sink SELECT * FROM src;`
This requires the caller to share a filesystem with the executor. For tooling
built on the SQL Gateway (CLIs, IDEs, CI systems) this adds
filesystem-coordination complexity, and for remote SQL Gateway deployments it
does not work at all - the file lands on the gateway host, not the caller's
host.
*Proposal:* make the file path optional. When omitted, return the compiled plan
inline as a single-row, single-column STRING result set with
ResultKind.SUCCESS_WITH_CONTENT - the same result-set pattern already used by
EXPLAIN.
`COMPILE PLAN FOR INSERT INTO sink SELECT * FROM src;`
-- returns plan JSON via fetchResults
*Compatibility:* fully backward compatible. The existing COMPILE PLAN '<path>'
[IF NOT EXISTS] FOR <dml> syntax and behavior are unchanged. IF NOT EXISTS is
rejected when no file path is given (it is meaningless without one).
This is an internal-only change at the API level: SqlCompilePlan and
CompilePlanOperation are both @Internal; no new public API surface, no new REST
endpoints.
*Discussion thread:*
--
This message was sent by Atlassian Jira
(v8.20.10#820010)