7

I'm migrating data to Hive 1.2, and I realized that, by default, I'm no longer allowed to use reserved words as column names. If you want to use reserved words, you need to explicitly set the below setting:

hive.support.sql11.reserved.keywords=false

My question is, does changing this default value result in any unexpected issues? Are there any problems I should be aware of before changing it?

By the way, this change is documented in this ticket: https://issues.apache.org/jira/browse/HIVE-6617

leftjoin
  • 36,950
  • 8
  • 57
  • 116
Nadine
  • 1,620
  • 2
  • 15
  • 27
  • 3
    You can still use whatever string literal you want, as long as you **quote** the column name every time with **back-quotes** *(and you avoid punctuation)* => `create table DUH (\`user\` string, \`Look ma no hands\` string)` – Samson Scharfrichter Jan 11 '16 at 22:45
  • Yeah I saw that solution too, but I was hoping to be able to keep the table exactly the same as it was in previous versions. I've always found quoted column names to be confusing. – Nadine Jan 12 '16 at 15:30

1 Answers1

6

This configuration property hive.support.sql11.reserved.keywords was added in Hive 1.2.0 with HIVE-6617 and is removed in Hive 2.3.0 with HIVE-14872

It was removed to simplify parser logic and reduce the size of generated parser code. Please read the description in the HIVE-14872 for more details.

Taking this into account, rewrite your code using quoted identifiers (using backticks) OR rename identifiers the sooner the better.

leftjoin
  • 36,950
  • 8
  • 57
  • 116