Use this guide when you already have one or more Vortex files and want to check their schema and sample rows from the Spiral REPL.
Start with a low display limit
./target/debug/spiral sql --max-rows 20--max-rows limits the REPL preview size by collecting at most one extra row
for display. Use an explicit SQL ORDER BY ... LIMIT when you need a
deterministic sample.
Open the file
.open sample ./sample.vortexThe REPL prints the registered table name, file count, and key:
opened `sample` (1 file(s), ordinal key)Inspect schema
.tables
.schema sampleUse .schema with no argument to print all registered table schemas.
Query a sample
Opened files are registered as local REPL tables in the memory catalog.
SELECT *
FROM memory.sample
LIMIT 20;For a quick column check:
SELECT count(*) AS rows
FROM memory.sample;Declare a key when you know one
If the file is sorted by a unique column or column tuple, reopen it with
--key:
.open sample ./sample.vortex --key idor:
.open sample ./sample.vortex --key=idUse comma-separated columns for a compound key:
.open lineitem ./lineitem.vortex --key l_orderkey,l_linenumberOnly declare a column key when the data is sorted by that key and every key is
unique. When in doubt, omit --key and use the ordinal key.
Register multiple files
Pass every path explicitly:
.open events ./part-000.vortex ./part-001.vortex ./part-002.vortex --key event_idThe interactive REPL does not expand shell globs. If you want to use shell
expansion, generate the .open command outside the REPL and paste the expanded
paths.