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