You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Harshit Kumar <ku...@bike.snu.ac.kr> on 2010/04/30 09:14:00 UTC

error: Both Left and Right Aliases Encountered in Join obj

Hi

I have a query like this

from spo t1 join spo t2 on (t1.sub=t2.sub and t1.obj<>t2.obj) insert
overwrite table spojoin select t1.sub, t1.pre, t2.obj, t2.sub, t2.pre,
t2.obj;

Executing the above query gives the following error.
*FAILED: Error in semantic analysis: line 1:46 Both Left and Right Aliases
Encountered in Join obj*

However, If I replace the <> operator with == operator, it executes.

Please let me know what am I doing wrong?

Thanks
Kumar

Re: error: Both Left and Right Aliases Encountered in Join obj

Posted by Zheng Shao <zs...@gmail.com>.
Put "t1.obj<>t2.obj" in the where clause.


On Fri, Apr 30, 2010 at 12:14 AM, Harshit Kumar <ku...@bike.snu.ac.kr> wrote:
> Hi
>
> I have a query like this
>
> from spo t1 join spo t2 on (t1.sub=t2.sub and t1.obj<>t2.obj) insert
> overwrite table spojoin select t1.sub, t1.pre, t2.obj, t2.sub, t2.pre,
> t2.obj;
>
> Executing the above query gives the following error.
> FAILED: Error in semantic analysis: line 1:46 Both Left and Right Aliases
> Encountered in Join obj
>
> However, If I replace the <> operator with == operator, it executes.
>
> Please let me know what am I doing wrong?
>
> Thanks
> Kumar
>
>
>



-- 
Yours,
Zheng
http://www.linkedin.com/in/zshao