2016-08-13 60 views
3

需要一些建议。在HIVE DB是有可能创建表列有空间,如下蜂巢问题与创建表与列有空间

CREATE TABLE TEST2("Kod ASS" String) 

得到如下错误

Error: Error while compiling statement: FAILED: ParseException line 1:19 cannot recognize input near '"Kod ASS"' 'String' ')' in column specification SQLState: 42000 ErrorCode: 40000

回答

3

节目手册关于列名:

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL

In Hive 0.12 and earlier, only alphanumeric and underscore characters are allowed in table and column names.

In Hive 0.13 and later, column names can contain any Unicode character (see HIVE-6013). Any column name that is specified within backticks (`) is treated literally. Within a backtick string, use double backticks (``) to represent a backtick character. Backtick quotation also enables the use of reserved keywords for table and column identifiers.

To revert to pre-0.13.0 behavior and restrict column names to alphanumeric and underscore characters, set the configuration property hive.support.quoted.identifiers to none. In this configuration, backticked names are interpreted as regular expressions. For details, see Supporting Quoted Identifiers in Column Names.

+0

我可以在哪里设置hive.support.quoted.identifiers?你有什么样的例子吗? – Aiman