[ 
https://issues.apache.org/jira/browse/HIVE-26659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17698768#comment-17698768
 ] 

Aman Sinha commented on HIVE-26659:
-----------------------------------

CBO plan:
{noformat}
set hive.auto.convert.anti.join=true;
explain cbo select
 sum(ws_ext_ship_cost) as "total shipping cost"
from
tt1 ws1, tt2 ws2 where ws1.ws_order_number = ws2.ws_order_number
and not exists(select * from tt3 wr1 where ws1.ws_order_number = 
wr1.wr_order_number);

+----------------------------------------------------+
|                      Explain                       |
+----------------------------------------------------+
| CBO PLAN:                                          |
| HiveAggregate(group=[{}], agg#0=[sum($1)])         |
|   HiveAntiJoin(condition=[=($0, $4)], joinType=[anti]) |
|     HiveJoin(condition=[=($0, $2)], joinType=[inner]) |
|       HiveProject(ws_order_number=[$0], ws_ext_ship_cost=[$1]) |
|         HiveFilter(condition=[IS NOT NULL($0)])    |
|           HiveTableScan(table=[[tpcds, tt1]], table:alias=[ws1]) |
|       HiveProject(ws_order_number=[$0])            |
|         HiveFilter(condition=[IS NOT NULL($0)])    |
|           HiveTableScan(table=[[tpcds, tt2]], table:alias=[ws2]) |
|     HiveProject(literalTrue=[true], wr_order_number=[$0]) |
|       HiveFilter(condition=[IS NOT NULL($0)])      |
|         HiveTableScan(table=[[tpcds, tt3]], table:alias=[wr1]) |
|                                                    |
+----------------------------------------------------+
{noformat}


> TPC-DS query 16, 69, 94 return wrong results.
> ---------------------------------------------
>
>                 Key: HIVE-26659
>                 URL: https://issues.apache.org/jira/browse/HIVE-26659
>             Project: Hive
>          Issue Type: Sub-task
>    Affects Versions: 4.0.0-alpha-2
>            Reporter: Sungwoo Park
>            Priority: Major
>
> TPC-DS query 16, 69, 94 return wrong results when hive.auto.convert.anti.join 
> is set to true.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to