Skip to content

[SPARK-56953][SDP] Implement SCD1 Batch Processor; foreachBatch Callback#56016

Open
AnishMahto wants to merge 40 commits into
apache:masterfrom
AnishMahto:SPARK-56953-SCD1-foreachbatch-callback
Open

[SPARK-56953][SDP] Implement SCD1 Batch Processor; foreachBatch Callback#56016
AnishMahto wants to merge 40 commits into
apache:masterfrom
AnishMahto:SPARK-56953-SCD1-foreachbatch-callback

Conversation

@AnishMahto
Copy link
Copy Markdown
Contributor

Approved AutoCDC SPIP: https://lists.apache.org/thread/j6sj9wo9odgdpgzlxtvhoy7szs0jplf7


This is a stacked PR. Review incremental diff here: AnishMahto/spark@SPARK-56927-SCD1-merge-microbatch-onto-target...SPARK-56953-SCD1-foreachbatch-callback


Preamble:

The SCD type 1 flow is a foreachBatch streaming query on an input change-data-feed, and is responsible for reconciling the incoming change data onto some target table that follows SCD1 replication semantics.

SCD1 flows also maintain an "auxiliary" table to keep track of early-arriving out-of-order received events state. Each microbatch will need to reconcile against this auxiliary table as well, and update the auxiliary table's state appropriately for future microbatches.

foreachBatch Callback:

Implementation of the actual callback that will be passed into the foreachBatch streaming query for SCD1 flows.

The callback orchestrates microbatch validation and calling all of the Scd1BatchProcessor helpers to execute the complete reconciliation of a change-data-feed microbatch onto the auxiliary and target tables.

Introduce Scd1ForeachBatchExecSuite to exercise E2E business logic unit tests. In the future when we hook this up to an actual flow execution, we will introduce E2E integration tests that can additionally verify schema evolution, interaction with other dataflow graph entities, etc.

Additionally refactor some test helper functions into a shared AutoCdcCatalogExecutionTestBase.

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