You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Mathias Fryde <ma...@mimesis-republic.com> on 2009/04/20 13:55:22 UTC

Left Join Problems

Hello,
I have successfully played with normal join on hive with :

SELECT tbd.col1, COUNT(1)
FROM log_test tbd
JOIN log_test tbd2 ON ( ..... expression)
GROUP BY tbd.col1

But unfortunately i'm trying LEFT OUTER JOIN on the lastest Hive Trunk and
it does not work. Here is my sript :

SELECT tbd.col1, COUNT(1)
FROM log_test tbd
LEFT OUTER JOIN log_test tbd2 ON ( ..... expression)
GROUP BY tbd.col1

Here is the Error message :
FAILED: Parse Error: line 7:0 mismatched input 'log_test' expecting EOF in
join source

Regards,
Mathias.

Re: Left Join Problems

Posted by Mathias Fryde <ma...@mimesis-republic.com>.
Hello,
I finally manage to make it work on other tables.
Thank you.

Anyway Hive is COOl !!.

I really can wait
- MEDIAN
- IN

is there a approximated date for the released of those features ? (I have
seen them on the rodmap).

Mathias.

2009/4/20 Namit Jain <nj...@facebook.com>

>  Can you give more details ? Schema of the tables etc.
>
>
>
> I just tried the following query on trunk:
>
>
>
>   SELECT src1.key, count(1) FROM src src1 LEFT OUTER JOIN src src2 ON
> (src1.key = src2.key) group by src1.key;
>
>
>
> And it works fine.
>
>
>
>
>
> Thanks,
>
> -namit
>
>
>
>
>
> *From:* Mathias Fryde [mailto:mathias.fryde@mimesis-republic.com]
> *Sent:* Monday, April 20, 2009 4:55 AM
> *To:* hive-user@hadoop.apache.org
> *Subject:* Left Join Problems
>
>
>
> Hello,
> I have successfully played with normal join on hive with :
>
> SELECT tbd.col1, COUNT(1)
> FROM log_test tbd
> JOIN log_test tbd2 ON ( ..... expression)
> GROUP BY tbd.col1
>
> But unfortunately i'm trying LEFT OUTER JOIN on the lastest Hive Trunk and
> it does not work. Here is my sript :
>
> SELECT tbd.col1, COUNT(1)
> FROM log_test tbd
> LEFT OUTER JOIN log_test tbd2 ON ( ..... expression)
> GROUP BY tbd.col1
>
> Here is the Error message :
> FAILED: Parse Error: line 7:0 mismatched input 'log_test' expecting EOF in
> join source
>
> Regards,
> Mathias.
>

RE: Left Join Problems

Posted by Namit Jain <nj...@facebook.com>.
Can you give more details ? Schema of the tables etc.

I just tried the following query on trunk:

  SELECT src1.key, count(1) FROM src src1 LEFT OUTER JOIN src src2 ON (src1.key = src2.key) group by src1.key;

And it works fine.


Thanks,
-namit


From: Mathias Fryde [mailto:mathias.fryde@mimesis-republic.com]
Sent: Monday, April 20, 2009 4:55 AM
To: hive-user@hadoop.apache.org
Subject: Left Join Problems

Hello,
I have successfully played with normal join on hive with :

SELECT tbd.col1, COUNT(1)
FROM log_test tbd
JOIN log_test tbd2 ON ( ..... expression)
GROUP BY tbd.col1

But unfortunately i'm trying LEFT OUTER JOIN on the lastest Hive Trunk and it does not work. Here is my sript :

SELECT tbd.col1, COUNT(1)
FROM log_test tbd
LEFT OUTER JOIN log_test tbd2 ON ( ..... expression)
GROUP BY tbd.col1

Here is the Error message :
FAILED: Parse Error: line 7:0 mismatched input 'log_test' expecting EOF in join source

Regards,
Mathias.