Skip to content

Commit

Permalink
rg
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener committed May 20, 2024
1 parent 9c965ad commit 24accb6
Show file tree
Hide file tree
Showing 35 changed files with 423 additions and 420 deletions.
29 changes: 15 additions & 14 deletions regression-test/data/nereids_hint_tpcds_p0/shape/query1.out
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------hashAgg[LOCAL]
--------------------PhysicalDistribute[DistributionSpecExecutionAny]
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((store.s_store_sk = ctr1.ctr_store_sk)) otherCondition=() build RFs:RF1 s_store_sk->[ctr_store_sk]
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------hashJoin[INNER_JOIN] hashCondition=((ctr1.ctr_customer_sk = customer.c_customer_sk)) otherCondition=()
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------PhysicalProject
----------------------------PhysicalOlapScan[customer]
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF1
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------filter((store.s_state = 'TN'))
------------------------PhysicalOlapScan[store]
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------hashJoin[INNER_JOIN] hashCondition=((ctr1.ctr_customer_sk = customer.c_customer_sk)) otherCondition=()
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
------------------------PhysicalOlapScan[customer]
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((store.s_store_sk = ctr1.ctr_store_sk)) otherCondition=() build RFs:RF1 s_store_sk->[ctr_store_sk]
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF1
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------filter((store.s_state = 'TN'))
--------------------------------PhysicalOlapScan[store]

Hint log:
Used: leading(store_returns broadcast date_dim )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------hashAgg[DISTINCT_LOCAL]
--------------hashAgg[GLOBAL]
----------------hashAgg[LOCAL]
------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF6 ws_order_number->[ws_order_number]
------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) otherCondition=() build RFs:RF6 ws_order_number->[wr_order_number,ws_order_number]
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) otherCondition=() build RFs:RF5 ws_order_number->[wr_order_number];RF7 ws_order_number->[ws_order_number,ws_order_number]
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number]
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF5 RF6
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[web_returns] apply RFs: RF6
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF7 ws_order_number->[ws_order_number,ws_order_number]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF4 wr_order_number->[ws_order_number]
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalProject
--------------------------------PhysicalOlapScan[web_returns] apply RFs: RF5
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF3 web_site_sk->[ws_web_site_sk]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ PhysicalResultSink
------------------------------PhysicalProject
--------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999))
----------------------------------PhysicalOlapScan[date_dim]
----------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF4 c_customer_sk->[ss_customer_sk]
----------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=()
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------PhysicalProject
----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF3 d_date_sk->[ss_sold_date_sk]
----------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF4 d_date_sk->[ws_sold_date_sk]
------------------------------PhysicalProject
--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF3 RF4
--------------------------------PhysicalOlapScan[web_sales] apply RFs: RF4
------------------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------------------PhysicalProject
----------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999))
------------------------------------PhysicalOlapScan[date_dim]
------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=()
------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF3 c_customer_sk->[ss_customer_sk]
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk]
--------------------------------PhysicalProject
----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF2
----------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 RF3
--------------------------------PhysicalDistribute[DistributionSpecReplicated]
----------------------------------PhysicalProject
------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ PhysicalResultSink
----------PhysicalDistribute[DistributionSpecHash]
------------hashAgg[LOCAL]
--------------PhysicalProject
----------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((catalog_sales.cs_item_sk = catalog_returns.cr_item_sk) and (catalog_sales.cs_order_number = catalog_returns.cr_order_number)) otherCondition=() build RFs:RF3 cs_order_number->[cr_order_number];RF4 cs_item_sk->[cr_item_sk]
----------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_warehouse_sk = warehouse.w_warehouse_sk)) otherCondition=() build RFs:RF4 w_warehouse_sk->[cs_warehouse_sk]
------------------PhysicalProject
--------------------PhysicalOlapScan[catalog_returns] apply RFs: RF3 RF4
------------------PhysicalProject
--------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_warehouse_sk = warehouse.w_warehouse_sk)) otherCondition=() build RFs:RF2 w_warehouse_sk->[cs_warehouse_sk]
--------------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((catalog_sales.cs_item_sk = catalog_returns.cr_item_sk) and (catalog_sales.cs_order_number = catalog_returns.cr_order_number)) otherCondition=() build RFs:RF2 cs_order_number->[cr_order_number];RF3 cs_item_sk->[cr_item_sk]
----------------------PhysicalProject
------------------------PhysicalOlapScan[catalog_returns] apply RFs: RF2 RF3
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[cs_sold_date_sk]
--------------------------PhysicalProject
----------------------------hashJoin[INNER_JOIN] hashCondition=((item.i_item_sk = catalog_sales.cs_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[cs_item_sk]
------------------------------PhysicalProject
--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 RF1 RF2
--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 RF1 RF4
------------------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------------------PhysicalProject
----------------------------------filter((item.i_current_price <= 1.49) and (item.i_current_price >= 0.99))
Expand All @@ -27,7 +27,7 @@ PhysicalResultSink
----------------------------PhysicalProject
------------------------------filter((date_dim.d_date <= '2001-06-01') and (date_dim.d_date >= '2001-04-02'))
--------------------------------PhysicalOlapScan[date_dim]
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------PhysicalOlapScan[warehouse]
------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------PhysicalProject
----------------------PhysicalOlapScan[warehouse]

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ PhysicalResultSink
----------PhysicalDistribute[DistributionSpecHash]
------------hashAgg[LOCAL]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_warehouse_sk = warehouse.w_warehouse_sk)) otherCondition=() build RFs:RF3 w_warehouse_sk->[ws_warehouse_sk]
----------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF3 web_site_sk->[ws_web_site_sk]
------------------PhysicalProject
--------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_ship_mode_sk = ship_mode.sm_ship_mode_sk)) otherCondition=() build RFs:RF2 sm_ship_mode_sk->[ws_ship_mode_sk]
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF1 web_site_sk->[ws_web_site_sk]
------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_warehouse_sk = warehouse.w_warehouse_sk)) otherCondition=() build RFs:RF1 w_warehouse_sk->[ws_warehouse_sk]
--------------------------PhysicalProject
----------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ws_ship_date_sk]
------------------------------PhysicalProject
Expand All @@ -23,11 +23,11 @@ PhysicalResultSink
------------------------------------PhysicalOlapScan[date_dim]
--------------------------PhysicalDistribute[DistributionSpecReplicated]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[web_site]
------------------------------PhysicalOlapScan[warehouse]
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------PhysicalOlapScan[ship_mode]
------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------PhysicalProject
----------------------PhysicalOlapScan[warehouse]
----------------------PhysicalOlapScan[web_site]

Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------hashAgg[DISTINCT_LOCAL]
--------------hashAgg[GLOBAL]
----------------hashAgg[LOCAL]
------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF6 ws_order_number->[ws_order_number]
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) otherCondition=() build RFs:RF5 ws_order_number->[wr_order_number];RF7 ws_order_number->[ws_order_number,ws_order_number]
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF4 wr_order_number->[ws_order_number]
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[web_returns] apply RFs: RF5
------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) otherCondition=() build RFs:RF6 ws_order_number->[wr_order_number,ws_order_number]
--------------------PhysicalProject
----------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number]
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF5 RF6
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------PhysicalProject
----------------------------PhysicalOlapScan[web_returns] apply RFs: RF6
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF7 ws_order_number->[ws_order_number,ws_order_number]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF3 web_site_sk->[ws_web_site_sk]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ PhysicalResultSink
----------PhysicalDistribute[DistributionSpecHash]
------------hashAgg[LOCAL]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_warehouse_sk = warehouse.w_warehouse_sk)) otherCondition=() build RFs:RF3 w_warehouse_sk->[cs_warehouse_sk]
----------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_call_center_sk = call_center.cc_call_center_sk)) otherCondition=() build RFs:RF3 cc_call_center_sk->[cs_call_center_sk]
------------------PhysicalProject
--------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_ship_mode_sk = ship_mode.sm_ship_mode_sk)) otherCondition=() build RFs:RF2 sm_ship_mode_sk->[cs_ship_mode_sk]
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_call_center_sk = call_center.cc_call_center_sk)) otherCondition=() build RFs:RF1 cc_call_center_sk->[cs_call_center_sk]
------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_warehouse_sk = warehouse.w_warehouse_sk)) otherCondition=() build RFs:RF1 w_warehouse_sk->[cs_warehouse_sk]
--------------------------PhysicalProject
----------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[cs_ship_date_sk]
------------------------------PhysicalProject
Expand All @@ -23,11 +23,11 @@ PhysicalResultSink
------------------------------------PhysicalOlapScan[date_dim]
--------------------------PhysicalDistribute[DistributionSpecReplicated]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[call_center]
------------------------------PhysicalOlapScan[warehouse]
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------PhysicalOlapScan[ship_mode]
------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------PhysicalProject
----------------------PhysicalOlapScan[warehouse]
----------------------PhysicalOlapScan[call_center]

Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
------filter((if((mean = 0.0), 0.0, (stdev / mean)) > 1.0))
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((inventory.inv_warehouse_sk = warehouse.w_warehouse_sk)) otherCondition=()
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------hashJoin[INNER_JOIN] hashCondition=((inventory.inv_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[inv_date_sk]
--------------------PhysicalProject
----------------------hashJoin[INNER_JOIN] hashCondition=((inventory.inv_item_sk = item.i_item_sk)) otherCondition=()
------------------------PhysicalOlapScan[inventory] apply RFs: RF1
------------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------------PhysicalProject
----------------------------PhysicalOlapScan[item]
--------------------PhysicalDistribute[DistributionSpecReplicated]
--------hashAgg[GLOBAL]
----------PhysicalDistribute[DistributionSpecHash]
------------hashAgg[LOCAL]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((inventory.inv_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[inv_date_sk]
------------------PhysicalProject
--------------------hashJoin[INNER_JOIN] hashCondition=((inventory.inv_warehouse_sk = warehouse.w_warehouse_sk)) otherCondition=()
----------------------PhysicalProject
------------------------filter((date_dim.d_year = 1998) and d_moy IN (1, 2))
--------------------------PhysicalOlapScan[date_dim]
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------PhysicalOlapScan[warehouse]
------------------------hashJoin[INNER_JOIN] hashCondition=((inventory.inv_item_sk = item.i_item_sk)) otherCondition=()
--------------------------PhysicalOlapScan[inventory] apply RFs: RF2
--------------------------PhysicalDistribute[DistributionSpecReplicated]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[item]
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------PhysicalOlapScan[warehouse]
------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------PhysicalProject
----------------------filter((date_dim.d_year = 1998) and d_moy IN (1, 2))
------------------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
----PhysicalQuickSort[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]
Expand Down
Loading

0 comments on commit 24accb6

Please sign in to comment.