Skip to content

feat(io): accept block_size as a storage option - #9380

Merged
wjones127 merged 1 commit into
lance-format:mainfrom
dshepelev15:perf/io-coalesce-gap
Sep 18, 2026
Merged

wjones127 merged 1 commit into
lance-format:mainfrom
dshepelev15:perf/io-coalesce-gap

Conversation

@dshepelev15

@dshepelev15 dshepelev15 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Problem

block_size is the gap below which the I/O scheduler merges two reads of one file into a single request (4 KiB for local files, 64 KiB for object stores). It is the knob for random access to rows of several KB spread across a file: the same take of 2048 rows over 8 fragments of 2.0 files costs 1,352 requests / 143 MiB at 64 KiB, 589 requests / 243 MiB at 256 KiB and 220 requests / 420 MiB at 1 MiB (counted with io_stats_incremental).

Today it can only be set through a dedicated parameter: ObjectStoreParams::block_size in Rust, lance.dataset(block_size=...) in Python, ReadOptions.blockSize in Java. Integrations that only forward storage_options (LanceDB, the Spark and Ray connectors, namespace catalogs, config-driven deployments) cannot set it, although every other store setting goes through that map.

Change

  • StorageOptions::block_size() parses a block_size option given in bytes. Non-numeric values are rejected with an InvalidInput error instead of being ignored.
  • ObjectStoreParams::resolved_block_size(): the explicit parameter wins, then the storage option, then the store's default.
  • Applied once in ObjectStoreRegistry::build_store, so every provider honours it the same way, and in the custom object_store path.
  • Documented in the general storage options table.

The defaults do not change. The bindings pass storage_options through untouched, so no binding changes are needed.

Tests

  • test_block_size_used_cloud / test_block_size_used_file extended: the option sets the block size when no parameter is given, and the explicit parameter wins over the option.
  • test_block_size_option_rejects_invalid_values: a non-numeric value is rejected.

@github-actions github-actions Bot added A-encoding Encoding, IO, file reader/writer A-docs Documentation enhancement New feature or request labels Sep 18, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 18, 2026
block_size is the gap below which the I/O scheduler merges two reads of one
file into a single request, and it is the knob for random access to rows of
several KB spread across a file. It could only be set through the Rust
ObjectStoreParams field or the Python dataset argument. It is now also read
from the block_size storage option, resolved once when the registry builds a
store so every provider honours it; the explicit parameter still wins and
invalid values are rejected.
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 18, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gate recommendation: approve.

The revision keeps resolution centralized at store construction and preserves the existing defaults and explicit-parameter precedence. Narrowing validation to malformed numeric strings aligns the storage option with the existing dedicated parameter while retaining consistent behavior across local and cloud providers.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 18, 2026

@wjones127 wjones127 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@wjones127
wjones127 merged commit 5a69fee into lance-format:main Sep 18, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Documentation A-encoding Encoding, IO, file reader/writer enhancement New feature or request K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants