Skip to Content

Vortex files are the primary local data source in the current client. Register them in the REPL with .open or .load:

.open table_name ./part-000.vortex ./part-001.vortex

.load is an alias for .open.

Spiral reads Vortex metadata and exposes the file set as one relation. The relation schema comes from the file data type.

For one-off SQL queries, use the built-in table function instead:

SELECT * FROM spql.vortex.read('./part-000.vortex') LIMIT 20;

The table function accepts one literal path and uses an ordinal key. Use .open when you need multiple files under one logical table or want to declare a sorted unique key.

Syntax

.open <table> <path> [path ...] [--key col[,col...]] .open <table> <path> [path ...] [--key=col[,col...]]

<table> is the session-local table name. Paths must be valid UTF-8 paths to Vortex files.

Inspect loaded files

.tables .schema table_name

.tables shows the table kind, file count, and key. .schema prints field names and Vortex data types.

Keys

By default, a loaded file set is ordinal-keyed:

.open events ./events.vortex

If the data is sorted by a unique key, pass the key explicitly:

.open events ./events.vortex --key event_time,event_id

Keys are part of Spiral’s relational contract. They let the engine preserve and exploit ordering in scans, grouping, and later multimodal planning.

Multiple files

Pass multiple explicit paths to register a logical table backed by several Vortex files:

.open lineitem ./lineitem-000.vortex ./lineitem-001.vortex --key l_orderkey,l_linenumber

The interactive REPL does not expand globs. Pass explicit paths, or generate an expanded .open command before pasting it into the REPL.

Querying

Once registered, a Vortex file-backed table is queried through the local memory catalog:

SELECT * FROM memory.lineitem LIMIT 20;
SELECT l_returnflag, count(*) AS rows FROM memory.lineitem GROUP BY l_returnflag ORDER BY rows DESC LIMIT 10;

Scope

File registrations are session-local. Restarting the REPL clears the table catalog; it does not modify the Vortex files.

Last updated on