Jihoon Son created TAJO-1342:
--------------------------------

             Summary: The complex join query runs forever
                 Key: TAJO-1342
                 URL: https://issues.apache.org/jira/browse/TAJO-1342
             Project: Tajo
          Issue Type: Bug
            Reporter: Jihoon Son


TAJO-1277 fixes a bug of join ordering which ignores the different 
associativity according to the join types.
After TAJO-1277, I found an additional hidden bug. Please see the following 
example.
{noformat}
default> select * from customer right outer join supplier on c_nationkey = 
s_nationkey inner join nation on n_nationkey = c_nationkey full outer join 
region on n_regionkey = r_regionkey;
Progress: 0%, response time: 1.632 sec
Progress: 0%, response time: 1.633 sec
Progress: 0%, response time: 2.038 sec
Progress: 0%, response time: 2.843 sec
Progress: 98%, response time: 3.848 sec
Progress: 98%, response time: 4.854 sec
...
(Infinitely repeated)
{noformat}

The join order of this query is: 
{noformat}
(((default.customer ⟖ default.supplier) ⋈θ default.nation) ⟗ default.region)
{noformat}

Here is the query master log
{noformat}
...
2015-02-11 12:30:33,987 INFO 
org.apache.tajo.engine.planner.PhysicalPlannerImpl: Right Outer Join (9) 
chooses [Hash Join].
2015-02-11 12:30:33,990 INFO 
org.apache.tajo.engine.planner.PhysicalPlannerImpl: 
[ta_1423625266462_0001_000003_000000_00] the volume of Left relations 
(eb_1423625266462_0001_000001, eb_1423625266462_0001_000002) is 24.8 MiB and is 
fit to main maemory.
2015-02-11 12:30:33,990 INFO 
org.apache.tajo.engine.planner.PhysicalPlannerImpl: Join (10) chooses 
[In-memory Hash Join]
2015-02-11 12:30:33,990 INFO 
org.apache.tajo.engine.planner.PhysicalPlannerImpl: 
[ta_1423625266462_0001_000003_000000_00] Right relations default.nation (2.2 
KiB) is smaller than Left relations eb_1423625266462_0001_000001, 
eb_1423625266462_0001_000002 (24.8 MiB).
2015-02-11 12:30:33,991 INFO 
org.apache.tajo.engine.planner.PhysicalPlannerImpl: Full Outer Join (11) 
chooses [Hash Join]
{noformat}

As you can see, the query master seems to fall into an infinite loop during 
executing the hash outer join.

This bug is not found in the current master branch. The difference is found in 
the join order as follows:
{noformat}
(((default.nation ⟗ default.region) ⋈θ default.customer) ⟖ default.supplier)
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to