0

As you know in strict mode, Hive does not allow cartesian product joins, but can we achieve it in another way in that mode?

Coinnigh
  • 611
  • 10
  • 18

1 Answers1

-2

In strict mode, Cartesian product is not allowed. So, You have to have includes JOIN Condition in ON Clause instead of WHERE clause like this:

hive> SELECT * FROM fracture_act JOIN fracture_ads > WHERE fracture_act.planner_id = fracture_ads.planner_id;
FAILED: Error in semantic analysis:
In strict mode, cartesian product is not allowed. If you really want to perform the operation,
+set hive.mapred.mode=nonstrict+

Here is a properly constructed query with JOIN and ON clauses:

hive> SELECT * FROM fracture_act JOIN fracture_ads > ON (fracture_act.planner_id = fracture_ads.planner_id); 

... normal results ...

Nishu Tayal
  • 20,106
  • 8
  • 49
  • 101
  • Can you please see my detail description of my question here http://stackoverflow.com/questions/37889743/how-to-achieve-the-result-of-cartesian-product-by-not-using-the-cross-join-in-st – Coinnigh Jun 17 '16 at 20:29