Skip to content

fix(blob): support unknown-length BlobDescriptor ranges#521

Open
QuakeWang wants to merge 1 commit into
apache:mainfrom
QuakeWang:fix/blob-range
Open

fix(blob): support unknown-length BlobDescriptor ranges#521
QuakeWang wants to merge 1 commit into
apache:mainfrom
QuakeWang:fix/blob-range

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

Purpose

BlobDescriptor.length == -1 means reading from offset to EOF. The dedicated BLOB writer cast this value to u64, while the blob-descriptor-field resolver rejected it as negative, causing inconsistent behavior across table configurations.

Brief change log

  • Centralize BlobDescriptor range validation and unknown-length handling.
  • Resolve length == -1 in both dedicated BLOB writes and inline descriptor reads.
  • Reject invalid ranges and short reads instead of producing inconsistent blob data.
  • Add end-to-end coverage for both paths.

Tests

  • cargo test -p paimon --all-targets --features fulltext,vortex
  • cargo test -p paimon-datafusion --test blob_tests

API and Format

No API or storage format change. This implements the existing BlobDescriptor protocol semantics.

Documentation

Documented the length == -1 behavior and range constraints.

Dedicated blob writers cast descriptor lengths to u64, while inline resolvers rejected negative lengths. This broke valid Java descriptors with length -1.

Treat -1 as offset-to-EOF in both paths, validate ranges, and reject short reads before they can produce inconsistent blob data.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
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