Skip to Content

spiral-io owns spql.io.Blob, a structural extension dtype for external byte payloads resolved by spiral-io. Sessions register it with SpiralIoPlugin or spiral_io::initialize(session).

spql.io.Blob does not store inline bytes. Inline byte values use Vortex binary columns. A table writer may later externalize binary values into managed blob storage when the target table schema requires spql.io.Blob.

Storage Shape

A Blob stores these nullable fields:

FieldMeaning
uriExternal payload URI resolved by spiral-io.
offsetOptional byte offset; null means the start of the object.
sizeOptional byte size of this Blob range; null means through end of object.
mime_typeOptional MIME type.
etagOptional provider ETag for validation.
version_idOptional provider object version id.
generationOptional provider object generation.
md5Optional MD5 digest for the Blob bytes.
sha1Optional SHA-1 digest for the Blob bytes.
sha256Optional SHA-256 digest for the Blob bytes.

Blob construction does not read bytes. Reads happen only when a function such as spql.image.jpeg or spql.image.exif materializes the payload.

Functions

SELECT spql.io.blob('file:///tmp/photo.jpg', mime_type => 'image/jpeg') AS image_blob;

spql.io.blob(uri, offset?, size?, mime_type?, etag?, version_id?, generation?, md5?, sha1?, sha256?) constructs an external Blob over a byte range. Reads resolve through spiral-io; the default providers support bare local paths, file:// with an empty or localhost authority, and http:// or https:// URLs.

Use accessor functions to project metadata:

SELECT spql.io.uri(image_blob) AS uri, spql.io.size(image_blob) AS size, spql.io.sha256(image_blob) AS sha256 FROM photos;

HTTP reads require byte-range support. Servers must return 206 Partial Content with a valid Content-Range for requested ranges; servers that ignore range requests or omit range metadata fail instead of falling back to a full download. Other schemes require a registered provider and fail at read time when none is available.

Type Factories

blob() is available as an extension dtype factory in casts and schema-facing surfaces when spql.io is registered. It constructs the spql.io.Blob dtype.

Last updated on