06 友盟项目--创建hive的原生表raw_logs
创建hive的原生表raw_logs ,把hdfs数据加载到hive
创建分区表
准备hive
---------------------
1.登录hive
hive
2.创建新库
//不能使用- 可以使用下划线
create database big12_umeng;
3.建表
use big12_umeng ;
//创建hive的原生表,使用ym/day作为分区
create table raw_logs(servertimems float,
servertimestr string ,
clientip string ,
clienttimems bigint ,
status int,
json string)
PARTITIONED BY (ym string, day string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '#'
lines terminated by '\n';
4.加载数据到原生表
hive>
load data inpath '/user/centos/umeng_big12/raw-logs/201810/30' into table raw_logs partition (ym=201810,day=30);