Hive 创建外部分区表

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’;

    原文作者:为祁
    原文地址: https://www.jianshu.com/p/b66d410c848d
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞