Skip to content

本页尚未翻译

本页内容仍为英文原文,源自官方文档 sql/dql/blob-descriptor。中文翻译正在分批进行中。

BLOB_DESCRIPTOR ​

The blob_descriptor() scalar function: a BlobV2 column's payload location, without reading it.

Applies to: Embedded ❌, Enterprise ✅

sql
SELECT id, blob_descriptor(video) AS descriptor FROM videos

A BlobV2 column's bytes are not fetched by a plain SELECT: that already returns large_binary, the same as any other binary column. blob_descriptor instead returns a small struct describing where the payload lives, without reading it. Pass one row's descriptor to the SDK's blob file reader to open that payload directly:

python
rows = db.execute_query("SELECT id, blob_descriptor(video) AS descriptor FROM videos").read_all().to_pylist()
with table.open_blob_file(rows[0]["descriptor"]) as reader:
    payload = reader.read()

A descriptor is pinned to the table version it was read at: it keeps resolving correctly even after the table is appended to and checked out to a newer version.

Managed blobsThe BlobV2 column type this function describes.