Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> What's wrong with this query?


Copy link to this message
-
Re: What's wrong with this query?
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 <[EMAIL PROTECTED]>wrote:

> Did you try just using "join" instead of "inner join"?
>
>
> On Mon, Jul 9, 2012 at 11:42 AM, Raihan Jamal <[EMAIL PROTECTED]>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*
>>
>>
>