hive 建立表结构 ,添加分区
来源:互联网 发布:将电脑网络共享给手机 编辑:程序博客网 时间:2024/05/16 17:51
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types
drop table appuserprofile ;
CREATE EXTERNAL TABLE `appuserprofile`(
`mark` string,
`appkey` string,
`idfa` string,
`imei` string,
`androidid` string,
`mac` string,
`active_timestamp` bigint,
`active_hour` int,
`tbl_start_timestamp` bigint,
`tbl_start_hour` int,
`last_start_timestamp` bigint,
`last_start_hour` int,
`total_start_num` int,
`current_day_start_num` int,
`history_start_days_num` int,
`total_visit_app_time` int,
`is_update_appversion` int,
`appversion` string,
`channelid` string,
`countryid` string,
`provinceid` string,
`cityid` string,
`devicetype` string,
`screen` string,
`osversion` string,
`sp` string,
`network` string,
`brand` string,
`insert_timestamp` bigint,
`events` ARRAY<STRING>,
`current_hour_start_num` int
)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.SequenceFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat'
LOCATION
'hdfs://SHYF-H11-BH03:52310/bh/warehouse/mobile_tracking'
TBLPROPERTIES (
'transient_lastDdlTime'='1439198366');
alter table appuserprofile add if not exists partition (dt='2016042700') location '/bh/warehouse/mobile_tracking/AppUserProfileAddDurationJob/2016042700';
select events from appuserprofile where size( events) >1 limit 10;
hive -e "alter table appuserprofile add if not exists partition (dt='2016042600') location '/bh/warehouse/mobile_tracking/AppUserProfileAddDurationJob/2016042600’";
- hive 建立表结构 ,添加分区
- hive添加分区字段
- Hive 修改表添加分区(add partition)和 加载数据时添加分区 的区别
- hive表分区
- Hive表分区
- Hive表分区操作
- hive表分区
- Hive操作表分区
- hive表分区
- Hive 表分区
- Hive分区表添加分区时的注意事项
- Hadoop 从零开始学习系列-hive从元数据生成表结构、分区等建表语句
- hive修改 表/分区语句
- hive外部表及分区
- Hive创建表和分区
- 改变Hive 表的分区
- hive修改 表/分区语句
- 修改hive表分区名称
- MySQL语句大全:创建、授权、查询、修改
- wpe 网络改包
- c3p0的使用
- 练习三1013
- 算法练习2.Add Two Numbers 反向小数链表表示相加
- hive 建立表结构 ,添加分区
- POJ1200 Crazy Search(hash)
- 用Wordpress搭建个人网站(3)
- 1001. 害死人不偿命的(3n+1)猜想 (15)
- 《wonderful tonight》
- Xamarin 手动安装
- 博客莫名被关,还好及时解决
- phoenix设计
- 创业分享:创业的过程就是坚持的过程