gpt4 book ai didi

hadoop - 如何在结构类型列中使用 '@' 创建配置单元表?

转载 作者:可可西里 更新时间:2023-11-01 16:35:36 29 4
gpt4 key购买 nike

配置单元 creata sql:
CREATE EXTERNAL TABLE仓库. aaa (
属性 struct<
sk@aaa :string
>
)
PARTITIONED BY (
dt string)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = '1'
)
STORED AS
INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION 'hdfs://.....';

错误信息:

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.IllegalArgumentException: Error: : expected at the position 9 of 'struct<sk@aaa:string>' but '@' is found

如何在struct列中用@创建hive表?

最佳答案

对于 HBase 0.13 及更高版本的特殊字符,您可以使用反引号。

struct<`sk@aaa`:string>

更多细节请引用文档: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select

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.
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 (attached to HIVE-6013). Also see REGEX Column Specification below.

关于hadoop - 如何在结构类型列中使用 '@' 创建配置单元表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53645073/

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