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;