1. text数据文件导出text数据表中
数据格式:
创建相应的数据表
create table if not exists text_table(id int, count int) comment 'table desc' partitioned by (date int) row format delimited fields terminated by '\t' lines terminated by '\n' stored as textfile;
导入数据
load data local inpath '/tmp/xgs/data.text' into table text_table partition (date=20170727);
2. orc数据文件导入orc数据表中
数据格式:
创建相应的数据表
create table if not exists orc_table(id int, count int) comment 'table desc' partitioned by (date int) row format delimited fields terminated by '\t' lines terminated by '\n' stored as orcfile;
导入数据
load data local inpath '/tmp/xgs/data.orc' into table orc_table partition (date=20170727);
3. orc与text互相导入
主要是依靠insert关键字,如:insert into table orc_table partition (date=20170727) select id, count from text_table where date=20170727;