用户行为分析业务系统日志处理方案

1、日志要进入的目标表结构信息
1.1 Hive库上的目标表结构信息
CREATE TABLE `yemao_log`(
  `id` int, 
  `time` int, 
  `url_from` string, 
  `url_current` string, 
  `url_to` string, 
  `options` string, 
  `uid` int, 
  `new_visitor` string, 
  `province` string, 
  `city` string, 
  `site` string, 
  `device` string, 
  `phone` string, 
  `token` string, 
  `dorm` string, 
  `order_phone` string, 
  `order_dormitory` string, 
  `order_amount` string, 
  `order_id` int, 
  `uname` string, 
  `site_id` int, 
  `address` string, 
  `dorm_id` int, 
  `dormentry_id` int, 
  `rid` int, 
  `cart_quantity` string)
PARTITIONED BY ( 
  `log_date` int)
ROW FORMAT DELIMITED 
  FIELDS TERMINATED BY ',' 
  LINES TERMINATED BY '\n' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
  'hdfs://Master:9000/user/hive/warehouse/yemao_log'
TBLPROPERTIES (
  'transient_lastDdlTime'='1447308813');

1.2 Mysql库上当前表,其实就是一个临时表
CREATE TABLE `yemao_log` (
  `id` varchar(8000) DEFAULT NULL,
  `time` varchar(8000) DEFAULT NULL,
  `url_from` text,
  `url_current` text,
  `url_to` text,
  `options` text,
  `uid` text,
  `new_visitor` text,
  `province` text,
  `city` text,
  `site` text,
  `device` text,
  `phone` text,
  `token` text,
  `dorm` text,
  `order_phone` text,
  `order_dormitory` text,
  `order_amount` text,
  `order_id` text,
  `uname` text,
  `site_id` text,
  `address` text,
  `dorm_id` text,
  `dormentry_id` text,
  `rid` text,
  `cart_quantity` text
) 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值