Skip to content

feat(metadata): MDT posting-block schema foundation for vector index#19300

Open
chrevanthreddy wants to merge 1 commit into
apache:masterfrom
chrevanthreddy:rfc-104-foundation
Open

feat(metadata): MDT posting-block schema foundation for vector index#19300
chrevanthreddy wants to merge 1 commit into
apache:masterfrom
chrevanthreddy:rfc-104-foundation

Conversation

@chrevanthreddy

Copy link
Copy Markdown
Contributor

Describe the issue this Pull Request addresses

Adds the Metadata Table (MDT) storage foundation for native vector search proposed in RFC-104 (umbrella #19094): the Avro record types, payload wiring, partition type, and posting-block codec that later PRs (encoder, bootstrap, read path) build on.

Closes #19097

Summary and Changelog

Users gain no behavior change yet; this establishes the on-disk/serde contract for the vector index so subsequent PRs can encode, write, and read it.

Changes (all in hudi-common, additive):

  • HoodieMetadata.avsc: seven vector index record types — centroids, quantizer, manifest, cluster stats, posting block, posting delta, tombstone.
  • HoodieMetadataPayload: new VectorIndexMetadata field, entry-type constants, and serde for the vector records (co-exists with existing record-index logic).
  • MetadataPartitionType.VECTOR_INDEX: new partition type plus record-type wiring.
  • HoodieTableMetadataUtil: posting-key → file-group mapping.
  • Posting block codec: PostingBlockBuilder / PostingBlockView (structure-of-arrays packing of ~1–4K vectors per record).
  • Vector index enums: VectorIndexOptions, VectorIndexType, VectorDistanceMetric.
  • MDT raw keys: VectorIndexMetadataKey, VectorPostingPrefixRawKey, VectorClusterRawKey, VectorGenerationManifestRawKey.
  • Tests: TestVectorDistanceMetric, TestVectorIndexMetadataKey, TestVectorIndexMetadataPayload (17 cases). Existing HoodieMetadataRecord all-args callers (TestAvroRecordSizeEstimator, TestBufferedRecordSerializer) updated for the appended field.

Impact

Adds one nullable field (VectorIndexMetadata) to the HoodieMetadataRecord Avro schema and a new MetadataPartitionType. The field is optional/defaulted, so existing MDT records and readers are unaffected; the new partition type is inert until a vector index is created (later PRs). No public API removed. No performance impact on existing partitions.

Risk Level

low

Schema change is purely additive (new nullable field + new record types + new partition type), exercised by unit tests; existing metadata read/write paths are untouched apart from the appended constructor arg, which is covered by the updated tests. Full hudi-common compiles and tests pass on current master under JDK17.

Documentation Update

none (user-facing docs land with the feature-complete read/write PRs). The design is documented in RFC-104 (#19291).

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

@hudi-bot

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Add the Metadata Table storage foundation for native vector search:
- HoodieMetadata.avsc: vector index record types (centroids, quantizer,
  manifest, cluster stats, posting block, posting delta, tombstone)
- HoodieMetadataPayload: VectorIndexMetadata field, entry-type constants, serde
- MetadataPartitionType.VECTOR_INDEX partition type + record-type wiring
- HoodieTableMetadataUtil: vector posting key -> file-group mapping
- posting block codec (PostingBlockBuilder/View, structure-of-arrays)
- vector index options/type/metric enums
- MDT raw keys (VectorIndexMetadataKey, posting prefix, cluster, manifest)

Tests: TestVectorDistanceMetric, TestVectorIndexMetadataKey,
TestVectorIndexMetadataPayload (17 cases). Existing HoodieMetadataRecord
all-args callers updated for the appended field.

Compiles + tests green standalone on current master (hudi-common, JDK17).
Part of apache#19094; resolves apache#19097.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL PR with lines of changes > 1000

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MDT row families and payload schema for vector indexes

2 participants