Skip to main content
Version: v1.10

SQL Reference

This section provides a comprehensive reference for SQL support in Spice.ai, including syntax, data types, operators, functions, and system features. The reference is organized by topic for ease of navigation.

Table of Contents

SELECT Syntax

Subqueries

EXPLAIN

Information Schema

AI Functions

Operators and Literals

Scalar Functions

Spark-compatible scalar functions such as array, bit_get, date_add, like, and parse_url follow the semantics documented in the Spark SQL built-in function reference.

Aggregate Functions

JSON Functions and Operators

Prepared Statements

DML (Data Manipulation Language)

Data Types

Spice uses Apache Arrow data types internally. For data type compatibility with accelerators, see [Data Type Reference(../datatypes/index.md). Common SQL types include:

SQL TypeDescription
INT, BIGINTInteger types
FLOAT, DOUBLEFloating-point types
VARCHAR, TEXTString types
BOOLEANBoolean type
TIMESTAMPTimestamp with nanosecond precision
DATEDate type
DECIMALArbitrary precision numeric

Use CAST(expression AS type) or expression::type to convert between types.

Refer to each section for detailed syntax, supported features, and examples.