$hive
hive> create database if not exists langbi_dm;
hive> CREATE TABLE IF NOT EXISTS dwm_ticket_delay (
ticket_id bigint COMMENT '工单ID',
order_id bigint COMMENT '订单ID',
city_id int COMMENT '城市ID',
ticket_type int COMMENT '工单类型(1010,1020)',
time_type string COMMENT '平峰期or高峰期',
is_delay string COMMENT '准时or迟到',
is_time_delay string comment '时间因素迟到',
is_distance_delay string comment '距离因素迟到',
delay_reason string comment '迟到原因',
i_num_zhunshi int comment '准时数',
i_num_delay int comment '迟到数'
) COMMENT '车辆一天内的出租时间统计中间表'
PARTITIONED BY (`dt` string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
$ hadoop fs -ls /user/hive/warehouse/langbi_dm.db
(Hive会使用mysql中的db名创建hadoop帐号,并在hadoop的/user/name/warehouse/下存放hive库文件) |