Skip to content

feat(data): add filter-based merge-on-read deletion - #1182

Draft
wirybeaver wants to merge 1 commit into
apache:mainfrom
wirybeaver:feature/mor-delete-by-filter
Draft

wirybeaver wants to merge 1 commit into
apache:mainfrom
wirybeaver:feature/mor-delete-by-filter

Conversation

@wirybeaver

Copy link
Copy Markdown

Depends on #919. The filter-based operation is the final commit on this branch.

Motivation

A caller deleting rows by predicate should be able to pass the table and filter and let the library find the matching positions. This supplies the higher-level merge-on-read caller for the write helper in #919.

Modification

MergeOnReadDelete(table, filter) plans against an explicit snapshot and resolves the predicate against the current table schema. It reads live rows using the scan’s FileIO, enforces residual predicates, and groups absolute row positions by data file.

table + filter -> pinned scan -> matching live positions
               -> v2 Parquet deletes or merged v3 DVs
               -> RowDelta validated from the scanned snapshot

The operation honors the configured delete isolation level. An empty match leaves the snapshot unchanged. Matching positions are buffered in memory before writing.

Test

In-library integration tests use real Parquet and Puffin encoding with an in-memory catalog. A v3 test starts with a previously deleted row, renames the filter column, deletes another row by its new column name, and checks the exact survivors after reloading. Repeating the predicate creates no snapshot. Other cases cover a v2 predicate delete followed by upgrade, and an acknowledged-as-unknown commit whose published DV remains readable.

This branch has not been deployed

No deployments
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