1、hive 创建外部表
create external table t_ods_test (
uid string COMMENT ‘用户id’,
terminal string COMMENT ‘终端类型’,
adslotid string COMMENT ‘广告位id’,
cid string COMMENT ‘cid’,
amount string COMMENT ‘库存量’,
local string COMMENT ‘地域’,
tags string COMMENT ‘标签’ )
partitioned by (year string,month string,day string) row format delimited fields terminated by ‘\t’
STORED AS TEXTFILE location ‘/user/qgw/hh/app/usertagview’;
2、hive 外部表,增加分区
alter table t_ods_test add partition (year=’2017′, month=’10’, day=’18’) location ‘2017/10/18’;