Skip to content

SQL Overview ​

Arneb supports a broad subset of ANSI SQL. This section documents all supported statements, expressions, and functions.

Supported Statements ​

StatementDescription
SELECTQuery data with filtering, grouping, ordering, and joins
EXPLAINDisplay the query execution plan
CREATE TABLECreate a new table
DROP TABLERemove a table
CREATE TABLE AS SELECTCreate a table from a query result
INSERT INTOInsert rows into a table
DELETE FROMDelete rows from a table
CREATE VIEWCreate a named view
DROP VIEWRemove a view

Query Capabilities ​

Arneb supports the following query features:

  • Joins: INNER, LEFT, RIGHT, FULL OUTER, CROSS, and semi-joins
  • Aggregations: GROUP BY with HAVING, GROUP BY ROLLUP(...) with GROUPING(...), aggregate functions (COUNT, SUM, AVG, MIN, MAX, and the variance family STDDEV, STDDEV_SAMP, STDDEV_POP, VARIANCE, VAR_SAMP, VAR_POP)
  • Subqueries: Scalar, IN, and EXISTS subqueries
  • CTEs: Common Table Expressions via WITH clauses
  • Set Operations: UNION ALL, UNION, INTERSECT, EXCEPT
  • Window Functions: ROW_NUMBER, RANK, DENSE_RANK, and aggregate window functions with PARTITION BY and ORDER BY, plus the ROWS UNBOUNDED PRECEDING frame
  • Ordering and Limiting: ORDER BY (including on aliases and aggregates), LIMIT, OFFSET

Session Settings ​

PostgreSQL clients can set the schema used for unqualified table names, per connection:

sql
SET search_path = tpch;             -- a schema in the default catalog
SET search_path TO datalake.tpch;   -- catalog.schema
SHOW search_path;
RESET search_path;                  -- back to the server default
  • Like Trino, Arneb has one current schema: the first entry that names an existing schema is used. If none does — for example PostgreSQL's default "$user", public, or public, which Arneb doesn't have — the server's default schema is kept, so tools that send these keep working.
  • The setting lasts for the rest of the connection, including SET LOCAL.
  • Fully qualified names (catalog.schema.table) are always resolved as written.

Trino clients set the catalog and schema with USE instead; see Trino Clients.

Statement timeout ​

sql
SET statement_timeout = '30s';      -- also 30000 (ms), '2min', '1h'; 0 = off
SHOW statement_timeout;             -- 30s
RESET statement_timeout;            -- back to the server default

A statement still running when the timeout expires (counting any time spent waiting in the admission queue, as in PostgreSQL) is cancelled on every node and fails with ERROR 57014 canceling statement due to statement timeout; the connection stays usable. An invalid value is 22023. The server default is [admission] statement_timeout (Admission Control).

Resource errors ​

SQLSTATEMeaning
53200The query exceeded its per-node memory limit (query_max_memory_per_node).
53000The admission queue is full (max_queued_queries).
57014The statement timed out (statement_timeout).

Further Reading ​

  • Expressions — operators, CASE, CAST, LIKE, and more
  • Functions — all 90 built-in scalar functions (Trino-compatible)
  • Advanced — CTEs, window functions, set operations