HIVE數據導入

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;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章