Skip to content

[AURON #2434] Support full-data-file Iceberg changelog deletes - #2435

Open
weimingdiit wants to merge 1 commit into
apache:masterfrom
weimingdiit:feat/iceberg-changelog-full-file-delete
Open

[AURON #2434] Support full-data-file Iceberg changelog deletes#2435
weimingdiit wants to merge 1 commit into
apache:masterfrom
weimingdiit:feat/iceberg-changelog-full-file-delete

Conversation

@weimingdiit

Copy link
Copy Markdown
Contributor

Which issue does this PR close?
Closes #2434

Rationale for this change
Auron native Iceberg changelog scan currently supports insert-only changelog tasks.

Full-data-file delete changelog tasks can be executed natively without row-level delete-file handling. Auron can scan the deleted data file directly and materialize changelog metadata from the Iceberg changelog task.

Supporting this case improves native Iceberg changelog scan coverage while keeping more complex delete and update semantics on Spark's reader.

What changes are included in this PR?
Allows native Iceberg changelog scan to accept DeletedDataFileScanTask when:

  • the changelog operation is DELETE
  • existingDeletes() is empty

Keeps existing native support for AddedRowsScanTask when:

  • the changelog operation is INSERT
  • deletes() is empty

Keeps fallback behavior for unsupported changelog tasks, including row-level deletes, position/equality deletes, update changelog tasks, mixed file formats, and delete tasks with existing delete files.

Adds coverage for:

  • full-data-file delete changelog native scan
  • a changelog range that contains both insert tasks and full-data-file delete tasks

Are there any user-facing changes?
No user-facing API changes. More Iceberg changelog scans can now be executed natively by Auron.

How was this patch tested?
UT.

Allow native Iceberg changelog scan to handle DeletedDataFileScanTask
when the task represents a DELETE operation and has no existing delete
files.

Keep existing support for insert changelog tasks and continue falling
back for row-level deletes, position/equality deletes, update changelog
tasks, mixed file formats, and delete tasks with existing deletes.

Add tests for full-data-file delete changelog scans and mixed
insert/delete changelog ranges.

Signed-off-by: weimingdiit <weimingdiit@gmail.com>

@merrily01 merrily01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weimingdiit Thanks for the contribution. The implementation looks correct to me, just a few comments inline.

test("iceberg changelog scan falls back when delete changes exist") {
withTable("local.db.t_changelog_delete") {
withTempView("t_changelog_delete_changes") {
test("iceberg native scan supports mixed insert and full-data-file delete changelog scan") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This replaces the previous falls back when delete changes exist test, which covered row-level deletes. Could we keep a dedicated fallback test (e.g. non-partitioned table with a position delete, or a DeletedDataFileScanTask with non-empty existingDeletes())? It would help guard against regressions on the row-level delete / update paths.

deletesEmpty(added.deletes()) =>
Some(NativeChangelogDataFileTask(added.file(), added.start(), added.length(), added))
case deleted: DeletedDataFileScanTask
if deleted.operation() == ChangelogOperation.DELETE &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: deleted.operation() == ChangelogOperation.DELETE is always true. How about dropping it or adding a comment for clarity?

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.

Support full-data-file delete Iceberg changelog tasks in native scan

2 participants