PV、UV的几种写法
一、HQL写法 uv: count(distinct)太影响性能,以下为改进: select tmp.shop,count(1) as uv from (select user_id,shop from second_visit group by user_id,shop)tmp group by shop; pv select shop,count(uid) from second_visit group by shop; 二、MR写法 待填坑 三、spark写法 val conf = new SparkConf() conf.setAppName(pv_uv)
用户评论