Laljo John Pullokkaran created OPTIQ-435:
--------------------------------------------

             Summary: Join Reordering using LoptOptimizeJoinRule produces wrong 
plan resulting in incorrect results
                 Key: OPTIQ-435
                 URL: https://issues.apache.org/jira/browse/OPTIQ-435
             Project: Optiq
          Issue Type: Bug
    Affects Versions: 0.9.0-incubating
            Reporter: Laljo John Pullokkaran
            Assignee: Julian Hyde


Following query reproduces the problem:
SELECT ss_item_sk, ss_ticket_number, ss_customer_sk, sr_return_quantity FROM 
store_sales LEFT OUTER JOIN store_returns ON (store_returns.sr_item_sk = 
store_sales.ss_item_sk AND store_returns.sr_ticket_number = 
store_sales.ss_ticket_number), reason WHERE store_returns.sr_reason_sk = 
reason.r_reason_sk AND r_reason_desc = 'reason 28';

The Join graph given is:
(SS --> SR) -- Reason gets transformed in to
(SS x Reason) --> SR

This is an invalid reordering.

A short term solution may be to split join graph on outer join.




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

Reply via email to