Using reserved words in Hive
Asked Answered
L

1

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

Lunette answered 11/1, 2016 at 18:12 Comment(2)
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)Epochal
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.Lunette
K
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.

Krafftebing answered 7/5, 2018 at 9:25 Comment(2)
What is the new settings for hive.support.sql11.reserved.keywords in HIVE 3 version, is it the same or there is any other settingsCarmella
@SanthoshChakka This setting is removed. Use backticks or rename.Krafftebing

© 2022 - 2024 — McMap. All rights reserved.