如何使用嵌套的复杂数据类型创建配置单元表?

时间:2019-07-02 13:24:21

标签: amazon-web-services struct hive google-cloud-platform bigdata

如何为下表中的蜂巢中的嵌套复杂数据类型指定列分隔符-

Create table test (
id string,
unix_time bigint,
results map<int,struct<vendors:map<string,array<struct<rs:int,flag:boolean>>>>>)

可以使用的样本数据-

  

1 \ t145212334 \ t123:“ abc” | 1; false,2; false,3; false。“ pqr” | 1; false,2; false,3; false / 567:“ cde” | 4; false ,5; false,6; false

我尝试过的事情-

CREATE EXTERNAL TABLE test(
id string,
unix_time bigint,
results map<int, struct<str:string>>)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
collection items terminated by '/' 
map keys terminated by ':'
struct TERMINATED BY '|'
LOCATION '/tmp/complex';

0 个答案:

没有答案