Yup this works. Thanks for the help.
*Raihan Jamal*
On Tue, Jul 10, 2012 at 4:37 PM, Vijay wrote:
> In that case, wouldn't this work:
>
> SELECT buyer_id, item_id, rank(buyer_id), created_time
> FROM (
> SELECT buyer_id, item_id, created_time
> FROM testingtable1
> DISTRIBUTE BY
In that case, wouldn't this work:
SELECT buyer_id, item_id, rank(buyer_id), created_time
FROM (
SELECT buyer_id, item_id, created_time
FROM testingtable1
DISTRIBUTE BY buyer_id
SORT BY buyer_id, created_time desc
) a
WHERE rank(buyer_id) < 10;
On Tue, Jul 10, 2012 at 4:21 PM, Rai
This is a little tricky but this is how it works:
SELECT buyer_id, item_id, rank(item_id), created_time
FROM (
SELECT buyer_id, item_id, created_time
FROM testingtable1
DISTRIBUTE BY buyer_id, item_id
SORT BY buyer_id, item_id, created_time desc
) a
WHERE rank(item_id) < 10;
On T
Still it's not working with the use of my rank UDF. Below is the query I am
using
Can anyone help me, what changes I need to make in my below sql query?
CREATE TABLE IF NOT EXISTS TestingTable1
(
BUYER_ID BIGINT,
ITEM_ID BIGINT,
CREATED_TIME STRING
)
*Find TOP 10 latest data (ITEM_ID, CREATE
Hi Raihan,
You should use 'rank(buyer_id)' in the order by clause on line 9 in stead
of the alias 'rk'. I had the same problem, strangely, the alias is not
resolved when it is in the order by clause.
Other thing, I had some issues when I used this exact same set up for
ranking results, that the r
change this " SELECT buyer_id, item_id, created_time" to " SELECT buyer_id,
item_id, created_time, rk"
On Tue, Jul 10, 2012 at 12:30 PM, Raihan Jamal wrote:
> I was not able to understand, This is my below qiuery that I am using
> currently-
>
> SELECT buyer_id, item_id, created_time
> FROM (
>
I was not able to understand, This is my below qiuery that I am using
currently-
SELECT buyer_id, item_id, created_time
FROM (
SELECT buyer_id, item_id, rank(buyer_id) as rank, created_time
FROM testingtable1
DISTRIBUTE BY buyer_id, item_id
SORT BY buyer_id, item_id, created_time d
try rk in upper select statement as well
On Tue, Jul 10, 2012 at 12:12 PM, Raihan Jamal wrote:
> Thanks for commenting out. Yes I figured that out, its a UDF. So now I
> have created a new UDF Rank and added to classpath also. But when I am
> again running the below query-
>
> SELECT buyer_id, i
Thanks for commenting out. Yes I figured that out, its a UDF. So now I have
created a new UDF Rank and added to classpath also. But when I am again
running the below query-
SELECT buyer_id, item_id, created_time
FROM (
SELECT buyer_id, item_id, Rank(buyer_id) as rk, created_time
FROM testi
hive has no built-in rank function. you'd need to use a user-defined
function (UDF) to simulate it. there are a few custom implementations
on the net that you can leverage.
On Mon, Jul 9, 2012 at 10:40 PM, Raihan Jamal wrote:
> What's wrong with the below query.
>
>
> SELECT buyer_id, item_id, cr
10 matches
Mail list logo