AnishMahto opened a new pull request, #56122:
URL: https://github.com/apache/spark/pull/56122
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR:
https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g.,
'[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a
faster review.
7. If you want to add a new configuration, please read the guideline first
for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the
guideline first in
'common/utils/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
In order for a pipeline to actually execute an AutoCDC SCD1 flow, the SDP
engine needs to have a "physical" flow definition that defines what streaming
transformation must be done for SCD1, and how to construct this physical flow
given a "logical" flow.
The `FlowPlanner` is responsible for converting a resolved SCD1 streaming
logical flow into the SCD1 streaming physical flow. The physical flow
implements the SCD1 `foreachBatch` streaming query on the flow input.
Integration of physical flow unblocks pipeline execution with AutoCDC flows,
which means we need to also fill gaps for auxiliary/target table management,
schema evolution, inter-pipeline validation, etc.
### Why are the changes needed?
To actually execute AutoCDC SCD1 flow transformation with an SDP pipeline.
Before this point if an AutoCDC flow was registered with the graph, the graph
analysis engine would throw an unrecognized flow exception.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
With these changes, we can now actually test how an AutoCDC flow interacts
with the rest of SDP. This unlocks a number of features/integrations that we
should test, such as:
- Schema evolution
- Writing to different pipeline dataset types
- Full refresh semantics
- Multiflow, multipipeline, for the same AutoCDC target
- Executing AutoCDC flows over multiple independent pipeline runs
- etc.
As such I added a new `AutoCdcGraphExecutionTestMixin` providing a
v2-row-level-ops-capable
catalog (`SharedTablesInMemoryRowLevelOperationTableCatalog`) and the
standard
fixtures all AutoCDC E2E suites share, plus six new end-to-end suites
(~30 tests) covering:
- `AutoCdcScd1SinglePipelineSuite` — basic upsert/delete reconciliation in a
single pipeline, plus the `AUTOCDC_TARGET_DOES_NOT_SUPPORT_MERGE` failure path.
- `AutoCdcScd1MultiPipelineSuite` — independent targets across pipelines,
downstream readers of an AutoCDC target, and the cross-pipeline key-drift error.
- `AutoCdcScd1FullRefreshSuite` — full refresh wipes target rows + aux
table; sequence comparisons reset; selective refresh isolates state.
- `AutoCdcScd1SchemaEvolutionSuite` — broadening/narrowing column selection,
nullable column addition, key set drift, type widening/narrowing, nested
struct/array evolution, case-only collisions, etc.
- `AutoCdcScd1AuxiliaryTableDurabilitySuite` — keys-first invariant,
declared key order preserved, multi-run sequence comparisons, transparent
aux-table recreation if dropped.
- `AutoCdcScd1TargetTableDurabilitySuite` — pre-loaded target rows,
late-added CDC metadata column.
### Was this patch authored or co-authored using generative AI tooling?
Co-authored.
Generated-by: Claude-Opus-4.7-thinking-xhigh
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]