Impala reserved words

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 ETL.

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
abs X
acos X
add X
aggregate X
all X X
allocate X X
alter X X
analytic X
and X X
anti X
any X X
api_version X
are X X
array X X
array_agg X X
array_max_cardinality X X
as X X
asc X
asensitive X X
asin X
asymmetric X X
at X X
atan X
atomic X X
authorization X X
avg X
avro X
backup X
begin X X
begin_frame X X
begin_partition X X
between X X
bigint X X
binary X X
blob X X
block_size X
boolean X X
both X X
break X
browse X
bulk X
by X X
cache
cached X
call X
called X X
cardinality X X
cascade X
cascaded X X
case X X
cast X X
ceil X
ceiling X
change X
char X X
char_length X
character X X
character_length X
check X X
checkpoint X
class X
classifier X
clob X X
close X X
close_fn X
clustered X
coalesce X X
collate X X
collect X X
column X X
columns X
comment X
commit X X
compression X
compute X
condition X X
conf
connect X X
constraint X X
contains X X
continue X
convert X X
copy X X
corr X X
corresponding X X
cos X
cosh X
count X
covar_pop X X
covar_samp X X
create X X
cross X X
cube X X
cume_dist X
current X X
current_catalog X
current_date X X
current_default_transform_group X X
current_path X X
current_role X X
current_row X X
current_schema X X
current_time X X
current_timestamp X X
current_transform_group_for_type X X
current_user X X
cursor X X
cycle X X
data X
database X
databases X
date X X
datetime X
day X
dayofweek
dbcc X
deallocate X X
dec X X
decfloat X X
decimal X X
declare X X
default X X
define X X
delete X X
delimited X
dense_rank X
deny X
deref X X
desc X
describe X X
deterministic X X
disconnect X X
disk X
distinct X X
distributed X
div X
double X X
drop X X
dump X
dynamic X X
each X X
element X X
else X X
empty X X
encoding X
end X X
end-exec X X
end_frame X X
end_partition X X
equals X X
errlvl X
escape X X
escaped X
every X X
except X X
exchange
exec X X
execute X X
exists X X
exit X
exp X
explain X
extended X
external X X
extract X
false X X
fetch X X
fields X
file X
filefactor X
fileformat X
files X
filter X X
finalize_fn X
first X
first_value X
float X X
floor X
following X
for X X
foreign X X
format X
formatted X
frame_row X X
free X X
freetext X
from X X
full X X
function X X
functions X
fusion X X
get X X
global X X
goto X
grant X X
group X X
grouping X X
groups X X
hash X
having X X
hold X X
holdlock X
hour X
iceberg X1
identity X X
if X
ignore X
ilike X
import
in X X
incremental X
index X
indicator X X
init_fn X
initial X X
inner X X
inout X X
inpath X
insensitive X X
insert X X
int X X
integer X X
intermediate X
intersect X X
intersection X X
interval X X
into X X
invalidate X
iregexp X
is X X
join X X
json_array X X
json_arrayagg X X
json_exists X X
json_object X X
json_objectagg X X
json_query X X
json_table X X
json_table_primitive X X
json_value X X
key X
kill X
kudu X
lag X
language X
large X X
last X
last_value X
lateral X X
lead X
leading X X
left X X
less
like X X
like_regex X X
limit X
lineno X
lines X
listagg X X
ln X
load X
local X X
localtime X
localtimestamp X X
location X
log X
log10 X X
lower X
macro
map X
match X X
match_number X X
match_recognize X X
matches X X
max X
member X
merge X X
merge_fn X
metadata X
method X X
min X
minute X
mod X
modifies X X
module X
month X
more
multiset X X
national X X
natural X X
nchar X X
nclob X X
new X
no X X
nocheck X
nonclustered X
none X X
normalize X X
not X X
nth_value X X
ntile X
null X X
nullif X X
nulls X
numeric X X
occurrences_regex X X
octet_length X X
of X X
off X
offset X X
offsets X
old X
omit X X
on X X
one X X
only X X
open X X
option X
or X X
order X X
out X X
outer X X
over X X
overlaps X X
overlay X X
overwrite X
parameter X
parquet X
parquetfile X
partialscan
partition X X
partitioned X
partitions X
pattern X X
per X X
percent X X
percent_rank X
percentile_cont X X
percentile_disc X X
period X
pivot X
plan X
portion X X
position X X
position_regex X X
power X
precedes X X
preceding X
precision X X
prepare X X
prepare_fn X
preserve
primary X X
print X
proc X
procedure X X
produced X
ptf X X
public X
purge X
raiseerror X
range X X
rank X
rcfile X
read X
reads X X
readtext X
real X X
reconfigure X
recover X
recursive X X
reduce
ref X X
references X X
referencing X X
refresh X
regexp X
regr_avgx X X
regr_avgy X X
regr_count X X
regr_intercept X X
regr_r2 X X
regr_slope X X
regr_sxx X X
regr_sxy X X
regr_syy X X
release X X
rename X
repeatable X
replace X
replication X
restore X
restrict X
result X
return X X
returns X X
revert X
revoke X X
right X X
rlike X
role X
roles X
rollback X X
rollup X X
row X X
row_number X
rowcount X
rows X X
rule X
running X X
save X
savepoint X X
schema X
schemas X
scope X X
scroll X X
search X X
second X
securityaudit X
seek X X
select X X
semi X
sensitive X X
sequencefile X
serdeproperties X
serialize_fn X
session_user X X
set X X
setuser X
show X X
shutdown X
similar X X
sin X
sinh X
skip X X
smallint X X
some X X
sort X
specific X X
specifictype X X
sql X
sqlexception X X
sqlstate X X
sqlwarning X X
sqrt X
start X
static X X
statistics X
stats X
stddev_pop X
stddev_samp X
stored X
straight_join X
string X
struct X
submultiset X X
subset X X
substring X
substring_regex X X
succeeds X X
sum X
symbol X
symmetric X X
system X
system_time X X
system_user X X
table X X
tables X
tablesample X X
tan X
tanh X
tblproperties X
terminated X
textfile X
textsize X
then X X
time X
timestamp X X
timezone_hour X X
timezone_minute X X
tinyint X
to X X
top X
trailing X X
tran X
transform
translate X
translate_regex X X
translation X X
treat X X
trigger X X
trim X
trim_array X X
true X X
truncate X X
try_convert X
uescape X X
unbounded X
uncached X
union X X
unique X X
uniquejoin
unknown X X
unnest X X
unpivot X
update X X
update_fn X
updatetext X
upper X
upsert X
use X
user X X
using X X
utc_tmestamp
validate X2
value X
value_of X X
values X X
var_pop X
var_samp X
varbinary X X
varchar X X
varying X X
versioning X X
view X
views
waitfor X
when X X
whenever X X
where X X
while X
width_bucket X X
window X X
with X X
within X X
without X X
writetext X
year X
1 Impala 4.0 and higher
2 Impala 3.4 and higher