Impala reserves a set of keywords that cannot be used directly as identifiers in Impala
SQL. You must be aware of the list of reserved words to avoid name conflicts with any of your
table, columns, or other object names.
If you need to use it as an identifier, you must quote it with backticks. For example:
CREATE TABLE select (x INT)
: fails
CREATE TABLE `select` (x INT)
: succeeds
Because different database systems have different sets of reserved words, and the reserved
words change from release to release, carefully consider database, table, and column names
to ensure maximum compatibility between products and versions.
Also consider whether your object names are the same as any Hive keywords, and rename or
quote any that conflict as you might switch between Impala and Hive when doing analytics and
To future-proof your code, you should avoid additional words in case they become reserved
words if Impala adds features in later releases. This kind of planning can also help to
avoid name conflicts in case you port SQL from other systems that have different sets of
reserved words. The Future Keyword column in the table below indicates those additional
words that you should avoid for table, column, or other object names, even though they are
not currently reserved by Impala.
The following is a summary of the process for deciding whether a particular SQL 2016 word
is to be reserved in Impala.
-
By default, Impala targets to have the same list of reserved words as SQL 2016.
-
At the same time, to be compatible with earlier versions of Impala and to avoid
breaking existing tables/workloads, Impala built-in function names are removed from the
reserved words list, e.g. COUNT, AVG, as Impala generally does not need to reserve the
names of built-in functions for parsing to work.
-
For those remaining SQL 2016 reserved words, if a word is likely to be in-use by users
of older Impala versions and if there is a low chance of Impala needing to reserve that
word in the future, then the word is not reserved.
-
Otherwise, the word is reserved in Impala.
The following table lists the reserved words in Impala.
Keyword
Reserved
in
SQL:2016
Reserved
in
Impala 3.0 and higher
Future Keyword