Skip to Content
New EngineLoad DataFile Table Functions

The default spiral sql session registers local file readers as SQL source functions. Use them in FROM when you want a one-off query without first registering a REPL table with .open.

Vortex

SELECT * FROM spql.vortex.read('./events.vortex') LIMIT 20;

spql.vortex.read(path) requires a literal, non-null UTF-8 path or file:// URI to a struct-typed Vortex file. It resolves the source through spiral-io, opens the file footer during binding to discover the schema, then plans a Vortex scan with an ordinal key.

For repeated interactive work, prefer .open so the file is available through a shorter table name and can be given a declared key.

Arrow IPC

SELECT id, score FROM spql.arrow.read_ipc('./scores.arrow') ORDER BY score DESC LIMIT 10;

spql.arrow.read_ipc(path) requires a literal local path to an Arrow IPC file-format file. The current implementation reads IPC batches into a Values logical plan; it is useful for local interchange and tests, not for large compressed-native scans.

Arrow IPC is also available as a COPY TO output format:

COPY ( SELECT id, score FROM spql.arrow.read_ipc('./scores.arrow') ) TO './scores-copy.arrow' WITH (FORMAT arrow_ipc);

FORMAT arrow is the canonical name; arrow_ipc is accepted as an alias.

Parquet

SELECT id, score FROM spql.parquet.read('./scores.parquet') WHERE score > 0.9;

spql.parquet.read(path) requires a literal local path. It reads through a scan source, so simple projections, filters, and limits can be pushed into the Parquet reader. It does not register a Parquet COPY TO writer.

Hugging Face Handles

SELECT repo_id, config_name, split_name, source_uri, dataset_ref FROM hf.dataset('openai/gsm8k', 'main', 'train');

hf.dataset(repo, config, split, revision) creates a one-row dataset handle relation. It records provenance fields such as repo_id, source_uri, snapshot_id, and dataset_ref. It does not contact the Hugging Face Hub or infer arbitrary dataset row schemas yet.

Argument Rules

The SQL binder supports positional and named table-function arguments. Each function still owns its own binding contract. The file readers above require literal path strings so pre-resolution can discover the output schema.

Last updated on