Skip to Content
New EngineQuery DataOverview

Spiral SQL is parsed with a dialect compatible with common analytical SQL, then bound into Spiral’s relation plan. The current user-facing surface is a focused subset for local inspection, data selection, batch shaping, and extension work.

  • SELECT queries over one table or one table function.
  • VALUES queries.
  • Projection, filtering, grouping, aggregate functions, HAVING, ORDER BY, LIMIT, and OFFSET.
  • Scalar and aggregate function calls through the SPQL function catalog, including named arguments.
  • Built-in table functions for metadata, local Vortex files, Arrow IPC files, Parquet files, and Hugging Face dataset handles.
  • EXPLAIN and EXPLAIN ANALYZE.
  • CREATE VIEW and materialized CREATE TABLE name AS query catalog entries.
  • COPY TO local Vortex and Arrow IPC files.
  • SET trace diagnostics.
  • REPL-local CREATE TABLE name (...) and INSERT for in-memory tables.

Unsupported syntax should fail with an explicit error rather than silently changing query semantics.

Example query

SELECT category, count(*) AS rows, sum(score) AS total_score FROM examples WHERE active IS NOT NULL GROUP BY category HAVING count(*) > 10 ORDER BY total_score DESC LIMIT 20;

Query paths

Query forms

Spiral supports standard SELECT:

SELECT id, score FROM events WHERE score > 0.8 LIMIT 10;

It also parses DuckDB-style FROM-first queries:

FROM events SELECT id, score WHERE score > 0.8 LIMIT 10;

Use the standard form in docs and examples unless FROM-first syntax is the point of the example.

Namespaces

Scalar and aggregate functions resolve through the engine callable catalog. Unqualified scalar calls are mapped to the spql. namespace when possible:

SELECT add(a, b) FROM t; SELECT spql.add(a, b) FROM t;

Table and source functions use their full registered id:

SELECT * FROM spql.meta.table_functions(); SELECT * FROM spql.meta.source_functions(); SELECT * FROM spql.parquet.read('./scores.parquet');

Use SQL support when you need an exact current implementation matrix.

Last updated on