gpt4 book ai didi

sql - 带有列有空间的创建表的 Hive 问题

转载 作者:行者123 更新时间:2023-12-04 18:31:14 26 4
gpt4 key购买 nike

需要一些建议。在 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

最佳答案

显示关于列名的手册:

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.

关于sql - 带有列有空间的创建表的 Hive 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38936970/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com