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
To escape reserved keywords in DDL statements, enclose them in backticks (`). To escape reserved keywords in SQL SELECT statements and in queries on views, enclose them in double quotes ('').
A reserved word is one that "looks like" a normal word, but is not allowed to be used as a normal word. Formally this means that it satisfies the usual lexical syntax (syntax of words) of identifiers – for example, being a sequence of letters – but cannot be used where identifiers are used.
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.
The TBLPROPERTIES clause allows you to tag the table definition with your own metadata key/value pairs. Some predefined table properties also exist, such as last_modified_user and last_modified_time which are automatically added and managed by Hive.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With