Skip to content

[core] Support appending shards to centroid indexes - #1595

Open
JingsongLi wants to merge 1 commit into
apache:mainfrom
JingsongLi:codex/centroid-append-shards
Open

JingsongLi wants to merge 1 commit into
apache:mainfrom
JingsongLi:codex/centroid-append-shards

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

Purpose

Port centroid shard appends from apache/paimon#11712. Rows added to a partition with a centroid vector index can be indexed incrementally using that partition's existing routing model.

Related to #1490.

Brief change log

  • Plan against the latest snapshot and current schema. Extend an adjacent range atomically while reusing its existing index files, and give disconnected rows their own range.
  • Use batch-local row IDs for routed vector searches, Bitmap sidecars, and deletion filters. Validate changes to source rows after the scan snapshot before publishing reused files.
  • Respect per-call update policies in range refresh while preserving Bitmap coverage. Use the physical write-column projection to identify changes to indexed fields.
  • Expose append_shards() in Rust and Python and CALL sys.add_global_index_shards in DataFusion.

Tests

  • cargo test -p paimon --lib --test centroid_java_interop_test --locked passed 5,211 core tests and 3 interoperability tests. Rust can extend the Java-written shard and Bitmap fixture.
  • RUST_MIN_STACK=16777216 cargo test -p paimon-datafusion --test read_tables --test procedures --test global_index_schema_evolution --test remaining_compat --locked passed 160 tests.
  • Java's CentroidTableInteropTest passed 5 tests against the regenerated Rust fixture.
  • Python binding compilation, Clippy, and formatting checks passed.

API and Format

New centroid descriptors use Java's 30-byte header with batch offsets and sizes. Rust reads legacy centroid descriptors and upgrades the descriptors of retained files during a range extension. The SQL procedure returns a nullable Boolean result. A disconnected range containing only null vectors records coverage with an empty router.

Documentation

Document the SQL procedure, builder entry points, and interoperability fixture.

Codex assisted with implementation, review, and regression tests.

Port the centroid shard append behavior from apache/paimon#11712, including batch-aware reads, atomic range extension, and Rust, Python, and DataFusion entry points.
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