Skip to content

Spark: Add native CDC for copy-on-write tables - #17953

Draft
huan233usc wants to merge 7 commits into
apache:mainfrom
huan233usc:spark-4.2-auto-cdf-cow
Draft

huan233usc wants to merge 7 commits into
apache:mainfrom
huan233usc:spark-4.2-auto-cdf-cow

Conversation

@huan233usc

@huan233usc huan233usc commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Expose Iceberg change data through the Spark 4.2 Data Source V2 Changelog API.

I tried to piggyback existing change log table implementation.

Currently the table only implements COW, so this PR only support COW case.

MOR will be a seperate efforts

Related to #17949.

I will make more test before making this a former PR


AI Disclosure

  • Model: grok
  • Platform/Tool: Cursor
  • Human Oversight: human reviewed and instruct AI for code reuse

Expose Iceberg changelog scans through Spark 4.2 native CDC APIs for batch and streaming reads. Require v3 row lineage so Spark can remove copy-on-write carry-over rows and derive update pre/post images correctly.\n\nRelated to apache#17949\n\nGenerated-by: Cursor
@github-actions github-actions Bot added the spark label Sep 4, 2026
Xin Huang added 4 commits September 4, 2026 17:28
Persist the CDC initial offset using the same source checkpoint mechanism as regular Iceberg streams and cap AvailableNow at a snapshot boundary.

Generated-by: Cursor
Apply Spotless formatting after validating through the Databricks Maven proxy.

Generated-by: Cursor
Extract common offset, partition, checkpoint, and AvailableNow handling while keeping changelog planning atomic at snapshot boundaries.

Generated-by: Cursor
- Preserve streaming bounds and filter complete commits.
- Keep projections stable and validate row lineage and timestamps.
- Cover CDC, legacy readers, and checkpoint recovery regressions.

Refs apache#17953

Generated-by: Codex
Xin Huang added 2 commits September 15, 2026 22:09
Allow raw COW changes from v2+ history when deduplicationMode=none and
computeUpdates=false, exposing missing row lineage as null. Keep lineage
validation for post-processing and reject history without commit sequence
numbers.

Cover raw batch output, streaming checkpoint restart, and unsupported
configurations. Resolve Checkstyle violations in the CDC implementation.

Refs apache#17953

Generated-by: Codex
Add an explicit identifier-columns mode for native CDC batch reads without
row lineage. Reuse the changelog view iterators to remove carry-over and
pair updates by business key within each commit.

Keep lineage-based reads unchanged and reject unsupported business-key
streaming and deduplication modes. Cover procedure parity, composite keys,
key changes, projection and filter behavior, and missing extensions.

Document configuration, output semantics, and support boundaries.

Refs apache#17953

Generated-by: Codex
@github-actions github-actions Bot added the docs label Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant