Hive ORC表的使用


創建普通臨時表:
create table if not exists test_orc_tmp(
  name string,
  gender string,
  cnt BIGINT
)row format delimited fields terminated by '|' stored as textfile;
創建ORC表:
drop table test_orc;
create table if not exists test_orc(
  name string,
  gender string,
  cnt BIGINT
)STORED AS ORC;
創建測試數據   vi orc.txt
goldenkey0|male|111
goldenkey1|male|112
goldenkey2|male|113
goldenkey3|male|114
goldenkey4|male|115
goldenkey5|male|116
goldenkey6|male|117
將測試數據導入臨時普通表:
LOAD DATA INPATH '/tmp/orc.txt' OVERWRITE INTO TABLE test_orc_tmp;
將臨時普通表的數據插入到ORC表:
INSERT INTO TABLE test_orc SELECT * FROM test_orc_tmp;
查看ORC表是否有數據:
select * from test_orc_tmp;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM