Skip to content

feat(realtime): support user-defined-key deduplication for append tables - #393

Draft
lxy-9602 wants to merge 3 commits into
apache:mainfrom
lxy-9602:rt-dv
Draft

lxy-9602 wants to merge 3 commits into
apache:mainfrom
lxy-9602:rt-dv

Conversation

@lxy-9602

Copy link
Copy Markdown
Member

Purpose

Linked issue: #158

Add a high-performance real-time deduplication mode for append tables.

The mode keeps append writes efficient while using deletion vectors to hide replaced or deleted rows in real time. Data files remain ordinary append-table files, so all predicates and file indexes can still be used for pruning and pushdown across data files, sealed segments, and building data.

Rows are deduplicated with last-write-wins semantics using a user-defined key, providing efficient real-time updates without introducing merge-tree read overhead.

This change adds:

  • realtime.deduplicate-key-fields;
  • key-to-offset indexes for memory and data files;
  • deletion-vector generation for replaced or deleted rows;
  • consistent reads across data files, sealed segments, and building data;
  • committed snapshot refresh and memory reclamation.

Current limitations: one non-null key field, fixed buckets, no data evolution or real-time spill, and _REALTIME_OFFSET requires a bitmap file index.

Tests

Added unit and integration coverage for:

  • schema and option validation;
  • key/offset index lookup;
  • INSERT, DELETE, and UPDATE semantics;
  • deduplication across batches, segments, and committed files;
  • read-view stability, partition/bucket isolation, and predicate pushdown.

API and Format

API impact: adds the deduplicate option and real-time store mode (realtime.deduplicate-key-fields).

Format impact: deduplicate tables persist _REALTIME_OFFSET, key-to-offset sidecars, and deletion vectors. Existing table modes are unchanged.

Documentation

Generative AI tooling

Generated-by: OpenAI Codex (GPT-5)

@lxy-9602
lxy-9602 marked this pull request as draft September 27, 2026 01:04

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