Files
lancedb/docs/src/js/interfaces/QueryExecutionOptions.md
T
Xuanwo beda423318 fix(node): bind blob byte queries to their response snapshot (#5019)
TypeScript remote `toArrow` and `toArray` could combine scalar values
from query snapshot A with Blob payloads from a later snapshot B. Cached
table schemas and native descriptor layouts could also leave descriptors
in a `blobMode: "bytes"` result.

Discover Blob fields and snapshot provenance from the executed query
stream, recognizing canonical native v2 descriptors as well as
extension-marked fields. Fetch payloads through an independent Rust
snapshot handle bound to the query version and immutable dataset
identity, without changing the live table. Preserve aliases, nested
fields, NULL/empty values, explicit row IDs, and scalar-only results.
Hybrid byte queries require matching provenance from both actual
responses. Missing or mismatched server provenance fails explicitly;
logical-input validation and local materialization remain unchanged.

Manual integration validation at `4daf354df`: all five real SDK/NAPI →
Sophon REST scenarios passed. Both `toArrow` and `toArray` retain A
bytes across overwrite and reject same-name/same-URI recreation even
when version and row IDs are reused. A previously cached handle
discovers a subsequently added Blob field. Ten actual payload fetches
include the two expected identity rejections; later queries on the same
live handle read B. The canonical-descriptor and Blob regression suites
pass 119 tests, with independent source and wire-evidence review.
Earlier broader SDK and hybrid evidence is retained within its
unchanged-source scope.

This is local REST interoperability evidence, not deployed
Cloud/header-forwarding acceptance. Remote bytes require the
authoritative server version/identity and fetch-echo contract. CI and
formal review remain merge requirements; this follow-up does not close
ENT-3556 or Blob V2 GA.
2026-11-14 20:52:50 +08:00

1.9 KiB

@lancedb/lancedb • Docs


@lancedb/lancedb / QueryExecutionOptions

Interface: QueryExecutionOptions

Options that control the behavior of a particular query execution

Properties

blobMode?

optional blobMode: BlobMode;

How to return blob v2 columns. Applies to toArrow() and toArray().

  • "descriptions" (default): each blob is a descriptor. Read the bytes with Table.fetchBlobs or Table.fetchBlobFiles.
  • "bytes": each blob column, including blobs nested in structs, holds the bytes as LargeBinary. The query also reads _rowid to fetch them, and leaves it out of the result unless QueryBase.withRowId was called. All the bytes are held in memory.

Selecting a parent struct or directly aliasing a blob or struct also returns bytes. Blobs inside lists keep their descriptors. Arbitrary projection expressions are not materialized as bytes.

The rows and bytes come from the same snapshot. Remote queries require authoritative query version and snapshot identity headers, verified again by the blob response. Older servers can still return "descriptions". Local queries retry up to three times if the table changes while they run.

Example

const rows = await table
  .query()
  .select(["id", "image"])
  .toArray({ blobMode: "bytes" });
const image: Uint8Array | null = rows[0].image;

maxBatchLength?

optional maxBatchLength: number;

The maximum number of rows to return in a single batch

Batches may have fewer rows if the underlying data is stored in smaller chunks.


timeoutMs?

optional timeoutMs: number;

Timeout for query execution in milliseconds

The timeout also covers reading the results, so consuming them slowly can exceed it.