数组类型
create table arr1(
name String,
score Array<double>
)
row format delimited fields terminated by '\t'
collection items terminated by ',' 这代表数组以‘,’分割
stored as textfile
;
简单查询
map类型
文件内容
创建表
create table map1(
name String,
score map<String,double>
)
row format delimited fields terminated by '\t'
collection items terminated by ','
map keys terminated by ':'
stored as textfile
;
查询效果
struct类型
创建表
create table struct1(
name String,
score struct<chinese:double,math:double,english:double>
)
row format delimited fields terminated by '\t'
collection items terminated by ','
stored as textfile
;
查询结果
通过.来找到数据