Using reserved words in Hive

Nadine picture Nadine · Jan 11, 2016 · Viewed 7.9k times · Source

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

Answer

leftjoin picture leftjoin · May 7, 2018

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.