1.创建表
--drop table dev.dev_test20190225;
create EXTERNAL table dev.dev_test20190225
(
c1 int comment '1',
c2 int comment '2',
c3 int comment '3'
)
COMMENT '测试表'
PARTITIONED BY ( dt string )
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
NULL DEFINED AS ""
STORED AS ORC
tblproperties ('orc.compress'='SNAPPY');
2.插入测试数据
insert overwrite table dev.dev_test20190225 partition ( dt = '2019-01-03')
select 1 as c1,2 as c2,3 as c3
union all
select 1 as c1,2 as c2,3 as c3
union all
select 1 as c1,2 as c2,3 as c3
;
3.查看下数据
select * from dev.dev_test20190225;
结果:
4.