Reserved words are literals used as keywords by the SQL language which should not be used as identifiers to avoid unexpected behavior.
Reserved schema names have special meaning to Databricks Runtime.
Databricks Runtime does not formally disallow any specific literals from being used as identifiers.
The following list of identifiers can be used anywhere, but Databricks Runtime treats them preferentially as keywords within expressions in certain contexts:
Future use as a column default.
The SQL boolean
The SQL boolean
Use back-ticks (`
NULL` and `
DEFAULT`) or qualify the column names with a table name or alias.
Databricks Runtime uses the
CURRENT_ prefix to refer to some configuration settings or other context variables.
The underbar (
_) prefix is intended for Databricks Runtime pseudo columns.
An existing pseudo column is the _metadata column.
Identifiers with these prefixes are not treated preferentially. However, avoid columns or column aliases using these prefixes to avoid unexpected behavior.
Databricks Runtime reserves the following list of schema names for current or future use:
Future use to qualify builtin functions.
Future use to qualify temporary views and functions.
Holds the SQL Standard information schema.
Database names starting with
Avoid using these names.
Databricks Runtime does not enforce ANSI reserved words. The following list of SQL2016 keywords is provided for informational purposes only.
ALL, ALTER, AND, ANY, ARRAY, AS, AT, AUTHORIZATION
BETWEEN, BOTH, BY
CASE, CAST, CHECK, COLLATE, COLUMN, COMMIT, CONSTRAINT, CREATE, CROSS, CUBE, CURRENT, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER
DELETE, DESCRIBE, DISTINCT, DROP
ELSE, END, ESCAPE, EXCEPT, EXISTS, EXTERNAL, EXTRACT
FALSE, FETCH, FILTER, FOR, FOREIGN, FROM, FULL, FUNCTION
GLOBAL, GRANT, GROUP, GROUPING
IN, INNER, INSERT, INTERSECT, INTERVAL, INTO, IS
LEADING, LEFT, LIKE, LOCAL
NATURAL, NO, NOT, NULL
OF, ON, ONLY, OR, ORDER, OUT, OUTER, OVERLAPS
PARTITION, POSITION, PRIMARY
RANGE, REFERENCES, REVOKE, RIGHT, ROLLBACK, ROLLUP, ROW, ROWS
SELECT, SESSION_USER, SET, SOME, START
TABLE, TABLESAMPLE, THEN, TIME, TO, TRAILING, TRUE, TRUNCATE
UNION, UNIQUE, UNKNOWN, UPDATE, USER, USING
WHEN, WHERE, WINDOW, WITH
-- Using SQL keywords > CREATE TEMPORARY VIEW where(where) AS (VALUES (1)); > SELECT where from FROM where select; 1 -- Usage of NULL > SELECT NULL, `null`, T.null FROM VALUES(1) AS T(null); NULL 1 1 -- current_date is eclipsed by the column alias T.current_date > SELECT (SELECT current_date), current_date, current_date() FROM VALUES(1) AS T(current_date); 2021-10-23 1 2021-10-23 -- Reserved keyword ANTI cannot be used as table alias > SELECT * FROM VALUES(1) AS ANTI; Error in query: no viable alternative at input 'ANTI' > SELECT * FROM VALUES(1) AS `ANTI`; 1