hive> select * from temp;
OK
20180302 Page1 112 ios
20180302 Page2 113 android
20180303 Page1 117 ios
20180303 Page2 117 ios
20180304 Page3 138 android
Time taken: 0.222 seconds, Fetched: 5 row(s)
hive> select `date`,count(uid) as pv,count(distinct uid) as uv from temp group by `date`;
OK
20180302 2 2
20180303 2 1
20180304 1 1
Time taken: 7.692 seconds, Fetched: 3 row(s)
SQL如下
select `date`,count(uid) as pv,count(distinct uid) as uv from temp group by `date`;