Skip to content

Commit 13cf5a1

Browse files
committed
normalize expression after filter push down
1 parent 91a6a0b commit 13cf5a1

File tree

28 files changed

+183
-188
lines changed

28 files changed

+183
-188
lines changed

regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query13.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PhysicalResultSink
1919
------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=((((ca_state IN ('IL', 'TN', 'TX') AND ((store_sales.ss_net_profit >= 100.00) AND (store_sales.ss_net_profit <= 200.00))) OR (ca_state IN ('ID', 'OH', 'WY') AND ((store_sales.ss_net_profit >= 150.00) AND (store_sales.ss_net_profit <= 300.00)))) OR (ca_state IN ('IA', 'MS', 'SC') AND ((store_sales.ss_net_profit >= 50.00) AND (store_sales.ss_net_profit <= 250.00))))) build RFs:RF0 ca_address_sk->[ss_addr_sk]
2020
--------------------------PhysicalDistribute
2121
----------------------------PhysicalProject
22-
------------------------------filter(((((store_sales.ss_net_profit >= 100.00) AND (store_sales.ss_net_profit <= 200.00)) OR ((store_sales.ss_net_profit >= 150.00) AND (store_sales.ss_net_profit <= 300.00))) OR ((store_sales.ss_net_profit >= 50.00) AND (store_sales.ss_net_profit <= 250.00))) and ((((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00)) OR ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00))) OR ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00))))
22+
------------------------------filter((store_sales.ss_net_profit <= 300.00) and (store_sales.ss_net_profit >= 50.00) and (store_sales.ss_sales_price <= 200.00) and (store_sales.ss_sales_price >= 50.00))
2323
--------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1 RF2 RF4
2424
--------------------------PhysicalDistribute
2525
----------------------------PhysicalProject
@@ -31,7 +31,7 @@ PhysicalResultSink
3131
------------------------------PhysicalOlapScan[date_dim]
3232
----------------------PhysicalDistribute
3333
------------------------PhysicalProject
34-
--------------------------filter(((household_demographics.hd_dep_count = 3) OR (household_demographics.hd_dep_count = 1)))
34+
--------------------------filter(hd_dep_count IN (1, 3))
3535
----------------------------PhysicalOlapScan[household_demographics]
3636
------------PhysicalDistribute
3737
--------------PhysicalProject

regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query48.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ PhysicalResultSink
1313
--------------------PhysicalDistribute
1414
----------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = store_sales.ss_cdemo_sk)) otherCondition=((((((customer_demographics.cd_marital_status = 'S') AND (customer_demographics.cd_education_status = 'Secondary')) AND ((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00))) OR (((customer_demographics.cd_marital_status = 'M') AND (customer_demographics.cd_education_status = '2 yr Degree')) AND ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00)))) OR (((customer_demographics.cd_marital_status = 'D') AND (customer_demographics.cd_education_status = 'Advanced Degree')) AND ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00))))) build RFs:RF0 cd_demo_sk->[ss_cdemo_sk]
1515
------------------------PhysicalProject
16-
--------------------------filter(((((store_sales.ss_net_profit >= 0.00) AND (store_sales.ss_net_profit <= 2000.00)) OR ((store_sales.ss_net_profit >= 150.00) AND (store_sales.ss_net_profit <= 3000.00))) OR ((store_sales.ss_net_profit >= 50.00) AND (store_sales.ss_net_profit <= 25000.00))) and ((((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00)) OR ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00))) OR ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00))))
16+
--------------------------filter((store_sales.ss_net_profit <= 25000.00) and (store_sales.ss_net_profit >= 0.00) and (store_sales.ss_sales_price <= 200.00) and (store_sales.ss_sales_price >= 50.00))
1717
----------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1 RF2 RF3
1818
------------------------PhysicalDistribute
1919
--------------------------PhysicalProject

regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query85.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ PhysicalResultSink
3535
--------------------------------------------------PhysicalOlapScan[web_returns] apply RFs: RF1 RF2 RF3 RF9
3636
------------------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ws_sold_date_sk]
3737
--------------------------------------------------PhysicalProject
38-
----------------------------------------------------filter(((((web_sales.ws_net_profit >= 100.00) AND (web_sales.ws_net_profit <= 200.00)) OR ((web_sales.ws_net_profit >= 150.00) AND (web_sales.ws_net_profit <= 300.00))) OR ((web_sales.ws_net_profit >= 50.00) AND (web_sales.ws_net_profit <= 250.00))) and ((((web_sales.ws_sales_price >= 100.00) AND (web_sales.ws_sales_price <= 150.00)) OR ((web_sales.ws_sales_price >= 50.00) AND (web_sales.ws_sales_price <= 100.00))) OR ((web_sales.ws_sales_price >= 150.00) AND (web_sales.ws_sales_price <= 200.00))))
38+
----------------------------------------------------filter((web_sales.ws_net_profit <= 300.00) and (web_sales.ws_net_profit >= 50.00) and (web_sales.ws_sales_price <= 200.00) and (web_sales.ws_sales_price >= 50.00))
3939
------------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0
4040
--------------------------------------------------PhysicalDistribute
4141
----------------------------------------------------PhysicalProject

regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query95.out

+29-30
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,41 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
1313
--PhysicalResultSink
1414
----PhysicalTopN[MERGE_SORT]
1515
------PhysicalTopN[LOCAL_SORT]
16-
--------PhysicalProject
17-
----------hashAgg[DISTINCT_GLOBAL]
18-
------------PhysicalDistribute
19-
--------------hashAgg[DISTINCT_LOCAL]
20-
----------------hashAgg[GLOBAL]
21-
------------------hashAgg[LOCAL]
22-
--------------------PhysicalProject
23-
----------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) otherCondition=()
24-
------------------------PhysicalProject
25-
--------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number];RF6 wr_order_number->[ws_order_number,ws_order_number]
26-
----------------------------PhysicalDistribute
27-
------------------------------PhysicalProject
28-
--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
29-
----------------------------PhysicalDistribute
30-
------------------------------PhysicalProject
31-
--------------------------------PhysicalOlapScan[web_returns]
32-
------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF4 ws_order_number->[ws_order_number];RF7 ws_order_number->[ws_order_number,ws_order_number]
16+
--------hashAgg[DISTINCT_GLOBAL]
17+
----------PhysicalDistribute
18+
------------hashAgg[DISTINCT_LOCAL]
19+
--------------hashAgg[GLOBAL]
20+
----------------hashAgg[LOCAL]
21+
------------------PhysicalProject
22+
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) otherCondition=()
23+
----------------------PhysicalProject
24+
------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number];RF6 wr_order_number->[ws_order_number,ws_order_number]
3325
--------------------------PhysicalDistribute
3426
----------------------------PhysicalProject
3527
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
3628
--------------------------PhysicalDistribute
37-
----------------------------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]
38-
------------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_ship_date_sk]
39-
--------------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[ws_ship_addr_sk]
40-
----------------------------------PhysicalProject
41-
------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 RF2 RF3
42-
----------------------------------PhysicalDistribute
43-
------------------------------------PhysicalProject
44-
--------------------------------------filter((customer_address.ca_state = 'VA'))
45-
----------------------------------------PhysicalOlapScan[customer_address]
29+
----------------------------PhysicalProject
30+
------------------------------PhysicalOlapScan[web_returns]
31+
----------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF4 ws_order_number->[ws_order_number];RF7 ws_order_number->[ws_order_number,ws_order_number]
32+
------------------------PhysicalDistribute
33+
--------------------------PhysicalProject
34+
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
35+
------------------------PhysicalDistribute
36+
--------------------------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]
37+
----------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_ship_date_sk]
38+
------------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[ws_ship_addr_sk]
39+
--------------------------------PhysicalProject
40+
----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 RF2 RF3
4641
--------------------------------PhysicalDistribute
4742
----------------------------------PhysicalProject
48-
------------------------------------filter((date_dim.d_date <= '2001-05-31') and (date_dim.d_date >= '2001-04-01'))
49-
--------------------------------------PhysicalOlapScan[date_dim]
43+
------------------------------------filter((customer_address.ca_state = 'VA'))
44+
--------------------------------------PhysicalOlapScan[customer_address]
5045
------------------------------PhysicalDistribute
5146
--------------------------------PhysicalProject
52-
----------------------------------filter((web_site.web_company_name = 'pri'))
53-
------------------------------------PhysicalOlapScan[web_site]
47+
----------------------------------filter((date_dim.d_date <= '2001-05-31') and (date_dim.d_date >= '2001-04-01'))
48+
------------------------------------PhysicalOlapScan[date_dim]
49+
----------------------------PhysicalDistribute
50+
------------------------------PhysicalProject
51+
--------------------------------filter((web_site.web_company_name = 'pri'))
52+
----------------------------------PhysicalOlapScan[web_site]
5453

regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query13.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PhysicalResultSink
1414
----------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = store_sales.ss_cdemo_sk)) otherCondition=() build RFs:RF0 cd_demo_sk->[ss_cdemo_sk]
1515
------------------------PhysicalDistribute
1616
--------------------------PhysicalProject
17-
----------------------------filter(((((store_sales.ss_net_profit >= 100.00) AND (store_sales.ss_net_profit <= 200.00)) OR ((store_sales.ss_net_profit >= 150.00) AND (store_sales.ss_net_profit <= 300.00))) OR ((store_sales.ss_net_profit >= 50.00) AND (store_sales.ss_net_profit <= 250.00))) and ((((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00)) OR ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00))) OR ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00))))
17+
----------------------------filter((store_sales.ss_net_profit <= 300.00) and (store_sales.ss_net_profit >= 50.00) and (store_sales.ss_sales_price <= 200.00) and (store_sales.ss_sales_price >= 50.00))
1818
------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF2 RF3 RF4
1919
------------------------PhysicalDistribute
2020
--------------------------PhysicalProject
@@ -29,7 +29,7 @@ PhysicalResultSink
2929
------------------------PhysicalOlapScan[customer_address]
3030
----------------PhysicalDistribute
3131
------------------PhysicalProject
32-
--------------------filter(((household_demographics.hd_dep_count = 3) OR (household_demographics.hd_dep_count = 1)))
32+
--------------------filter(hd_dep_count IN (1, 3))
3333
----------------------PhysicalOlapScan[household_demographics]
3434
------------PhysicalDistribute
3535
--------------PhysicalProject

regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query48.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ PhysicalResultSink
1313
--------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = store_sales.ss_cdemo_sk)) otherCondition=((((((customer_demographics.cd_marital_status = 'U') AND (customer_demographics.cd_education_status = 'Primary')) AND ((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00))) OR (((customer_demographics.cd_marital_status = 'W') AND (customer_demographics.cd_education_status = 'College')) AND ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00)))) OR (((customer_demographics.cd_marital_status = 'D') AND (customer_demographics.cd_education_status = '2 yr Degree')) AND ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00))))) build RFs:RF0 cd_demo_sk->[ss_cdemo_sk]
1414
----------------------PhysicalDistribute
1515
------------------------PhysicalProject
16-
--------------------------filter(((((store_sales.ss_net_profit >= 0.00) AND (store_sales.ss_net_profit <= 2000.00)) OR ((store_sales.ss_net_profit >= 150.00) AND (store_sales.ss_net_profit <= 3000.00))) OR ((store_sales.ss_net_profit >= 50.00) AND (store_sales.ss_net_profit <= 25000.00))) and ((((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00)) OR ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00))) OR ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00))))
16+
--------------------------filter((store_sales.ss_net_profit <= 25000.00) and (store_sales.ss_net_profit >= 0.00) and (store_sales.ss_sales_price <= 200.00) and (store_sales.ss_sales_price >= 50.00))
1717
----------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF2 RF3
1818
----------------------PhysicalDistribute
1919
------------------------PhysicalProject

regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query85.out

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ PhysicalResultSink
2222
--------------------------------------hashJoin[INNER_JOIN] hashCondition=((cd1.cd_demo_sk = web_returns.wr_refunded_cdemo_sk)) otherCondition=((((((cd1.cd_marital_status = 'M') AND (cd1.cd_education_status = '4 yr Degree')) AND ((web_sales.ws_sales_price >= 100.00) AND (web_sales.ws_sales_price <= 150.00))) OR (((cd1.cd_marital_status = 'S') AND (cd1.cd_education_status = 'Secondary')) AND ((web_sales.ws_sales_price >= 50.00) AND (web_sales.ws_sales_price <= 100.00)))) OR (((cd1.cd_marital_status = 'W') AND (cd1.cd_education_status = 'Advanced Degree')) AND ((web_sales.ws_sales_price >= 150.00) AND (web_sales.ws_sales_price <= 200.00))))) build RFs:RF2 cd_demo_sk->[wr_refunded_cdemo_sk]
2323
----------------------------------------PhysicalDistribute
2424
------------------------------------------PhysicalProject
25-
--------------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = web_returns.wr_item_sk) and (web_sales.ws_order_number = web_returns.wr_order_number)) otherCondition=() build RFs:RF0 wr_item_sk->[ws_item_sk];RF1 wr_order_number->[ws_order_number]
25+
--------------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = web_returns.wr_item_sk) and (web_sales.ws_order_number = web_returns.wr_order_number)) otherCondition=() build RFs:RF0 ws_item_sk->[wr_item_sk];RF1 ws_order_number->[wr_order_number]
2626
----------------------------------------------PhysicalProject
27-
------------------------------------------------filter(((((web_sales.ws_net_profit >= 100.00) AND (web_sales.ws_net_profit <= 200.00)) OR ((web_sales.ws_net_profit >= 150.00) AND (web_sales.ws_net_profit <= 300.00))) OR ((web_sales.ws_net_profit >= 50.00) AND (web_sales.ws_net_profit <= 250.00))) and ((((web_sales.ws_sales_price >= 100.00) AND (web_sales.ws_sales_price <= 150.00)) OR ((web_sales.ws_sales_price >= 50.00) AND (web_sales.ws_sales_price <= 100.00))) OR ((web_sales.ws_sales_price >= 150.00) AND (web_sales.ws_sales_price <= 200.00))))
28-
--------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1 RF8
27+
------------------------------------------------PhysicalOlapScan[web_returns] apply RFs: RF0 RF1 RF2 RF7
2928
----------------------------------------------PhysicalProject
30-
------------------------------------------------PhysicalOlapScan[web_returns] apply RFs: RF2 RF7
29+
------------------------------------------------filter((web_sales.ws_net_profit <= 300.00) and (web_sales.ws_net_profit >= 50.00) and (web_sales.ws_sales_price <= 200.00) and (web_sales.ws_sales_price >= 50.00))
30+
--------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF8
3131
----------------------------------------PhysicalDistribute
3232
------------------------------------------PhysicalProject
3333
--------------------------------------------filter(((((cd1.cd_marital_status = 'M') AND (cd1.cd_education_status = '4 yr Degree')) OR ((cd1.cd_marital_status = 'S') AND (cd1.cd_education_status = 'Secondary'))) OR ((cd1.cd_marital_status = 'W') AND (cd1.cd_education_status = 'Advanced Degree'))))

0 commit comments

Comments
 (0)