[SPARK-57402][SQL][SDP] Register AUTO CDC SQL syntax with the dataflow graph#57176
Open
anew wants to merge 1 commit into
Open
[SPARK-57402][SQL][SDP] Register AUTO CDC SQL syntax with the dataflow graph#57176anew wants to merge 1 commit into
anew wants to merge 1 commit into
Conversation
### 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:CREATE STREAMING TABLE <name> FLOW AUTO CDC FROM <source> ..., parsed intoCreateStreamingTableAutoCdc, now registers the streaming table and anAutoCdcFlowthat targets it.CREATE FLOW <name> AS AUTO CDC INTO <target> FROM <source> ..., parsed into aCreateFlowCommandwrapping anAutoCdcIntoCommand, now registers anAutoCdcFlowfrom the named flow into the target dataset.A shared
buildChangeArgshelper converts the parse-time expressions and unresolved attributes into theChangeArgsconsumed byAutoCdcFlow(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
SqlPipelineSuitecovering both syntaxes, the optional clauses (APPLY AS DELETE WHEN, COLUMNS, COLUMNS * EXCEPT), and the multipart-flow-name error. FullSqlPipelineSuitepasses (50 tests).Was this patch authored or co-authored using generative AI tooling?
Generated-by: Opus 4.8