Re: Help with last 30 day unique user query

2010-10-15 Thread Vijay
Thanks Alex! That is exactly what I thought was the limitation but wanted to make sure I'm not missing anything. On Fri, Oct 15, 2010 at 10:51 AM, Alex Boisvert wrote: > As far as I know, Hive has no built-in support for sliding-window > analytics. There is an enhancement request here: > https:

Re: Help with last 30 day unique user query

2010-10-15 Thread Alex Boisvert
As far as I know, Hive has no built-in support for sliding-window analytics. There is an enhancement request here: https://issues.apache.org/jira/browse/HIVE-896 Without such support, the brute force way of doing things is, SELECT COUNT(DISTINCT us

Re: Help with last 30 day unique user query

2010-10-15 Thread Ning Zhang
Sorry I don't understand your question. I thought you were referring to the lack of DATE type in Hive. HiveQL has the similar syntax with SQL like count(distinct col). Your regular SQL query should work together with the help of UDFs I mentioned. On Oct 15, 2010, at 9:43 AM, Vijay wrote: Thank

Re: Help with last 30 day unique user query

2010-10-15 Thread Vijay
Thanks, Ning! Finding the date which is 30 days before/later was easy enough but my problem is beyond that. I need to find unique users based on these last 30 days for a range of days. Does that make sense? On Fri, Oct 15, 2010 at 12:10 AM, Ning Zhang wrote: > There are some UDFs that convert a

Re: Help with last 30 day unique user query

2010-10-15 Thread Ning Zhang
There are some UDFs that convert a string to epoch time and back to a string. e.g., select from_unixtime(unix_timestamp('2010-10-10', '-MM-dd') + 60*60*24*30, '-MM-dd') from src limit 1; will given you the date which is 30 days later than 2010-10-10. On Oct 14, 2010, at 11:36 PM, Vij