Using Reserved Words in SQL Queries

For ANSI SQL compliance, Impala rejects reserved words in SQL queries in CDP. A reserved word is one that cannot be used directly as an identifier. If you need to use it as an identifier, you must quote it with backticks.

New reserved words are added in CDH 6. To port SQL statements from CDH 5 that has different sets of reserved words, you must change queries that use references to such Tables or Databases using reserved words in the SQL syntax.
  1. Find a table having the problematic table reference, such as a create table statement that uses a reserved word such as select in the CREATE statement.
  2. Enclose the table name in backticks.
    CREATE TABLE select (x INT): fails
    CREATE TABLE `select` (x INT): succeeds
    For more information, see Impala identifiers and Impala reserved words.