Skip to content

[SPARK-57402][SQL][SDP] Register AUTO CDC SQL syntax with the dataflow graph#57176

Open
anew wants to merge 1 commit into
apache:masterfrom
anew:hookup-sql-parser-with-dataflow-graph
Open

[SPARK-57402][SQL][SDP] Register AUTO CDC SQL syntax with the dataflow graph#57176
anew wants to merge 1 commit into
apache:masterfrom
anew:hookup-sql-parser-with-dataflow-graph

Conversation

@anew

@anew anew commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request? Hook up the two AUTO CDC SQL constructs introduced in SPARK-56249 to the Spark Declarative Pipelines dataflow graph in SqlGraphRegistrationContext:

  1. CREATE STREAMING TABLE <name> FLOW AUTO CDC FROM <source> ..., parsed into CreateStreamingTableAutoCdc, now registers the streaming table and an AutoCdcFlow that targets it.
  2. CREATE FLOW <name> AS AUTO CDC INTO <target> FROM <source> ..., parsed into a CreateFlowCommand wrapping an AutoCdcIntoCommand, now registers an AutoCdcFlow from the named flow into the target dataset.

A shared buildChangeArgs helper converts the parse-time expressions and unresolved attributes into the ChangeArgs consumed by AutoCdcFlow (keys, sequencing, delete condition, include/exclude column selection). SQL AUTO CDC only supports SCD Type 1, matching the Connect/proto path.

Why are the changes needed?

Before this change the AUTO CDC SQL syntax parsed successfully but was rejected during graph registration, so it could not be used to define pipeline datasets or flows.

Does this PR introduce any user-facing change?

Yes. AUTO CDC SQL statements now register datasets and flows in a pipeline.

How was this patch tested?

Added registration and end-to-end execution tests to SqlPipelineSuite covering both syntaxes, the optional clauses (APPLY AS DELETE WHEN, COLUMNS, COLUMNS * EXCEPT), and the multipart-flow-name error. Full SqlPipelineSuite passes (50 tests).

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Opus 4.8

### What changes were proposed in this pull request?
Hook up the two AUTO CDC SQL constructs introduced in SPARK-56249 to the
Spark Declarative Pipelines dataflow graph in `SqlGraphRegistrationContext`:

1. `CREATE STREAMING TABLE <name> FLOW AUTO CDC FROM <source> ...`, parsed
   into `CreateStreamingTableAutoCdc`, now registers the streaming table and
   an `AutoCdcFlow` that targets it.
2. `CREATE FLOW <name> AS AUTO CDC INTO <target> FROM <source> ...`, parsed
   into a `CreateFlowCommand` wrapping an `AutoCdcIntoCommand`, now registers
   an `AutoCdcFlow` from the named flow into the target dataset.

A shared `buildChangeArgs` helper converts the parse-time expressions and
unresolved attributes into the `ChangeArgs` consumed by `AutoCdcFlow`
(keys, sequencing, delete condition, include/exclude column selection). SQL
AUTO CDC only supports SCD Type 1, matching the Connect/proto path.

### Why are the changes needed?
Before this change the AUTO CDC SQL syntax parsed successfully but was
rejected during graph registration, so it could not be used to define
pipeline datasets or flows.

### Does this PR introduce _any_ user-facing change?
Yes. AUTO CDC SQL statements now register datasets and flows in a pipeline.

### How was this patch tested?
Added registration and end-to-end execution tests to `SqlPipelineSuite`
covering both syntaxes, the optional clauses (APPLY AS DELETE WHEN, COLUMNS,
COLUMNS * EXCEPT), and the multipart-flow-name error. Full `SqlPipelineSuite`
passes (50 tests).

### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Opus 4.8

Co-authored-by: Isaac
@anew anew changed the title [SPARK-57402][SDP] Register AUTO CDC SQL syntax with the dataflow graph [SPARK-57402][SQL][SDP] Register AUTO CDC SQL syntax with the dataflow graph Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant