You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Daniel Godfrey <c....@gmail.com> on 2011/11/20 05:44:17 UTC
Hive: Issue with JOIN on tables in a database namespace
Hey everyone,
I'm having issues trying to execute a simple join on two tables that are in
the same database namespace. I'm trying to following:
SELECT namespace.table1.* FROM namespace.table1 JOIN namespace.table2 ON
(namespace.table1.field1 = namespace.table2.field2);
If I move the tables outside of the database namespace, I can perform the
join just fine.
Is it not possible to join tables within a database? Or am I missing
something?
Cheers,
--
C. Daniel Godfrey
-4th Year Software Engineering Student at the University of Ottawa
Re: Hive: Issue with JOIN on tables in a database namespace
Posted by Daniel Godfrey <c....@gmail.com>.
Hey Ayon,
That solved my probably thank you so much. The error I was getting was that
the tables in the predicate were invalid.
Cheers,
On Sun, Nov 20, 2011 at 12:59 AM, Ayon Sinha <ay...@yahoo.com> wrote:
> Have you tried using table aliases? What errors do you see?
>
> Sent from my iPhone
>
> On Nov 19, 2011, at 8:44 PM, Daniel Godfrey <c....@gmail.com>
> wrote:
>
> Hey everyone,
>
> I'm having issues trying to execute a simple join on two tables that are
> in the same database namespace. I'm trying to following:
>
> SELECT namespace.table1.* FROM namespace.table1 JOIN namespace.table2 ON
> (namespace.table1.field1 = namespace.table2.field2);
>
> If I move the tables outside of the database namespace, I can perform the
> join just fine.
>
> Is it not possible to join tables within a database? Or am I missing
> something?
>
> Cheers,
>
> --
> C. Daniel Godfrey
>
> -4th Year Software Engineering Student at the University of Ottawa
>
>
>
--
C. Daniel Godfrey
-4th Year Software Engineering Student at the University of Ottawa
Re: Hive: Issue with JOIN on tables in a database namespace
Posted by Ayon Sinha <ay...@yahoo.com>.
Have you tried using table aliases? What errors do you see?
Sent from my iPhone
On Nov 19, 2011, at 8:44 PM, Daniel Godfrey <c....@gmail.com> wrote:
> Hey everyone,
>
> I'm having issues trying to execute a simple join on two tables that are in the same database namespace. I'm trying to following:
>
> SELECT namespace.table1.* FROM namespace.table1 JOIN namespace.table2 ON (namespace.table1.field1 = namespace.table2.field2);
>
> If I move the tables outside of the database namespace, I can perform the join just fine.
>
> Is it not possible to join tables within a database? Or am I missing something?
>
> Cheers,
>
> --
> C. Daniel Godfrey
>
> -4th Year Software Engineering Student at the University of Ottawa
>
>