hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raihan Jamal <jamalrai...@gmail.com>
Subject Re: What's wrong with this query?
Date Tue, 10 Jul 2012 00:11:01 GMT
Yup that worked for me. I figure that out after reading the docs, INNER
JOIN means JOIN in HiveQL.




*Raihan Jamal*



On Mon, Jul 9, 2012 at 2:48 PM, Roberto Sanabria <roberto@stumbleupon.com>wrote:

> Did you try just using "join" instead of "inner join"?
>
>
> On Mon, Jul 9, 2012 at 11:42 AM, Raihan Jamal <jamalraihan@gmail.com>wrote:
>
>> I wrote this query but everytime I get the below error.
>>
>>     select * from (select t2.buyer_id, t2.item_id, t2.created_time as
>> created_time, subq.user_id, subq.product_id, subq.timestamps as timestamps
>>     from
>>     (select user_id, prod_and_ts.product_id as product_id,
>> prod_and_ts.timestamps as timestamps from testingtable2 lateral view
>> explode(purchased_item) exploded_table as prod_and_ts) subq INNER JOIN
>> testingtable1 t2 on t2.buyer_id = subq.user_id
>>     AND subq.timestamps = unix_timestamp(t2.created_time)
>>     WHERE (subq.product_id <> t2.item_id)
>>     union all
>>     select t2.buyer_id, t2.item_id as item_id, t2.created_time,
>> subq.user_id, subq.product_id as product_id, subq.timestamps
>>     from
>>     (select user_id, prod_and_ts.product_id as product_id,
>> prod_and_ts.timestamps as timestamps from testingtable2 lateral view
>> explode(purchased_item) exploded_table as prod_and_ts) subq INNER JOIN
>> testingtable1 t2 on t2.buyer_id = subq.user_id
>>         and subq.product_id = t2.item_id
>>         WHERE (subq.timestamps <> unix_timestamp(t2.created_time)))
>> unionall;
>>
>>
>>
>> But I always get error as -
>>
>> `*FAILED: Parse Error: line 3:184 mismatched input 'INNER' expecting )
>> in subquery source`*
>>
>>
>>
>>
>> *Raihan Jamal*
>>
>>
>

Mime
View raw message