大数据基础之Hive——Hive导入数据忽略首行字段配置以及Hive、HBase互相映射配置
导入数据忽略首行字段名称:create external table highschool(geographic_area string,city string,percent_completed_hs string)row format delimited fields terminated by ','stored as textfilelocation '/iii/HighSchool'tb
·
导入数据忽略首行字段名称:
create external table highschool(
geographic_area string,
city string,
percent_completed_hs string
)
row format delimited fields terminated by ','
stored as textfile
location '/iii/HighSchool'
tblproperties("skip.header.line.count"="1")
HBase映射Hive配置:
create external table student(
stu_id int,
stu_name string,
stu_age int,
stu_sex string,
stu_birth string
)
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
//注意:映射顺序与建表字段顺序一定要保持一致!!!
with serdeproperties("hbase.columns.mapping"=":key,info:name,info:age,base:sex,base:birth")
tblproperties("hbase.table.name"="students")
更多推荐
所有评论(0)