RE: need help on writing hive query

2012-11-03 Thread java8964 java8964
This is not a hive but a SQL question. You need to be more clear about your data, and try to think a way to solve your problem. Without the detail about your data, no easy way to answer your question. For example, just based on your example data you provide, does the 'abc' and 'cde' only happen

RE: need help on writing hive query

2012-10-31 Thread java8964 java8964
; Subject: Re: need help on writing hive query > From: matthewt...@gmail.com > Date: Wed, 31 Oct 2012 17:53:06 -0400 > To: user@hive.apache.org > > I did a similar query a few months ago. In short, I left-padded the page > name with the time stamp, grouped with collect_set, and th

Re: need help on writing hive query

2012-10-31 Thread Matt Tucker
I did a similar query a few months ago. In short, I left-padded the page name with the time stamp, grouped with collect_set, and then used sort_array(). There was some other cleanup work and converting back to string to remove the time stamps, but it remained in order. If there's an easier wa

Re: need help on writing hive query

2012-10-31 Thread Tom Brown
It wouldn't retrieve the user's path in a single string, but you could simply select the user id and current page, ordered by the timestamp. It would require a second step to turn it into the single string path, so that might be a deal-breaker. --Tom On Wed, Oct 31, 2012 at 3:32 PM, Philip Troma

Re: need help on writing hive query

2012-10-31 Thread Philip Tromans
You could use collect_set() and GROUP BY. That wouldn't preserve order though. Phil. On Oct 31, 2012 9:18 PM, "qiaoresearcher" wrote: > Hi all, > > here is the question. Assume we have a table like: > > -

Re: need help on writing hive query

2012-10-31 Thread Mark Grover
You should look into Hive's cluster by/distribute by functionality. https://cwiki.apache.org/Hive/languagemanual-sortby.html#LanguageManualSortBy-SyntaxofClusterByandDistributeBy https://cwiki.apache.org/Hive/languagemanual-transform.html On Wed, Oct 31, 2012 at 2:18 PM, qiaoresearcher wrote: >