Re: Join not working in HIVE

2012-12-17 Thread Alexander Pivovarov
Hive supports only equi-join I recommend you to read some hive manual before use it. (e.g. http://hive.apache.org/docs/r0.9.0/language_manual/joins.html https://cwiki.apache.org/Hive/languagemanual-joins.html) on the first sentence it says "Only equality joins, outer joins, and left semi joins are

Re: Join not working in HIVE

2012-12-17 Thread Philip Tromans
Hive doesn't support theta joins. Your best bet is to do a full cross join between the tables, and put your range conditions into the WHERE clause. This may or may not work, depending on the respective sizes of your tables. The fundamental problem is that parallelising a theta (or range) join via

Re: Join not working in HIVE

2012-12-17 Thread Nitin Pawar
can you explain your needs? may be there is another alternate way a query is not of much help On Mon, Dec 17, 2012 at 7:17 PM, Ramasubramanian Narayanan < ramasubramanian.naraya...@gmail.com> wrote: > Hi, > > We are trying to build a tree structure in a table.. hence we have the > left and rig

Re: Join not working in HIVE

2012-12-17 Thread Ramasubramanian Narayanan
Hi, We are trying to build a tree structure in a table.. hence we have the left and right limits... Can't use where clause in that.. regards, Rams On Mon, Dec 17, 2012 at 6:53 PM, Nitin Pawar wrote: > hive is not mysql :) > > > On Mon, Dec 17, 2012 at 6:50 PM, Ramasubramanian Narayanan < > ram

Re: Join not working in HIVE

2012-12-17 Thread Nitin Pawar
hive is not mysql :) On Mon, Dec 17, 2012 at 6:50 PM, Ramasubramanian Narayanan < ramasubramanian.naraya...@gmail.com> wrote: > Hi, > > But it is working fine in MySql... > > mysql> select count(A1.id) as LVL, A2.id, A2.code, A2.short_name, A2.lft, > A2.rgt from product A1 join product A2 on (A

Re: Join not working in HIVE

2012-12-17 Thread Ramasubramanian Narayanan
Hi, But it is working fine in MySql... mysql> select count(A1.id) as LVL, A2.id, A2.code, A2.short_name, A2.lft, A2.rgt from product A1 join product A2 on (A1.lft <= A2.lft and A1.rgt >= A2.rgt) group by A2.id, A2.code, A2.short_name, A2.lft, A2.rgt; +-+--+--+--+--

Re: Join not working in HIVE

2012-12-17 Thread Nitin Pawar
are you trying to do a self join with less than and greater than without having anything in where clause I doubt that is going to work because less than and greater than will always need a upper or lower limit to start the comparison (that includes even in join statement) so try something like s