Skip to content

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

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

lxy-9602 wants to merge 11 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
@lxy-9602
lxy-9602 marked this pull request as ready for review October 7, 2026 02:41
Comment thread src/paimon/common/table/special_fields.h
Comment thread src/paimon/core/realtime/realtime_deduplicate_writer.cpp

@zjw1111 zjw1111 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Three issues in the realtime deduplication path.

Comment thread src/paimon/core/table/source/append_only_table_read.cpp
Comment thread src/paimon/core/realtime/realtime_key_offset_index.cpp Outdated
Comment thread src/paimon/core/realtime/realtime_deduplicate_writer.cpp

@zjw1111 zjw1111 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One inline comment on key-offset index memory accounting.

Comment thread src/paimon/core/realtime/realtime_key_offset_index.cpp
@zjw1111

zjw1111 commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Please add user-facing documentation for the realtime feature, covering append tables and primary-key tables, their behavior in realtime mode, and configuration and usage examples for enabling it. Please also document the additional schema and option requirements for realtime deduplication, including _REALTIME_OFFSET, realtime.deduplicate-key-fields, deletion vectors, and the offset bitmap index.

@lxy-9602

Copy link
Copy Markdown
Member Author

Please add user-facing documentation for the realtime feature

This feature is still under development. We don’t expect external users to use it yet. Once it’s complete, we’ll add the corresponding user documentation.

Comment thread src/paimon/core/realtime/realtime_deduplicate_writer.cpp Outdated
Comment thread src/paimon/core/realtime/arrow_deduplicate_realtime_store.cpp

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.

2 participants