You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by 张万新 <ke...@gmail.com> on 2017/09/21 04:09:01 UTC

How to use approx_count_distinct to count distinct numbers in a day but output the count of each hour?

Hi,

I'm using approx_count_distinct to count unique visitors but encounter some
problems. I want to count unique visitors in a day and output the results
of every hour,  and there is no duplicate counts between the results of two
hours. Notice that it's not the cumulative distinct counts of the day until
the current hour.