diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 68462dacb0e53..071ecdb76b727 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -481,15 +481,13 @@ jobs: uses: actions/cache@v2 with: path: ./tpcds-sf-1 - key: tpcds-${{ hashFiles('tpcds-sf-1/.spark-tpcds-sf-1.md5') }} - restore-keys: | - tpcds- + key: tpcds-556111e35d400f56cb0625dc16e9063d54628320 - name: Checkout TPC-DS (SF=1) generated data repository if: steps.cache-tpcds-sf-1.outputs.cache-hit != 'true' uses: actions/checkout@v2 with: repository: maropu/spark-tpcds-sf-1 - ref: 6b660a53091bd6d23cbe58b0f09aae08e71cc667 + ref: 556111e35d400f56cb0625dc16e9063d54628320 path: ./tpcds-sf-1 - name: Cache Scala, SBT and Maven uses: actions/cache@v2 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt index a950e7b9e8639..47c4db9ee29c1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt @@ -54,7 +54,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#4), dynamicpruningexpression(sr_returned_date_sk#4 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk), IsNotNull(sr_customer_sk)] -ReadSchema: struct +ReadSchema: struct (2) ColumnarToRow [codegen id : 2] Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4] @@ -87,7 +87,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (9) BroadcastHashJoin [codegen id : 2] Left keys [1]: [sr_returned_date_sk#4] -Right keys [1]: [cast(d_date_sk#6 as bigint)] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 2] @@ -122,7 +122,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#19), dynamicpruningexpression(sr_returned_date_sk#19 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (16) ColumnarToRow [codegen id : 4] Input [4]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19] @@ -136,7 +136,7 @@ Output [1]: [d_date_sk#20] (19) BroadcastHashJoin [codegen id : 4] Left keys [1]: [sr_returned_date_sk#19] -Right keys [1]: [cast(d_date_sk#20 as bigint)] +Right keys [1]: [d_date_sk#20] Join condition: None (20) Project [codegen id : 4] @@ -185,7 +185,7 @@ Condition : isnotnull((avg(ctr_total_return) * 1.2)#31) (28) BroadcastExchange Input [2]: [(avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14#32] -Arguments: HashedRelationBroadcastMode(List(input[1, bigint, true]),false), [id=#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#33] (29) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ctr_store_sk#14] @@ -220,7 +220,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (36) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ctr_store_sk#14] -Right keys [1]: [cast(s_store_sk#34 as bigint)] +Right keys [1]: [s_store_sk#34] Join condition: None (37) Project [codegen id : 8] @@ -251,15 +251,15 @@ Condition : isnotnull(c_customer_sk#38) (43) Exchange Input [2]: [c_customer_sk#38, c_customer_id#39] -Arguments: hashpartitioning(cast(c_customer_sk#38 as bigint), 5), ENSURE_REQUIREMENTS, [id=#40] +Arguments: hashpartitioning(c_customer_sk#38, 5), ENSURE_REQUIREMENTS, [id=#40] (44) Sort [codegen id : 11] Input [2]: [c_customer_sk#38, c_customer_id#39] -Arguments: [cast(c_customer_sk#38 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [c_customer_sk#38 ASC NULLS FIRST], false, 0 (45) SortMergeJoin [codegen id : 12] Left keys [1]: [ctr_customer_sk#13] -Right keys [1]: [cast(c_customer_sk#38 as bigint)] +Right keys [1]: [c_customer_sk#38] Join condition: None (46) Project [codegen id : 12] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/simplified.txt index 3c8e30790d2b0..dea7ed93e7a1a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/simplified.txt @@ -11,7 +11,7 @@ TakeOrderedAndProject [c_customer_id] Project [ctr_customer_sk] BroadcastHashJoin [ctr_store_sk,s_store_sk] Project [ctr_customer_sk,ctr_store_sk] - BroadcastHashJoin [ctr_store_sk,ctr_store_skL,ctr_total_return,(avg(ctr_total_return) * 1.2)] + BroadcastHashJoin [ctr_store_sk,ctr_store_sk,ctr_total_return,(avg(ctr_total_return) * 1.2)] Filter [ctr_total_return] HashAggregate [sr_customer_sk,sr_store_sk,sum] [sum(UnscaledValue(sr_return_amt)),ctr_customer_sk,ctr_store_sk,ctr_total_return,sum] InputAdapter @@ -38,7 +38,7 @@ TakeOrderedAndProject [c_customer_id] BroadcastExchange #4 WholeStageCodegen (6) Filter [(avg(ctr_total_return) * 1.2)] - HashAggregate [ctr_store_sk,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_store_skL,sum,count] + HashAggregate [ctr_store_sk,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_store_sk,sum,count] InputAdapter Exchange [ctr_store_sk] #5 WholeStageCodegen (5) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt index 015228686d39b..21f0534974c01 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt @@ -51,7 +51,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#4), dynamicpruningexpression(sr_returned_date_sk#4 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk), IsNotNull(sr_customer_sk)] -ReadSchema: struct +ReadSchema: struct (2) ColumnarToRow [codegen id : 2] Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4] @@ -84,7 +84,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (9) BroadcastHashJoin [codegen id : 2] Left keys [1]: [sr_returned_date_sk#4] -Right keys [1]: [cast(d_date_sk#6 as bigint)] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 2] @@ -119,7 +119,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#19), dynamicpruningexpression(sr_returned_date_sk#19 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (16) ColumnarToRow [codegen id : 4] Input [4]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19] @@ -133,7 +133,7 @@ Output [1]: [d_date_sk#20] (19) BroadcastHashJoin [codegen id : 4] Left keys [1]: [sr_returned_date_sk#19] -Right keys [1]: [cast(d_date_sk#20 as bigint)] +Right keys [1]: [d_date_sk#20] Join condition: None (20) Project [codegen id : 4] @@ -182,7 +182,7 @@ Condition : isnotnull((avg(ctr_total_return) * 1.2)#31) (28) BroadcastExchange Input [2]: [(avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14#32] -Arguments: HashedRelationBroadcastMode(List(input[1, bigint, true]),false), [id=#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#33] (29) BroadcastHashJoin [codegen id : 9] Left keys [1]: [ctr_store_sk#14] @@ -217,7 +217,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (36) BroadcastHashJoin [codegen id : 9] Left keys [1]: [ctr_store_sk#14] -Right keys [1]: [cast(s_store_sk#34 as bigint)] +Right keys [1]: [s_store_sk#34] Join condition: None (37) Project [codegen id : 9] @@ -244,7 +244,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (42) BroadcastHashJoin [codegen id : 9] Left keys [1]: [ctr_customer_sk#13] -Right keys [1]: [cast(c_customer_sk#37 as bigint)] +Right keys [1]: [c_customer_sk#37] Join condition: None (43) Project [codegen id : 9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt index 674668ce9b61d..1a7ee26015049 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt @@ -5,7 +5,7 @@ TakeOrderedAndProject [c_customer_id] Project [ctr_customer_sk] BroadcastHashJoin [ctr_store_sk,s_store_sk] Project [ctr_customer_sk,ctr_store_sk] - BroadcastHashJoin [ctr_store_sk,ctr_store_skL,ctr_total_return,(avg(ctr_total_return) * 1.2)] + BroadcastHashJoin [ctr_store_sk,ctr_store_sk,ctr_total_return,(avg(ctr_total_return) * 1.2)] Filter [ctr_total_return] HashAggregate [sr_customer_sk,sr_store_sk,sum] [sum(UnscaledValue(sr_return_amt)),ctr_customer_sk,ctr_store_sk,ctr_total_return,sum] InputAdapter @@ -32,7 +32,7 @@ TakeOrderedAndProject [c_customer_id] BroadcastExchange #3 WholeStageCodegen (6) Filter [(avg(ctr_total_return) * 1.2)] - HashAggregate [ctr_store_sk,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_store_skL,sum,count] + HashAggregate [ctr_store_sk,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_store_sk,sum,count] InputAdapter Exchange [ctr_store_sk] #4 WholeStageCodegen (5) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt index 97467fe1dc1db..cc6b8786e2002 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt @@ -5,57 +5,57 @@ TakeOrderedAndProject (57) +- * HashAggregate (54) +- * Project (53) +- * SortMergeJoin Inner (52) - :- * Sort (27) - : +- Exchange (26) - : +- * Project (25) - : +- * SortMergeJoin Inner (24) - : :- * Sort (18) - : : +- Exchange (17) - : : +- * Project (16) - : : +- * BroadcastHashJoin Inner BuildRight (15) - : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) - : : +- BroadcastExchange (14) - : : +- * Filter (13) - : : +- * ColumnarToRow (12) - : : +- Scan parquet default.store (11) - : +- * Sort (23) - : +- Exchange (22) - : +- * Filter (21) - : +- * ColumnarToRow (20) - : +- Scan parquet default.item (19) + :- * Sort (43) + : +- Exchange (42) + : +- * Project (41) + : +- * SortMergeJoin Inner (40) + : :- * Sort (27) + : : +- Exchange (26) + : : +- * Project (25) + : : +- * SortMergeJoin Inner (24) + : : :- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.store (11) + : : +- * Sort (23) + : : +- Exchange (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.item (19) + : +- * Sort (39) + : +- Exchange (38) + : +- * Project (37) + : +- * BroadcastHashJoin Inner BuildRight (36) + : :- * Filter (30) + : : +- * ColumnarToRow (29) + : : +- Scan parquet default.store_returns (28) + : +- BroadcastExchange (35) + : +- * Project (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.date_dim (31) +- * Sort (51) +- Exchange (50) +- * Project (49) - +- * SortMergeJoin Inner (48) - :- * Sort (39) - : +- Exchange (38) - : +- * Project (37) - : +- * BroadcastHashJoin Inner BuildRight (36) - : :- * Filter (30) - : : +- * ColumnarToRow (29) - : : +- Scan parquet default.store_returns (28) - : +- BroadcastExchange (35) - : +- * Project (34) - : +- * Filter (33) - : +- * ColumnarToRow (32) - : +- Scan parquet default.date_dim (31) - +- * Sort (47) - +- Exchange (46) - +- * Project (45) - +- * BroadcastHashJoin Inner BuildRight (44) - :- * Filter (42) - : +- * ColumnarToRow (41) - : +- Scan parquet default.catalog_sales (40) - +- ReusedExchange (43) + +- * BroadcastHashJoin Inner BuildRight (48) + :- * Filter (46) + : +- * ColumnarToRow (45) + : +- Scan parquet default.catalog_sales (44) + +- ReusedExchange (47) (1) Scan parquet default.store_sales @@ -172,11 +172,11 @@ Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s (26) Exchange Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17] -Arguments: hashpartitioning(cast(ss_customer_sk#2 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint), 5), ENSURE_REQUIREMENTS, [id=#19] +Arguments: hashpartitioning(ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#19] (27) Sort [codegen id : 8] Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17] -Arguments: [cast(ss_customer_sk#2 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_customer_sk#2 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 (28) Scan parquet default.store_returns Output [5]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, sr_returned_date_sk#24] @@ -184,7 +184,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#24), dynamicpruningexpression(sr_returned_date_sk#24 IN dynamicpruning#25)] PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (29) ColumnarToRow [codegen id : 10] Input [5]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, sr_returned_date_sk#24] @@ -217,7 +217,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (36) BroadcastHashJoin [codegen id : 10] Left keys [1]: [sr_returned_date_sk#24] -Right keys [1]: [cast(d_date_sk#26 as bigint)] +Right keys [1]: [d_date_sk#26] Join condition: None (37) Project [codegen id : 10] @@ -226,94 +226,94 @@ Input [6]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_qua (38) Exchange Input [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] -Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, 5), ENSURE_REQUIREMENTS, [id=#29] +Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22, 5), ENSURE_REQUIREMENTS, [id=#29] (39) Sort [codegen id : 11] Input [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] +Arguments: [sr_customer_sk#21 ASC NULLS FIRST, sr_item_sk#20 ASC NULLS FIRST, sr_ticket_number#22 ASC NULLS FIRST], false, 0 + +(40) SortMergeJoin [codegen id : 12] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] +Right keys [3]: [sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22] +Join condition: None + +(41) Project [codegen id : 12] +Output [7]: [ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] + +(42) Exchange +Input [7]: [ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] +Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, 5), ENSURE_REQUIREMENTS, [id=#30] + +(43) Sort [codegen id : 13] +Input [7]: [ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] Arguments: [sr_customer_sk#21 ASC NULLS FIRST, sr_item_sk#20 ASC NULLS FIRST], false, 0 -(40) Scan parquet default.catalog_sales -Output [4]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32, cs_sold_date_sk#33] +(44) Scan parquet default.catalog_sales +Output [4]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33, cs_sold_date_sk#34] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#33), dynamicpruningexpression(cs_sold_date_sk#33 IN dynamicpruning#34)] +PartitionFilters: [isnotnull(cs_sold_date_sk#34), dynamicpruningexpression(cs_sold_date_sk#34 IN dynamicpruning#25)] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] ReadSchema: struct -(41) ColumnarToRow [codegen id : 13] -Input [4]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32, cs_sold_date_sk#33] +(45) ColumnarToRow [codegen id : 15] +Input [4]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33, cs_sold_date_sk#34] -(42) Filter [codegen id : 13] -Input [4]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32, cs_sold_date_sk#33] -Condition : (isnotnull(cs_bill_customer_sk#30) AND isnotnull(cs_item_sk#31)) +(46) Filter [codegen id : 15] +Input [4]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33, cs_sold_date_sk#34] +Condition : (isnotnull(cs_bill_customer_sk#31) AND isnotnull(cs_item_sk#32)) -(43) ReusedExchange [Reuses operator id: 35] +(47) ReusedExchange [Reuses operator id: 35] Output [1]: [d_date_sk#35] -(44) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [cs_sold_date_sk#33] +(48) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [cs_sold_date_sk#34] Right keys [1]: [d_date_sk#35] Join condition: None -(45) Project [codegen id : 13] -Output [3]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] -Input [5]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32, cs_sold_date_sk#33, d_date_sk#35] - -(46) Exchange -Input [3]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] -Arguments: hashpartitioning(cast(cs_bill_customer_sk#30 as bigint), cast(cs_item_sk#31 as bigint), 5), ENSURE_REQUIREMENTS, [id=#36] - -(47) Sort [codegen id : 14] -Input [3]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] -Arguments: [cast(cs_bill_customer_sk#30 as bigint) ASC NULLS FIRST, cast(cs_item_sk#31 as bigint) ASC NULLS FIRST], false, 0 - -(48) SortMergeJoin [codegen id : 15] -Left keys [2]: [sr_customer_sk#21, sr_item_sk#20] -Right keys [2]: [cast(cs_bill_customer_sk#30 as bigint), cast(cs_item_sk#31 as bigint)] -Join condition: None - (49) Project [codegen id : 15] -Output [5]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, cs_quantity#32] -Input [7]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] +Output [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Input [5]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33, cs_sold_date_sk#34, d_date_sk#35] (50) Exchange -Input [5]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, cs_quantity#32] -Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22, 5), ENSURE_REQUIREMENTS, [id=#37] +Input [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Arguments: hashpartitioning(cs_bill_customer_sk#31, cs_item_sk#32, 5), ENSURE_REQUIREMENTS, [id=#36] (51) Sort [codegen id : 16] -Input [5]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, cs_quantity#32] -Arguments: [sr_customer_sk#21 ASC NULLS FIRST, sr_item_sk#20 ASC NULLS FIRST, sr_ticket_number#22 ASC NULLS FIRST], false, 0 +Input [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Arguments: [cs_bill_customer_sk#31 ASC NULLS FIRST, cs_item_sk#32 ASC NULLS FIRST], false, 0 (52) SortMergeJoin [codegen id : 17] -Left keys [3]: [cast(ss_customer_sk#2 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] -Right keys [3]: [sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22] +Left keys [2]: [sr_customer_sk#21, sr_item_sk#20] +Right keys [2]: [cs_bill_customer_sk#31, cs_item_sk#32] Join condition: None (53) Project [codegen id : 17] -Output [6]: [ss_quantity#5, sr_return_quantity#23, cs_quantity#32, s_state#12, i_item_id#16, i_item_desc#17] -Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, cs_quantity#32] +Output [6]: [ss_quantity#5, sr_return_quantity#23, cs_quantity#33, s_state#12, i_item_id#16, i_item_desc#17] +Input [10]: [ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] (54) HashAggregate [codegen id : 17] -Input [6]: [ss_quantity#5, sr_return_quantity#23, cs_quantity#32, s_state#12, i_item_id#16, i_item_desc#17] +Input [6]: [ss_quantity#5, sr_return_quantity#23, cs_quantity#33, s_state#12, i_item_id#16, i_item_desc#17] Keys [3]: [i_item_id#16, i_item_desc#17, s_state#12] -Functions [9]: [partial_count(ss_quantity#5), partial_avg(ss_quantity#5), partial_stddev_samp(cast(ss_quantity#5 as double)), partial_count(sr_return_quantity#23), partial_avg(sr_return_quantity#23), partial_stddev_samp(cast(sr_return_quantity#23 as double)), partial_count(cs_quantity#32), partial_avg(cs_quantity#32), partial_stddev_samp(cast(cs_quantity#32 as double))] -Aggregate Attributes [18]: [count#38, sum#39, count#40, n#41, avg#42, m2#43, count#44, sum#45, count#46, n#47, avg#48, m2#49, count#50, sum#51, count#52, n#53, avg#54, m2#55] -Results [21]: [i_item_id#16, i_item_desc#17, s_state#12, count#56, sum#57, count#58, n#59, avg#60, m2#61, count#62, sum#63, count#64, n#65, avg#66, m2#67, count#68, sum#69, count#70, n#71, avg#72, m2#73] +Functions [9]: [partial_count(ss_quantity#5), partial_avg(ss_quantity#5), partial_stddev_samp(cast(ss_quantity#5 as double)), partial_count(sr_return_quantity#23), partial_avg(sr_return_quantity#23), partial_stddev_samp(cast(sr_return_quantity#23 as double)), partial_count(cs_quantity#33), partial_avg(cs_quantity#33), partial_stddev_samp(cast(cs_quantity#33 as double))] +Aggregate Attributes [18]: [count#37, sum#38, count#39, n#40, avg#41, m2#42, count#43, sum#44, count#45, n#46, avg#47, m2#48, count#49, sum#50, count#51, n#52, avg#53, m2#54] +Results [21]: [i_item_id#16, i_item_desc#17, s_state#12, count#55, sum#56, count#57, n#58, avg#59, m2#60, count#61, sum#62, count#63, n#64, avg#65, m2#66, count#67, sum#68, count#69, n#70, avg#71, m2#72] (55) Exchange -Input [21]: [i_item_id#16, i_item_desc#17, s_state#12, count#56, sum#57, count#58, n#59, avg#60, m2#61, count#62, sum#63, count#64, n#65, avg#66, m2#67, count#68, sum#69, count#70, n#71, avg#72, m2#73] -Arguments: hashpartitioning(i_item_id#16, i_item_desc#17, s_state#12, 5), ENSURE_REQUIREMENTS, [id=#74] +Input [21]: [i_item_id#16, i_item_desc#17, s_state#12, count#55, sum#56, count#57, n#58, avg#59, m2#60, count#61, sum#62, count#63, n#64, avg#65, m2#66, count#67, sum#68, count#69, n#70, avg#71, m2#72] +Arguments: hashpartitioning(i_item_id#16, i_item_desc#17, s_state#12, 5), ENSURE_REQUIREMENTS, [id=#73] (56) HashAggregate [codegen id : 18] -Input [21]: [i_item_id#16, i_item_desc#17, s_state#12, count#56, sum#57, count#58, n#59, avg#60, m2#61, count#62, sum#63, count#64, n#65, avg#66, m2#67, count#68, sum#69, count#70, n#71, avg#72, m2#73] +Input [21]: [i_item_id#16, i_item_desc#17, s_state#12, count#55, sum#56, count#57, n#58, avg#59, m2#60, count#61, sum#62, count#63, n#64, avg#65, m2#66, count#67, sum#68, count#69, n#70, avg#71, m2#72] Keys [3]: [i_item_id#16, i_item_desc#17, s_state#12] -Functions [9]: [count(ss_quantity#5), avg(ss_quantity#5), stddev_samp(cast(ss_quantity#5 as double)), count(sr_return_quantity#23), avg(sr_return_quantity#23), stddev_samp(cast(sr_return_quantity#23 as double)), count(cs_quantity#32), avg(cs_quantity#32), stddev_samp(cast(cs_quantity#32 as double))] -Aggregate Attributes [9]: [count(ss_quantity#5)#75, avg(ss_quantity#5)#76, stddev_samp(cast(ss_quantity#5 as double))#77, count(sr_return_quantity#23)#78, avg(sr_return_quantity#23)#79, stddev_samp(cast(sr_return_quantity#23 as double))#80, count(cs_quantity#32)#81, avg(cs_quantity#32)#82, stddev_samp(cast(cs_quantity#32 as double))#83] -Results [15]: [i_item_id#16, i_item_desc#17, s_state#12, count(ss_quantity#5)#75 AS store_sales_quantitycount#84, avg(ss_quantity#5)#76 AS store_sales_quantityave#85, stddev_samp(cast(ss_quantity#5 as double))#77 AS store_sales_quantitystdev#86, (stddev_samp(cast(ss_quantity#5 as double))#77 / avg(ss_quantity#5)#76) AS store_sales_quantitycov#87, count(sr_return_quantity#23)#78 AS as_store_returns_quantitycount#88, avg(sr_return_quantity#23)#79 AS as_store_returns_quantityave#89, stddev_samp(cast(sr_return_quantity#23 as double))#80 AS as_store_returns_quantitystdev#90, (stddev_samp(cast(sr_return_quantity#23 as double))#80 / avg(sr_return_quantity#23)#79) AS store_returns_quantitycov#91, count(cs_quantity#32)#81 AS catalog_sales_quantitycount#92, avg(cs_quantity#32)#82 AS catalog_sales_quantityave#93, (stddev_samp(cast(cs_quantity#32 as double))#83 / avg(cs_quantity#32)#82) AS catalog_sales_quantitystdev#94, (stddev_samp(cast(cs_quantity#32 as double))#83 / avg(cs_quantity#32)#82) AS catalog_sales_quantitycov#95] +Functions [9]: [count(ss_quantity#5), avg(ss_quantity#5), stddev_samp(cast(ss_quantity#5 as double)), count(sr_return_quantity#23), avg(sr_return_quantity#23), stddev_samp(cast(sr_return_quantity#23 as double)), count(cs_quantity#33), avg(cs_quantity#33), stddev_samp(cast(cs_quantity#33 as double))] +Aggregate Attributes [9]: [count(ss_quantity#5)#74, avg(ss_quantity#5)#75, stddev_samp(cast(ss_quantity#5 as double))#76, count(sr_return_quantity#23)#77, avg(sr_return_quantity#23)#78, stddev_samp(cast(sr_return_quantity#23 as double))#79, count(cs_quantity#33)#80, avg(cs_quantity#33)#81, stddev_samp(cast(cs_quantity#33 as double))#82] +Results [15]: [i_item_id#16, i_item_desc#17, s_state#12, count(ss_quantity#5)#74 AS store_sales_quantitycount#83, avg(ss_quantity#5)#75 AS store_sales_quantityave#84, stddev_samp(cast(ss_quantity#5 as double))#76 AS store_sales_quantitystdev#85, (stddev_samp(cast(ss_quantity#5 as double))#76 / avg(ss_quantity#5)#75) AS store_sales_quantitycov#86, count(sr_return_quantity#23)#77 AS as_store_returns_quantitycount#87, avg(sr_return_quantity#23)#78 AS as_store_returns_quantityave#88, stddev_samp(cast(sr_return_quantity#23 as double))#79 AS as_store_returns_quantitystdev#89, (stddev_samp(cast(sr_return_quantity#23 as double))#79 / avg(sr_return_quantity#23)#78) AS store_returns_quantitycov#90, count(cs_quantity#33)#80 AS catalog_sales_quantitycount#91, avg(cs_quantity#33)#81 AS catalog_sales_quantityave#92, (stddev_samp(cast(cs_quantity#33 as double))#82 / avg(cs_quantity#33)#81) AS catalog_sales_quantitystdev#93, (stddev_samp(cast(cs_quantity#33 as double))#82 / avg(cs_quantity#33)#81) AS catalog_sales_quantitycov#94] (57) TakeOrderedAndProject -Input [15]: [i_item_id#16, i_item_desc#17, s_state#12, store_sales_quantitycount#84, store_sales_quantityave#85, store_sales_quantitystdev#86, store_sales_quantitycov#87, as_store_returns_quantitycount#88, as_store_returns_quantityave#89, as_store_returns_quantitystdev#90, store_returns_quantitycov#91, catalog_sales_quantitycount#92, catalog_sales_quantityave#93, catalog_sales_quantitystdev#94, catalog_sales_quantitycov#95] -Arguments: 100, [i_item_id#16 ASC NULLS FIRST, i_item_desc#17 ASC NULLS FIRST, s_state#12 ASC NULLS FIRST], [i_item_id#16, i_item_desc#17, s_state#12, store_sales_quantitycount#84, store_sales_quantityave#85, store_sales_quantitystdev#86, store_sales_quantitycov#87, as_store_returns_quantitycount#88, as_store_returns_quantityave#89, as_store_returns_quantitystdev#90, store_returns_quantitycov#91, catalog_sales_quantitycount#92, catalog_sales_quantityave#93, catalog_sales_quantitystdev#94, catalog_sales_quantitycov#95] +Input [15]: [i_item_id#16, i_item_desc#17, s_state#12, store_sales_quantitycount#83, store_sales_quantityave#84, store_sales_quantitystdev#85, store_sales_quantitycov#86, as_store_returns_quantitycount#87, as_store_returns_quantityave#88, as_store_returns_quantitystdev#89, store_returns_quantitycov#90, catalog_sales_quantitycount#91, catalog_sales_quantityave#92, catalog_sales_quantitystdev#93, catalog_sales_quantitycov#94] +Arguments: 100, [i_item_id#16 ASC NULLS FIRST, i_item_desc#17 ASC NULLS FIRST, s_state#12 ASC NULLS FIRST], [i_item_id#16, i_item_desc#17, s_state#12, store_sales_quantitycount#83, store_sales_quantityave#84, store_sales_quantitystdev#85, store_sales_quantitycov#86, as_store_returns_quantitycount#87, as_store_returns_quantityave#88, as_store_returns_quantitystdev#89, store_returns_quantitycov#90, catalog_sales_quantitycount#91, catalog_sales_quantityave#92, catalog_sales_quantitystdev#93, catalog_sales_quantitycov#94] ===== Subqueries ===== @@ -331,11 +331,6 @@ ReusedExchange (59) (59) ReusedExchange [Reuses operator id: 35] Output [1]: [d_date_sk#26] -Subquery:3 Hosting operator id = 40 Hosting Expression = cs_sold_date_sk#33 IN dynamicpruning#34 -ReusedExchange (60) - - -(60) ReusedExchange [Reuses operator id: 35] -Output [1]: [d_date_sk#35] +Subquery:3 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#34 IN dynamicpruning#25 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt index 81f589cd2ed90..cda77e94f5b7f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt @@ -6,69 +6,69 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s WholeStageCodegen (17) HashAggregate [i_item_id,i_item_desc,s_state,ss_quantity,sr_return_quantity,cs_quantity] [count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2] Project [ss_quantity,sr_return_quantity,cs_quantity,s_state,i_item_id,i_item_desc] - SortMergeJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number] + SortMergeJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk] InputAdapter - WholeStageCodegen (8) - Sort [ss_customer_sk,ss_item_sk,ss_ticket_number] + WholeStageCodegen (13) + Sort [sr_customer_sk,sr_item_sk] InputAdapter - Exchange [ss_customer_sk,ss_item_sk,ss_ticket_number] #2 - WholeStageCodegen (7) - Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_state,i_item_id,i_item_desc] - SortMergeJoin [ss_item_sk,i_item_sk] + Exchange [sr_customer_sk,sr_item_sk] #2 + WholeStageCodegen (12) + Project [ss_quantity,s_state,i_item_id,i_item_desc,sr_item_sk,sr_customer_sk,sr_return_quantity] + SortMergeJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number] InputAdapter - WholeStageCodegen (4) - Sort [ss_item_sk] + WholeStageCodegen (8) + Sort [ss_customer_sk,ss_item_sk,ss_ticket_number] InputAdapter - Exchange [ss_item_sk] #3 - WholeStageCodegen (3) - Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_state] - BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity,ss_sold_date_sk] - SubqueryBroadcast [d_date_sk] #1 - ReusedExchange [d_date_sk] #4 - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_quarter_name,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_quarter_name] + Exchange [ss_customer_sk,ss_item_sk,ss_ticket_number] #3 + WholeStageCodegen (7) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_state,i_item_id,i_item_desc] + SortMergeJoin [ss_item_sk,i_item_sk] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (2) - Filter [s_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store [s_store_sk,s_state] - InputAdapter - WholeStageCodegen (6) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #6 - WholeStageCodegen (5) - Filter [i_item_sk] - ColumnarToRow + WholeStageCodegen (4) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (3) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_quarter_name,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_quarter_name] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc] - InputAdapter - WholeStageCodegen (16) - Sort [sr_customer_sk,sr_item_sk,sr_ticket_number] - InputAdapter - Exchange [sr_customer_sk,sr_item_sk,sr_ticket_number] #7 - WholeStageCodegen (15) - Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity,cs_quantity] - SortMergeJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk] + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #7 + WholeStageCodegen (5) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc] InputAdapter WholeStageCodegen (11) - Sort [sr_customer_sk,sr_item_sk] + Sort [sr_customer_sk,sr_item_sk,sr_ticket_number] InputAdapter - Exchange [sr_customer_sk,sr_item_sk] #8 + Exchange [sr_customer_sk,sr_item_sk,sr_ticket_number] #8 WholeStageCodegen (10) Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity] BroadcastHashJoin [sr_returned_date_sk,d_date_sk] @@ -86,19 +86,18 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_quarter_name] + InputAdapter + WholeStageCodegen (16) + Sort [cs_bill_customer_sk,cs_item_sk] + InputAdapter + Exchange [cs_bill_customer_sk,cs_item_sk] #10 + WholeStageCodegen (15) + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 InputAdapter - WholeStageCodegen (14) - Sort [cs_bill_customer_sk,cs_item_sk] - InputAdapter - Exchange [cs_bill_customer_sk,cs_item_sk] #10 - WholeStageCodegen (13) - Project [cs_bill_customer_sk,cs_item_sk,cs_quantity] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_bill_customer_sk,cs_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_sold_date_sk] - SubqueryBroadcast [d_date_sk] #3 - ReusedExchange [d_date_sk] #9 - InputAdapter - ReusedExchange [d_date_sk] #9 + ReusedExchange [d_date_sk] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt index 32c8de9a1d16e..467bcc3b429c9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt @@ -70,7 +70,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#12), dynamicpruningexpression(sr_returned_date_sk#12 IN dynamicpruning#13)] PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] @@ -81,10 +81,10 @@ Condition : ((isnotnull(sr_customer_sk#9) AND isnotnull(sr_item_sk#8)) AND isnot (7) BroadcastExchange Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false], input[2, bigint, false]),false), [id=#14] +Arguments: HashedRelationBroadcastMode(List(input[1, int, false], input[0, int, false], input[2, int, false]),false), [id=#14] (8) BroadcastHashJoin [codegen id : 8] -Left keys [3]: [cast(ss_customer_sk#2 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] Right keys [3]: [sr_customer_sk#9, sr_item_sk#8, sr_ticket_number#10] Join condition: None @@ -96,7 +96,7 @@ Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, Output [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#19)] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#13)] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] ReadSchema: struct @@ -109,11 +109,11 @@ Condition : (isnotnull(cs_bill_customer_sk#15) AND isnotnull(cs_item_sk#16)) (13) BroadcastExchange Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[1, int, false] as bigint)),false), [id=#20] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[1, int, false] as bigint) & 4294967295))),false), [id=#19] (14) BroadcastHashJoin [codegen id : 8] Left keys [2]: [sr_customer_sk#9, sr_item_sk#8] -Right keys [2]: [cast(cs_bill_customer_sk#15 as bigint), cast(cs_item_sk#16 as bigint)] +Right keys [2]: [cs_bill_customer_sk#15, cs_item_sk#16] Join condition: None (15) Project [codegen id : 8] @@ -121,154 +121,154 @@ Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_r Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_return_quantity#11, sr_returned_date_sk#12, cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] (16) Scan parquet default.date_dim -Output [2]: [d_date_sk#21, d_quarter_name#22] +Output [2]: [d_date_sk#20, d_quarter_name#21] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_quarter_name), EqualTo(d_quarter_name,2001Q1), IsNotNull(d_date_sk)] ReadSchema: struct (17) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#21, d_quarter_name#22] +Input [2]: [d_date_sk#20, d_quarter_name#21] (18) Filter [codegen id : 3] -Input [2]: [d_date_sk#21, d_quarter_name#22] -Condition : ((isnotnull(d_quarter_name#22) AND (d_quarter_name#22 = 2001Q1)) AND isnotnull(d_date_sk#21)) +Input [2]: [d_date_sk#20, d_quarter_name#21] +Condition : ((isnotnull(d_quarter_name#21) AND (d_quarter_name#21 = 2001Q1)) AND isnotnull(d_date_sk#20)) (19) Project [codegen id : 3] -Output [1]: [d_date_sk#21] -Input [2]: [d_date_sk#21, d_quarter_name#22] +Output [1]: [d_date_sk#20] +Input [2]: [d_date_sk#20, d_quarter_name#21] (20) BroadcastExchange -Input [1]: [d_date_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (21) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ss_sold_date_sk#6] -Right keys [1]: [d_date_sk#21] +Right keys [1]: [d_date_sk#20] Join condition: None (22) Project [codegen id : 8] Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18] -Input [9]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#21] +Input [9]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#20] (23) Scan parquet default.date_dim -Output [2]: [d_date_sk#24, d_quarter_name#25] +Output [2]: [d_date_sk#23, d_quarter_name#24] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [In(d_quarter_name, [2001Q1,2001Q2,2001Q3]), IsNotNull(d_date_sk)] ReadSchema: struct (24) ColumnarToRow [codegen id : 4] -Input [2]: [d_date_sk#24, d_quarter_name#25] +Input [2]: [d_date_sk#23, d_quarter_name#24] (25) Filter [codegen id : 4] -Input [2]: [d_date_sk#24, d_quarter_name#25] -Condition : (d_quarter_name#25 IN (2001Q1,2001Q2,2001Q3) AND isnotnull(d_date_sk#24)) +Input [2]: [d_date_sk#23, d_quarter_name#24] +Condition : (d_quarter_name#24 IN (2001Q1,2001Q2,2001Q3) AND isnotnull(d_date_sk#23)) (26) Project [codegen id : 4] -Output [1]: [d_date_sk#24] -Input [2]: [d_date_sk#24, d_quarter_name#25] +Output [1]: [d_date_sk#23] +Input [2]: [d_date_sk#23, d_quarter_name#24] (27) BroadcastExchange -Input [1]: [d_date_sk#24] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] +Input [1]: [d_date_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] (28) BroadcastHashJoin [codegen id : 8] Left keys [1]: [sr_returned_date_sk#12] -Right keys [1]: [cast(d_date_sk#24 as bigint)] +Right keys [1]: [d_date_sk#23] Join condition: None (29) Project [codegen id : 8] Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, cs_sold_date_sk#18] -Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#24] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#23] (30) ReusedExchange [Reuses operator id: 27] -Output [1]: [d_date_sk#27] +Output [1]: [d_date_sk#26] (31) BroadcastHashJoin [codegen id : 8] Left keys [1]: [cs_sold_date_sk#18] -Right keys [1]: [d_date_sk#27] +Right keys [1]: [d_date_sk#26] Join condition: None (32) Project [codegen id : 8] Output [5]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17] -Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#27] +Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#26] (33) Scan parquet default.store -Output [2]: [s_store_sk#28, s_state#29] +Output [2]: [s_store_sk#27, s_state#28] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (34) ColumnarToRow [codegen id : 6] -Input [2]: [s_store_sk#28, s_state#29] +Input [2]: [s_store_sk#27, s_state#28] (35) Filter [codegen id : 6] -Input [2]: [s_store_sk#28, s_state#29] -Condition : isnotnull(s_store_sk#28) +Input [2]: [s_store_sk#27, s_state#28] +Condition : isnotnull(s_store_sk#27) (36) BroadcastExchange -Input [2]: [s_store_sk#28, s_state#29] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] +Input [2]: [s_store_sk#27, s_state#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] (37) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ss_store_sk#3] -Right keys [1]: [s_store_sk#28] +Right keys [1]: [s_store_sk#27] Join condition: None (38) Project [codegen id : 8] -Output [5]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#29] -Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_store_sk#28, s_state#29] +Output [5]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#28] +Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_store_sk#27, s_state#28] (39) Scan parquet default.item -Output [3]: [i_item_sk#31, i_item_id#32, i_item_desc#33] +Output [3]: [i_item_sk#30, i_item_id#31, i_item_desc#32] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct (40) ColumnarToRow [codegen id : 7] -Input [3]: [i_item_sk#31, i_item_id#32, i_item_desc#33] +Input [3]: [i_item_sk#30, i_item_id#31, i_item_desc#32] (41) Filter [codegen id : 7] -Input [3]: [i_item_sk#31, i_item_id#32, i_item_desc#33] -Condition : isnotnull(i_item_sk#31) +Input [3]: [i_item_sk#30, i_item_id#31, i_item_desc#32] +Condition : isnotnull(i_item_sk#30) (42) BroadcastExchange -Input [3]: [i_item_sk#31, i_item_id#32, i_item_desc#33] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] +Input [3]: [i_item_sk#30, i_item_id#31, i_item_desc#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] (43) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ss_item_sk#1] -Right keys [1]: [i_item_sk#31] +Right keys [1]: [i_item_sk#30] Join condition: None (44) Project [codegen id : 8] -Output [6]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#29, i_item_id#32, i_item_desc#33] -Input [8]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#29, i_item_sk#31, i_item_id#32, i_item_desc#33] +Output [6]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#28, i_item_id#31, i_item_desc#32] +Input [8]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#28, i_item_sk#30, i_item_id#31, i_item_desc#32] (45) HashAggregate [codegen id : 8] -Input [6]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#29, i_item_id#32, i_item_desc#33] -Keys [3]: [i_item_id#32, i_item_desc#33, s_state#29] +Input [6]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#28, i_item_id#31, i_item_desc#32] +Keys [3]: [i_item_id#31, i_item_desc#32, s_state#28] Functions [9]: [partial_count(ss_quantity#5), partial_avg(ss_quantity#5), partial_stddev_samp(cast(ss_quantity#5 as double)), partial_count(sr_return_quantity#11), partial_avg(sr_return_quantity#11), partial_stddev_samp(cast(sr_return_quantity#11 as double)), partial_count(cs_quantity#17), partial_avg(cs_quantity#17), partial_stddev_samp(cast(cs_quantity#17 as double))] -Aggregate Attributes [18]: [count#35, sum#36, count#37, n#38, avg#39, m2#40, count#41, sum#42, count#43, n#44, avg#45, m2#46, count#47, sum#48, count#49, n#50, avg#51, m2#52] -Results [21]: [i_item_id#32, i_item_desc#33, s_state#29, count#53, sum#54, count#55, n#56, avg#57, m2#58, count#59, sum#60, count#61, n#62, avg#63, m2#64, count#65, sum#66, count#67, n#68, avg#69, m2#70] +Aggregate Attributes [18]: [count#34, sum#35, count#36, n#37, avg#38, m2#39, count#40, sum#41, count#42, n#43, avg#44, m2#45, count#46, sum#47, count#48, n#49, avg#50, m2#51] +Results [21]: [i_item_id#31, i_item_desc#32, s_state#28, count#52, sum#53, count#54, n#55, avg#56, m2#57, count#58, sum#59, count#60, n#61, avg#62, m2#63, count#64, sum#65, count#66, n#67, avg#68, m2#69] (46) Exchange -Input [21]: [i_item_id#32, i_item_desc#33, s_state#29, count#53, sum#54, count#55, n#56, avg#57, m2#58, count#59, sum#60, count#61, n#62, avg#63, m2#64, count#65, sum#66, count#67, n#68, avg#69, m2#70] -Arguments: hashpartitioning(i_item_id#32, i_item_desc#33, s_state#29, 5), ENSURE_REQUIREMENTS, [id=#71] +Input [21]: [i_item_id#31, i_item_desc#32, s_state#28, count#52, sum#53, count#54, n#55, avg#56, m2#57, count#58, sum#59, count#60, n#61, avg#62, m2#63, count#64, sum#65, count#66, n#67, avg#68, m2#69] +Arguments: hashpartitioning(i_item_id#31, i_item_desc#32, s_state#28, 5), ENSURE_REQUIREMENTS, [id=#70] (47) HashAggregate [codegen id : 9] -Input [21]: [i_item_id#32, i_item_desc#33, s_state#29, count#53, sum#54, count#55, n#56, avg#57, m2#58, count#59, sum#60, count#61, n#62, avg#63, m2#64, count#65, sum#66, count#67, n#68, avg#69, m2#70] -Keys [3]: [i_item_id#32, i_item_desc#33, s_state#29] +Input [21]: [i_item_id#31, i_item_desc#32, s_state#28, count#52, sum#53, count#54, n#55, avg#56, m2#57, count#58, sum#59, count#60, n#61, avg#62, m2#63, count#64, sum#65, count#66, n#67, avg#68, m2#69] +Keys [3]: [i_item_id#31, i_item_desc#32, s_state#28] Functions [9]: [count(ss_quantity#5), avg(ss_quantity#5), stddev_samp(cast(ss_quantity#5 as double)), count(sr_return_quantity#11), avg(sr_return_quantity#11), stddev_samp(cast(sr_return_quantity#11 as double)), count(cs_quantity#17), avg(cs_quantity#17), stddev_samp(cast(cs_quantity#17 as double))] -Aggregate Attributes [9]: [count(ss_quantity#5)#72, avg(ss_quantity#5)#73, stddev_samp(cast(ss_quantity#5 as double))#74, count(sr_return_quantity#11)#75, avg(sr_return_quantity#11)#76, stddev_samp(cast(sr_return_quantity#11 as double))#77, count(cs_quantity#17)#78, avg(cs_quantity#17)#79, stddev_samp(cast(cs_quantity#17 as double))#80] -Results [15]: [i_item_id#32, i_item_desc#33, s_state#29, count(ss_quantity#5)#72 AS store_sales_quantitycount#81, avg(ss_quantity#5)#73 AS store_sales_quantityave#82, stddev_samp(cast(ss_quantity#5 as double))#74 AS store_sales_quantitystdev#83, (stddev_samp(cast(ss_quantity#5 as double))#74 / avg(ss_quantity#5)#73) AS store_sales_quantitycov#84, count(sr_return_quantity#11)#75 AS as_store_returns_quantitycount#85, avg(sr_return_quantity#11)#76 AS as_store_returns_quantityave#86, stddev_samp(cast(sr_return_quantity#11 as double))#77 AS as_store_returns_quantitystdev#87, (stddev_samp(cast(sr_return_quantity#11 as double))#77 / avg(sr_return_quantity#11)#76) AS store_returns_quantitycov#88, count(cs_quantity#17)#78 AS catalog_sales_quantitycount#89, avg(cs_quantity#17)#79 AS catalog_sales_quantityave#90, (stddev_samp(cast(cs_quantity#17 as double))#80 / avg(cs_quantity#17)#79) AS catalog_sales_quantitystdev#91, (stddev_samp(cast(cs_quantity#17 as double))#80 / avg(cs_quantity#17)#79) AS catalog_sales_quantitycov#92] +Aggregate Attributes [9]: [count(ss_quantity#5)#71, avg(ss_quantity#5)#72, stddev_samp(cast(ss_quantity#5 as double))#73, count(sr_return_quantity#11)#74, avg(sr_return_quantity#11)#75, stddev_samp(cast(sr_return_quantity#11 as double))#76, count(cs_quantity#17)#77, avg(cs_quantity#17)#78, stddev_samp(cast(cs_quantity#17 as double))#79] +Results [15]: [i_item_id#31, i_item_desc#32, s_state#28, count(ss_quantity#5)#71 AS store_sales_quantitycount#80, avg(ss_quantity#5)#72 AS store_sales_quantityave#81, stddev_samp(cast(ss_quantity#5 as double))#73 AS store_sales_quantitystdev#82, (stddev_samp(cast(ss_quantity#5 as double))#73 / avg(ss_quantity#5)#72) AS store_sales_quantitycov#83, count(sr_return_quantity#11)#74 AS as_store_returns_quantitycount#84, avg(sr_return_quantity#11)#75 AS as_store_returns_quantityave#85, stddev_samp(cast(sr_return_quantity#11 as double))#76 AS as_store_returns_quantitystdev#86, (stddev_samp(cast(sr_return_quantity#11 as double))#76 / avg(sr_return_quantity#11)#75) AS store_returns_quantitycov#87, count(cs_quantity#17)#77 AS catalog_sales_quantitycount#88, avg(cs_quantity#17)#78 AS catalog_sales_quantityave#89, (stddev_samp(cast(cs_quantity#17 as double))#79 / avg(cs_quantity#17)#78) AS catalog_sales_quantitystdev#90, (stddev_samp(cast(cs_quantity#17 as double))#79 / avg(cs_quantity#17)#78) AS catalog_sales_quantitycov#91] (48) TakeOrderedAndProject -Input [15]: [i_item_id#32, i_item_desc#33, s_state#29, store_sales_quantitycount#81, store_sales_quantityave#82, store_sales_quantitystdev#83, store_sales_quantitycov#84, as_store_returns_quantitycount#85, as_store_returns_quantityave#86, as_store_returns_quantitystdev#87, store_returns_quantitycov#88, catalog_sales_quantitycount#89, catalog_sales_quantityave#90, catalog_sales_quantitystdev#91, catalog_sales_quantitycov#92] -Arguments: 100, [i_item_id#32 ASC NULLS FIRST, i_item_desc#33 ASC NULLS FIRST, s_state#29 ASC NULLS FIRST], [i_item_id#32, i_item_desc#33, s_state#29, store_sales_quantitycount#81, store_sales_quantityave#82, store_sales_quantitystdev#83, store_sales_quantitycov#84, as_store_returns_quantitycount#85, as_store_returns_quantityave#86, as_store_returns_quantitystdev#87, store_returns_quantitycov#88, catalog_sales_quantitycount#89, catalog_sales_quantityave#90, catalog_sales_quantitystdev#91, catalog_sales_quantitycov#92] +Input [15]: [i_item_id#31, i_item_desc#32, s_state#28, store_sales_quantitycount#80, store_sales_quantityave#81, store_sales_quantitystdev#82, store_sales_quantitycov#83, as_store_returns_quantitycount#84, as_store_returns_quantityave#85, as_store_returns_quantitystdev#86, store_returns_quantitycov#87, catalog_sales_quantitycount#88, catalog_sales_quantityave#89, catalog_sales_quantitystdev#90, catalog_sales_quantitycov#91] +Arguments: 100, [i_item_id#31 ASC NULLS FIRST, i_item_desc#32 ASC NULLS FIRST, s_state#28 ASC NULLS FIRST], [i_item_id#31, i_item_desc#32, s_state#28, store_sales_quantitycount#80, store_sales_quantityave#81, store_sales_quantitystdev#82, store_sales_quantitycov#83, as_store_returns_quantitycount#84, as_store_returns_quantityave#85, as_store_returns_quantitystdev#86, store_returns_quantitycov#87, catalog_sales_quantitycount#88, catalog_sales_quantityave#89, catalog_sales_quantitystdev#90, catalog_sales_quantitycov#91] ===== Subqueries ===== @@ -277,20 +277,15 @@ ReusedExchange (49) (49) ReusedExchange [Reuses operator id: 20] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#20] Subquery:2 Hosting operator id = 4 Hosting Expression = sr_returned_date_sk#12 IN dynamicpruning#13 ReusedExchange (50) (50) ReusedExchange [Reuses operator id: 27] -Output [1]: [d_date_sk#24] +Output [1]: [d_date_sk#23] -Subquery:3 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#19 -ReusedExchange (51) - - -(51) ReusedExchange [Reuses operator id: 27] -Output [1]: [d_date_sk#27] +Subquery:3 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#13 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt index a73abc1a8877f..6d6fab87255f4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt @@ -41,8 +41,7 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_sold_date_sk] - SubqueryBroadcast [d_date_sk] #3 - ReusedExchange [d_date_sk] #4 + ReusedSubquery [d_date_sk] #2 InputAdapter BroadcastExchange #2 WholeStageCodegen (3) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt index 351c7f0024dd0..23bfec44556cc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt @@ -8,47 +8,47 @@ +- Exchange (44) +- * HashAggregate (43) +- * Project (42) - +- * SortMergeJoin Inner (41) - :- * Sort (34) - : +- Exchange (33) - : +- * Project (32) - : +- * BroadcastHashJoin Inner BuildRight (31) - : :- * Project (19) - : : +- * SortMergeJoin Inner (18) - : : :- * Sort (12) - : : : +- Exchange (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Filter (7) - : : : +- * ColumnarToRow (6) - : : : +- Scan parquet default.item (5) - : : +- * Sort (17) - : : +- Exchange (16) - : : +- * Filter (15) - : : +- * ColumnarToRow (14) - : : +- Scan parquet default.customer (13) - : +- BroadcastExchange (30) - : +- * Project (29) - : +- * BroadcastHashJoin Inner BuildLeft (28) - : :- BroadcastExchange (24) - : : +- * Project (23) - : : +- * Filter (22) - : : +- * ColumnarToRow (21) - : : +- Scan parquet default.store (20) - : +- * Filter (27) - : +- * ColumnarToRow (26) - : +- Scan parquet default.customer_address (25) - +- * Sort (40) - +- Exchange (39) - +- * Project (38) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (29) + : +- * SortMergeJoin Inner (28) + : :- * Sort (21) + : : +- Exchange (20) + : : +- * Project (19) + : : +- * SortMergeJoin Inner (18) + : : :- * Sort (12) + : : : +- Exchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.item (5) + : : +- * Sort (17) + : : +- Exchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.customer (13) + : +- * Sort (27) + : +- Exchange (26) + : +- * Project (25) + : +- * Filter (24) + : +- * ColumnarToRow (23) + : +- Scan parquet default.store_returns (22) + +- BroadcastExchange (40) + +- * Project (39) + +- * BroadcastHashJoin Inner BuildLeft (38) + :- BroadcastExchange (34) + : +- * Project (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.store (30) +- * Filter (37) +- * ColumnarToRow (36) - +- Scan parquet default.store_returns (35) + +- Scan parquet default.customer_address (35) (1) Scan parquet default.store_sales @@ -126,159 +126,159 @@ Arguments: hashpartitioning(c_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#19] Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] Arguments: [c_customer_sk#15 ASC NULLS FIRST], false, 0 -(18) SortMergeJoin [codegen id : 8] +(18) SortMergeJoin [codegen id : 6] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#15] Join condition: None -(19) Project [codegen id : 8] +(19) Project [codegen id : 6] Output [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] -(20) Scan parquet default.store -Output [5]: [s_store_sk#20, s_store_name#21, s_market_id#22, s_state#23, s_zip#24] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store] -PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] -ReadSchema: struct +(20) Exchange +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#20] -(21) ColumnarToRow [codegen id : 6] -Input [5]: [s_store_sk#20, s_store_name#21, s_market_id#22, s_state#23, s_zip#24] +(21) Sort [codegen id : 7] +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 -(22) Filter [codegen id : 6] -Input [5]: [s_store_sk#20, s_store_name#21, s_market_id#22, s_state#23, s_zip#24] -Condition : (((isnotnull(s_market_id#22) AND (s_market_id#22 = 8)) AND isnotnull(s_store_sk#20)) AND isnotnull(s_zip#24)) +(22) Scan parquet default.store_returns +Output [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct -(23) Project [codegen id : 6] -Output [4]: [s_store_sk#20, s_store_name#21, s_state#23, s_zip#24] -Input [5]: [s_store_sk#20, s_store_name#21, s_market_id#22, s_state#23, s_zip#24] +(23) ColumnarToRow [codegen id : 8] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] -(24) BroadcastExchange -Input [4]: [s_store_sk#20, s_store_name#21, s_state#23, s_zip#24] -Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#25] +(24) Filter [codegen id : 8] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] +Condition : (isnotnull(sr_ticket_number#22) AND isnotnull(sr_item_sk#21)) -(25) Scan parquet default.customer_address -Output [3]: [ca_state#26, ca_zip#27, ca_country#28] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] -ReadSchema: struct +(25) Project [codegen id : 8] +Output [2]: [sr_item_sk#21, sr_ticket_number#22] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] -(26) ColumnarToRow -Input [3]: [ca_state#26, ca_zip#27, ca_country#28] +(26) Exchange +Input [2]: [sr_item_sk#21, sr_ticket_number#22] +Arguments: hashpartitioning(sr_ticket_number#22, sr_item_sk#21, 5), ENSURE_REQUIREMENTS, [id=#24] -(27) Filter -Input [3]: [ca_state#26, ca_zip#27, ca_country#28] -Condition : (isnotnull(ca_country#28) AND isnotnull(ca_zip#27)) +(27) Sort [codegen id : 9] +Input [2]: [sr_item_sk#21, sr_ticket_number#22] +Arguments: [sr_ticket_number#22 ASC NULLS FIRST, sr_item_sk#21 ASC NULLS FIRST], false, 0 -(28) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [s_zip#24] -Right keys [1]: [ca_zip#27] +(28) SortMergeJoin [codegen id : 12] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#22, sr_item_sk#21] Join condition: None -(29) Project [codegen id : 7] -Output [5]: [s_store_sk#20, s_store_name#21, s_state#23, ca_state#26, ca_country#28] -Input [7]: [s_store_sk#20, s_store_name#21, s_state#23, s_zip#24, ca_state#26, ca_zip#27, ca_country#28] +(29) Project [codegen id : 12] +Output [10]: [ss_store_sk#3, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Input [14]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, sr_item_sk#21, sr_ticket_number#22] -(30) BroadcastExchange -Input [5]: [s_store_sk#20, s_store_name#21, s_state#23, ca_state#26, ca_country#28] -Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#29] +(30) Scan parquet default.store +Output [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct -(31) BroadcastHashJoin [codegen id : 8] -Left keys [2]: [ss_store_sk#3, c_birth_country#18] -Right keys [2]: [s_store_sk#20, upper(ca_country#28)] -Join condition: None +(31) ColumnarToRow [codegen id : 10] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] -(32) Project [codegen id : 8] -Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, s_store_name#21, s_state#23, ca_state#26] -Input [17]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, s_store_sk#20, s_store_name#21, s_state#23, ca_state#26, ca_country#28] +(32) Filter [codegen id : 10] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] +Condition : (((isnotnull(s_market_id#27) AND (s_market_id#27 = 8)) AND isnotnull(s_store_sk#25)) AND isnotnull(s_zip#29)) -(33) Exchange -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, s_store_name#21, s_state#23, ca_state#26] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#30] +(33) Project [codegen id : 10] +Output [4]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] -(34) Sort [codegen id : 9] -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, s_store_name#21, s_state#23, ca_state#26] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +(34) BroadcastExchange +Input [4]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29] +Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#30] -(35) Scan parquet default.store_returns -Output [3]: [sr_item_sk#31, sr_ticket_number#32, sr_returned_date_sk#33] +(35) Scan parquet default.customer_address +Output [3]: [ca_state#31, ca_zip#32, ca_country#33] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct -(36) ColumnarToRow [codegen id : 10] -Input [3]: [sr_item_sk#31, sr_ticket_number#32, sr_returned_date_sk#33] +(36) ColumnarToRow +Input [3]: [ca_state#31, ca_zip#32, ca_country#33] -(37) Filter [codegen id : 10] -Input [3]: [sr_item_sk#31, sr_ticket_number#32, sr_returned_date_sk#33] -Condition : (isnotnull(sr_ticket_number#32) AND isnotnull(sr_item_sk#31)) +(37) Filter +Input [3]: [ca_state#31, ca_zip#32, ca_country#33] +Condition : (isnotnull(ca_country#33) AND isnotnull(ca_zip#32)) -(38) Project [codegen id : 10] -Output [2]: [sr_item_sk#31, sr_ticket_number#32] -Input [3]: [sr_item_sk#31, sr_ticket_number#32, sr_returned_date_sk#33] +(38) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [s_zip#29] +Right keys [1]: [ca_zip#32] +Join condition: None -(39) Exchange -Input [2]: [sr_item_sk#31, sr_ticket_number#32] -Arguments: hashpartitioning(sr_ticket_number#32, sr_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#34] +(39) Project [codegen id : 11] +Output [5]: [s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] +Input [7]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29, ca_state#31, ca_zip#32, ca_country#33] -(40) Sort [codegen id : 11] -Input [2]: [sr_item_sk#31, sr_ticket_number#32] -Arguments: [sr_ticket_number#32 ASC NULLS FIRST, sr_item_sk#31 ASC NULLS FIRST], false, 0 +(40) BroadcastExchange +Input [5]: [s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#34] -(41) SortMergeJoin [codegen id : 12] -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] -Right keys [2]: [sr_ticket_number#32, sr_item_sk#31] +(41) BroadcastHashJoin [codegen id : 12] +Left keys [2]: [ss_store_sk#3, c_birth_country#18] +Right keys [2]: [s_store_sk#25, upper(ca_country#33)] Join condition: None (42) Project [codegen id : 12] -Output [11]: [ss_net_paid#5, s_store_name#21, s_state#23, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#26] -Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, s_store_name#21, s_state#23, ca_state#26, sr_item_sk#31, sr_ticket_number#32] +Output [11]: [ss_net_paid#5, s_store_name#26, s_state#28, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#31] +Input [15]: [ss_store_sk#3, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] (43) HashAggregate [codegen id : 12] -Input [11]: [ss_net_paid#5, s_store_name#21, s_state#23, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#26] -Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] +Input [11]: [ss_net_paid#5, s_store_name#26, s_state#28, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#31] +Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] Aggregate Attributes [1]: [sum#35] -Results [11]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Results [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] (44) Exchange -Input [11]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] -Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, 5), ENSURE_REQUIREMENTS, [id=#37] +Input [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, 5), ENSURE_REQUIREMENTS, [id=#37] (45) HashAggregate [codegen id : 13] -Input [11]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] -Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] +Input [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#38] -Results [4]: [c_last_name#17, c_first_name#16, s_store_name#21, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#38,17,2) AS netpaid#39] +Results [4]: [c_last_name#17, c_first_name#16, s_store_name#26, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#38,17,2) AS netpaid#39] (46) HashAggregate [codegen id : 13] -Input [4]: [c_last_name#17, c_first_name#16, s_store_name#21, netpaid#39] -Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#21] +Input [4]: [c_last_name#17, c_first_name#16, s_store_name#26, netpaid#39] +Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#26] Functions [1]: [partial_sum(netpaid#39)] Aggregate Attributes [2]: [sum#40, isEmpty#41] -Results [5]: [c_last_name#17, c_first_name#16, s_store_name#21, sum#42, isEmpty#43] +Results [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] (47) Exchange -Input [5]: [c_last_name#17, c_first_name#16, s_store_name#21, sum#42, isEmpty#43] -Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#21, 5), ENSURE_REQUIREMENTS, [id=#44] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] +Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#26, 5), ENSURE_REQUIREMENTS, [id=#44] (48) HashAggregate [codegen id : 14] -Input [5]: [c_last_name#17, c_first_name#16, s_store_name#21, sum#42, isEmpty#43] -Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#21] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] +Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#26] Functions [1]: [sum(netpaid#39)] Aggregate Attributes [1]: [sum(netpaid#39)#45] -Results [5]: [c_last_name#17, c_first_name#16, s_store_name#21, sum(netpaid#39)#45 AS paid#46, sum(netpaid#39)#45 AS sum(netpaid#39)#47] +Results [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum(netpaid#39)#45 AS paid#46, sum(netpaid#39)#45 AS sum(netpaid#39)#47] (49) Filter [codegen id : 14] -Input [5]: [c_last_name#17, c_first_name#16, s_store_name#21, paid#46, sum(netpaid#39)#47] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46, sum(netpaid#39)#47] Condition : (isnotnull(sum(netpaid#39)#47) AND (cast(sum(netpaid#39)#47 as decimal(33,8)) > cast(Subquery scalar-subquery#48, [id=#49] as decimal(33,8)))) (50) Project [codegen id : 14] -Output [4]: [c_last_name#17, c_first_name#16, s_store_name#21, paid#46] -Input [5]: [c_last_name#17, c_first_name#16, s_store_name#21, paid#46, sum(netpaid#39)#47] +Output [4]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46, sum(netpaid#39)#47] ===== Subqueries ===== @@ -291,10 +291,10 @@ Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquer +- * HashAggregate (99) +- * Project (98) +- * SortMergeJoin Inner (97) - :- * Sort (90) - : +- Exchange (89) - : +- * Project (88) - : +- * SortMergeJoin Inner (87) + :- * Sort (91) + : +- Exchange (90) + : +- * Project (89) + : +- * SortMergeJoin Inner (88) : :- * Sort (81) : : +- Exchange (80) : : +- * Project (79) @@ -326,17 +326,17 @@ Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquer : : +- * Filter (75) : : +- * ColumnarToRow (74) : : +- Scan parquet default.customer (73) - : +- * Sort (86) - : +- Exchange (85) - : +- * Filter (84) - : +- * ColumnarToRow (83) - : +- Scan parquet default.customer_address (82) + : +- * Sort (87) + : +- Exchange (86) + : +- * Project (85) + : +- * Filter (84) + : +- * ColumnarToRow (83) + : +- Scan parquet default.store_returns (82) +- * Sort (96) +- Exchange (95) - +- * Project (94) - +- * Filter (93) - +- * ColumnarToRow (92) - +- Scan parquet default.store_returns (91) + +- * Filter (94) + +- * ColumnarToRow (93) + +- Scan parquet default.customer_address (92) (51) Scan parquet default.store_sales @@ -468,100 +468,100 @@ Input [16]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid# (80) Exchange Input [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] -Arguments: hashpartitioning(c_birth_country#74, s_zip#60, 5), ENSURE_REQUIREMENTS, [id=#76] +Arguments: hashpartitioning(ss_ticket_number#53, ss_item_sk#50, 5), ENSURE_REQUIREMENTS, [id=#76] (81) Sort [codegen id : 11] Input [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] -Arguments: [c_birth_country#74 ASC NULLS FIRST, s_zip#60 ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#53 ASC NULLS FIRST, ss_item_sk#50 ASC NULLS FIRST], false, 0 -(82) Scan parquet default.customer_address -Output [3]: [ca_state#77, ca_zip#78, ca_country#79] +(82) Scan parquet default.store_returns +Output [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct (83) ColumnarToRow [codegen id : 12] -Input [3]: [ca_state#77, ca_zip#78, ca_country#79] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] (84) Filter [codegen id : 12] -Input [3]: [ca_state#77, ca_zip#78, ca_country#79] -Condition : (isnotnull(ca_country#79) AND isnotnull(ca_zip#78)) +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] +Condition : (isnotnull(sr_ticket_number#78) AND isnotnull(sr_item_sk#77)) -(85) Exchange -Input [3]: [ca_state#77, ca_zip#78, ca_country#79] -Arguments: hashpartitioning(upper(ca_country#79), ca_zip#78, 5), ENSURE_REQUIREMENTS, [id=#80] +(85) Project [codegen id : 12] +Output [2]: [sr_item_sk#77, sr_ticket_number#78] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] -(86) Sort [codegen id : 13] -Input [3]: [ca_state#77, ca_zip#78, ca_country#79] -Arguments: [upper(ca_country#79) ASC NULLS FIRST, ca_zip#78 ASC NULLS FIRST], false, 0 +(86) Exchange +Input [2]: [sr_item_sk#77, sr_ticket_number#78] +Arguments: hashpartitioning(sr_ticket_number#78, sr_item_sk#77, 5), ENSURE_REQUIREMENTS, [id=#80] -(87) SortMergeJoin [codegen id : 14] -Left keys [2]: [c_birth_country#74, s_zip#60] -Right keys [2]: [upper(ca_country#79), ca_zip#78] +(87) Sort [codegen id : 13] +Input [2]: [sr_item_sk#77, sr_ticket_number#78] +Arguments: [sr_ticket_number#78 ASC NULLS FIRST, sr_item_sk#77 ASC NULLS FIRST], false, 0 + +(88) SortMergeJoin [codegen id : 14] +Left keys [2]: [ss_ticket_number#53, ss_item_sk#50] +Right keys [2]: [sr_ticket_number#78, sr_item_sk#77] Join condition: None -(88) Project [codegen id : 14] -Output [13]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Input [17]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, ca_state#77, ca_zip#78, ca_country#79] +(89) Project [codegen id : 14] +Output [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Input [16]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, sr_item_sk#77, sr_ticket_number#78] -(89) Exchange -Input [13]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Arguments: hashpartitioning(cast(ss_ticket_number#53 as bigint), cast(ss_item_sk#50 as bigint), 5), ENSURE_REQUIREMENTS, [id=#81] +(90) Exchange +Input [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: hashpartitioning(c_birth_country#74, s_zip#60, 5), ENSURE_REQUIREMENTS, [id=#81] -(90) Sort [codegen id : 15] -Input [13]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Arguments: [cast(ss_ticket_number#53 as bigint) ASC NULLS FIRST, cast(ss_item_sk#50 as bigint) ASC NULLS FIRST], false, 0 +(91) Sort [codegen id : 15] +Input [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: [c_birth_country#74 ASC NULLS FIRST, s_zip#60 ASC NULLS FIRST], false, 0 -(91) Scan parquet default.store_returns -Output [3]: [sr_item_sk#82, sr_ticket_number#83, sr_returned_date_sk#84] +(92) Scan parquet default.customer_address +Output [3]: [ca_state#82, ca_zip#83, ca_country#84] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct - -(92) ColumnarToRow [codegen id : 16] -Input [3]: [sr_item_sk#82, sr_ticket_number#83, sr_returned_date_sk#84] +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct -(93) Filter [codegen id : 16] -Input [3]: [sr_item_sk#82, sr_ticket_number#83, sr_returned_date_sk#84] -Condition : (isnotnull(sr_ticket_number#83) AND isnotnull(sr_item_sk#82)) +(93) ColumnarToRow [codegen id : 16] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] -(94) Project [codegen id : 16] -Output [2]: [sr_item_sk#82, sr_ticket_number#83] -Input [3]: [sr_item_sk#82, sr_ticket_number#83, sr_returned_date_sk#84] +(94) Filter [codegen id : 16] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Condition : (isnotnull(ca_country#84) AND isnotnull(ca_zip#83)) (95) Exchange -Input [2]: [sr_item_sk#82, sr_ticket_number#83] -Arguments: hashpartitioning(sr_ticket_number#83, sr_item_sk#82, 5), ENSURE_REQUIREMENTS, [id=#85] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Arguments: hashpartitioning(upper(ca_country#84), ca_zip#83, 5), ENSURE_REQUIREMENTS, [id=#85] (96) Sort [codegen id : 17] -Input [2]: [sr_item_sk#82, sr_ticket_number#83] -Arguments: [sr_ticket_number#83 ASC NULLS FIRST, sr_item_sk#82 ASC NULLS FIRST], false, 0 +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Arguments: [upper(ca_country#84) ASC NULLS FIRST, ca_zip#83 ASC NULLS FIRST], false, 0 (97) SortMergeJoin [codegen id : 18] -Left keys [2]: [cast(ss_ticket_number#53 as bigint), cast(ss_item_sk#50 as bigint)] -Right keys [2]: [sr_ticket_number#83, sr_item_sk#82] +Left keys [2]: [c_birth_country#74, s_zip#60] +Right keys [2]: [upper(ca_country#84), ca_zip#83] Join condition: None (98) Project [codegen id : 18] -Output [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Input [15]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77, sr_item_sk#82, sr_ticket_number#83] +Output [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#82] +Input [15]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, ca_state#82, ca_zip#83, ca_country#84] (99) HashAggregate [codegen id : 18] -Input [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] +Input [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#82] +Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#54))] Aggregate Attributes [1]: [sum#86] -Results [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Results [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] (100) Exchange -Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] -Arguments: hashpartitioning(c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, 5), ENSURE_REQUIREMENTS, [id=#88] +Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Arguments: hashpartitioning(c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, 5), ENSURE_REQUIREMENTS, [id=#88] (101) HashAggregate [codegen id : 19] -Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] -Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] +Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] Functions [1]: [sum(UnscaledValue(ss_net_paid#54))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#54))#89] Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#54))#89,17,2) AS netpaid#39] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt index 7c896c0838a85..46fa83fcfed4b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt @@ -14,20 +14,20 @@ WholeStageCodegen (14) WholeStageCodegen (18) HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] - SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] InputAdapter WholeStageCodegen (15) - Sort [ss_ticket_number,ss_item_sk] + Sort [c_birth_country,s_zip] InputAdapter - Exchange [ss_ticket_number,ss_item_sk] #12 + Exchange [c_birth_country,s_zip] #12 WholeStageCodegen (14) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] - SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] InputAdapter WholeStageCodegen (11) - Sort [c_birth_country,s_zip] + Sort [ss_ticket_number,ss_item_sk] InputAdapter - Exchange [c_birth_country,s_zip] #13 + Exchange [ss_ticket_number,ss_item_sk] #13 WholeStageCodegen (10) Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] @@ -82,25 +82,25 @@ WholeStageCodegen (14) Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] InputAdapter WholeStageCodegen (13) - Sort [ca_country,ca_zip] + Sort [sr_ticket_number,sr_item_sk] InputAdapter - Exchange [ca_country,ca_zip] #19 + Exchange [sr_ticket_number,sr_item_sk] #19 WholeStageCodegen (12) - Filter [ca_country,ca_zip] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_state,ca_zip,ca_country] + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] InputAdapter WholeStageCodegen (17) - Sort [sr_ticket_number,sr_item_sk] + Sort [ca_country,ca_zip] InputAdapter - Exchange [sr_ticket_number,sr_item_sk] #20 + Exchange [ca_country,ca_zip] #20 WholeStageCodegen (16) - Project [sr_item_sk,sr_ticket_number] - Filter [sr_ticket_number,sr_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum(netpaid),sum,isEmpty] InputAdapter Exchange [c_last_name,c_first_name,s_store_name] #1 @@ -112,15 +112,15 @@ WholeStageCodegen (14) WholeStageCodegen (12) HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] - SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] - InputAdapter - WholeStageCodegen (9) - Sort [ss_ticket_number,ss_item_sk] - InputAdapter - Exchange [ss_ticket_number,ss_item_sk] #3 - WholeStageCodegen (8) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,s_store_name,s_state,ca_state] - BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] + BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] + Project [ss_store_sk,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #3 + WholeStageCodegen (6) Project [ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter @@ -153,31 +153,31 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] - InputAdapter - BroadcastExchange #7 - WholeStageCodegen (7) - Project [s_store_sk,s_store_name,s_state,ca_state,ca_country] - BroadcastHashJoin [s_zip,ca_zip] - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (6) - Project [s_store_sk,s_store_name,s_state,s_zip] - Filter [s_market_id,s_store_sk,s_zip] - ColumnarToRow - InputAdapter - Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] - Filter [ca_country,ca_zip] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_state,ca_zip,ca_country] + InputAdapter + WholeStageCodegen (9) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #7 + WholeStageCodegen (8) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] InputAdapter - WholeStageCodegen (11) - Sort [sr_ticket_number,sr_item_sk] - InputAdapter - Exchange [sr_ticket_number,sr_item_sk] #9 - WholeStageCodegen (10) - Project [sr_item_sk,sr_ticket_number] - Filter [sr_ticket_number,sr_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + BroadcastExchange #8 + WholeStageCodegen (11) + Project [s_store_sk,s_store_name,s_state,ca_state,ca_country] + BroadcastHashJoin [s_zip,ca_zip] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (10) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt index 0565ae76a440d..527913016c998 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt @@ -68,18 +68,18 @@ Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, s (5) Exchange Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#7] (6) Sort [codegen id : 2] Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 (7) Scan parquet default.store_returns Output [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (8) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] @@ -101,7 +101,7 @@ Input [2]: [sr_item_sk#8, sr_ticket_number#9] Arguments: [sr_ticket_number#9 ASC NULLS FIRST, sr_item_sk#8 ASC NULLS FIRST], false, 0 (13) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] Right keys [2]: [sr_ticket_number#9, sr_item_sk#8] Join condition: None @@ -335,18 +335,18 @@ Input [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#5 (52) Exchange Input [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] -Arguments: hashpartitioning(cast(ss_ticket_number#52 as bigint), cast(ss_item_sk#49 as bigint), 5), ENSURE_REQUIREMENTS, [id=#55] +Arguments: hashpartitioning(ss_ticket_number#52, ss_item_sk#49, 5), ENSURE_REQUIREMENTS, [id=#55] (53) Sort [codegen id : 2] Input [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] -Arguments: [cast(ss_ticket_number#52 as bigint) ASC NULLS FIRST, cast(ss_item_sk#49 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#52 ASC NULLS FIRST, ss_item_sk#49 ASC NULLS FIRST], false, 0 (54) Scan parquet default.store_returns Output [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (55) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] @@ -368,7 +368,7 @@ Input [2]: [sr_item_sk#56, sr_ticket_number#57] Arguments: [sr_ticket_number#57 ASC NULLS FIRST, sr_item_sk#56 ASC NULLS FIRST], false, 0 (60) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ss_ticket_number#52 as bigint), cast(ss_item_sk#49 as bigint)] +Left keys [2]: [ss_ticket_number#52, ss_item_sk#49] Right keys [2]: [sr_ticket_number#57, sr_item_sk#56] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt index 97ee167a14b5a..1663ffd6dc09e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt @@ -8,47 +8,47 @@ +- Exchange (44) +- * HashAggregate (43) +- * Project (42) - +- * SortMergeJoin Inner (41) - :- * Sort (34) - : +- Exchange (33) - : +- * Project (32) - : +- * BroadcastHashJoin Inner BuildRight (31) - : :- * Project (19) - : : +- * SortMergeJoin Inner (18) - : : :- * Sort (12) - : : : +- Exchange (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Filter (7) - : : : +- * ColumnarToRow (6) - : : : +- Scan parquet default.item (5) - : : +- * Sort (17) - : : +- Exchange (16) - : : +- * Filter (15) - : : +- * ColumnarToRow (14) - : : +- Scan parquet default.customer (13) - : +- BroadcastExchange (30) - : +- * Project (29) - : +- * BroadcastHashJoin Inner BuildLeft (28) - : :- BroadcastExchange (24) - : : +- * Project (23) - : : +- * Filter (22) - : : +- * ColumnarToRow (21) - : : +- Scan parquet default.store (20) - : +- * Filter (27) - : +- * ColumnarToRow (26) - : +- Scan parquet default.customer_address (25) - +- * Sort (40) - +- Exchange (39) - +- * Project (38) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (29) + : +- * SortMergeJoin Inner (28) + : :- * Sort (21) + : : +- Exchange (20) + : : +- * Project (19) + : : +- * SortMergeJoin Inner (18) + : : :- * Sort (12) + : : : +- Exchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.item (5) + : : +- * Sort (17) + : : +- Exchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.customer (13) + : +- * Sort (27) + : +- Exchange (26) + : +- * Project (25) + : +- * Filter (24) + : +- * ColumnarToRow (23) + : +- Scan parquet default.store_returns (22) + +- BroadcastExchange (40) + +- * Project (39) + +- * BroadcastHashJoin Inner BuildLeft (38) + :- BroadcastExchange (34) + : +- * Project (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.store (30) +- * Filter (37) +- * ColumnarToRow (36) - +- Scan parquet default.store_returns (35) + +- Scan parquet default.customer_address (35) (1) Scan parquet default.store_sales @@ -126,159 +126,159 @@ Arguments: hashpartitioning(c_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#19] Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] Arguments: [c_customer_sk#15 ASC NULLS FIRST], false, 0 -(18) SortMergeJoin [codegen id : 8] +(18) SortMergeJoin [codegen id : 6] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#15] Join condition: None -(19) Project [codegen id : 8] +(19) Project [codegen id : 6] Output [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] -(20) Scan parquet default.store -Output [5]: [s_store_sk#20, s_store_name#21, s_market_id#22, s_state#23, s_zip#24] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store] -PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] -ReadSchema: struct +(20) Exchange +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#20] -(21) ColumnarToRow [codegen id : 6] -Input [5]: [s_store_sk#20, s_store_name#21, s_market_id#22, s_state#23, s_zip#24] +(21) Sort [codegen id : 7] +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 -(22) Filter [codegen id : 6] -Input [5]: [s_store_sk#20, s_store_name#21, s_market_id#22, s_state#23, s_zip#24] -Condition : (((isnotnull(s_market_id#22) AND (s_market_id#22 = 8)) AND isnotnull(s_store_sk#20)) AND isnotnull(s_zip#24)) +(22) Scan parquet default.store_returns +Output [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct -(23) Project [codegen id : 6] -Output [4]: [s_store_sk#20, s_store_name#21, s_state#23, s_zip#24] -Input [5]: [s_store_sk#20, s_store_name#21, s_market_id#22, s_state#23, s_zip#24] +(23) ColumnarToRow [codegen id : 8] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] -(24) BroadcastExchange -Input [4]: [s_store_sk#20, s_store_name#21, s_state#23, s_zip#24] -Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#25] +(24) Filter [codegen id : 8] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] +Condition : (isnotnull(sr_ticket_number#22) AND isnotnull(sr_item_sk#21)) -(25) Scan parquet default.customer_address -Output [3]: [ca_state#26, ca_zip#27, ca_country#28] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] -ReadSchema: struct +(25) Project [codegen id : 8] +Output [2]: [sr_item_sk#21, sr_ticket_number#22] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] -(26) ColumnarToRow -Input [3]: [ca_state#26, ca_zip#27, ca_country#28] +(26) Exchange +Input [2]: [sr_item_sk#21, sr_ticket_number#22] +Arguments: hashpartitioning(sr_ticket_number#22, sr_item_sk#21, 5), ENSURE_REQUIREMENTS, [id=#24] -(27) Filter -Input [3]: [ca_state#26, ca_zip#27, ca_country#28] -Condition : (isnotnull(ca_country#28) AND isnotnull(ca_zip#27)) +(27) Sort [codegen id : 9] +Input [2]: [sr_item_sk#21, sr_ticket_number#22] +Arguments: [sr_ticket_number#22 ASC NULLS FIRST, sr_item_sk#21 ASC NULLS FIRST], false, 0 -(28) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [s_zip#24] -Right keys [1]: [ca_zip#27] +(28) SortMergeJoin [codegen id : 12] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#22, sr_item_sk#21] Join condition: None -(29) Project [codegen id : 7] -Output [5]: [s_store_sk#20, s_store_name#21, s_state#23, ca_state#26, ca_country#28] -Input [7]: [s_store_sk#20, s_store_name#21, s_state#23, s_zip#24, ca_state#26, ca_zip#27, ca_country#28] +(29) Project [codegen id : 12] +Output [10]: [ss_store_sk#3, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Input [14]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, sr_item_sk#21, sr_ticket_number#22] -(30) BroadcastExchange -Input [5]: [s_store_sk#20, s_store_name#21, s_state#23, ca_state#26, ca_country#28] -Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#29] +(30) Scan parquet default.store +Output [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct -(31) BroadcastHashJoin [codegen id : 8] -Left keys [2]: [ss_store_sk#3, c_birth_country#18] -Right keys [2]: [s_store_sk#20, upper(ca_country#28)] -Join condition: None +(31) ColumnarToRow [codegen id : 10] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] -(32) Project [codegen id : 8] -Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, s_store_name#21, s_state#23, ca_state#26] -Input [17]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, s_store_sk#20, s_store_name#21, s_state#23, ca_state#26, ca_country#28] +(32) Filter [codegen id : 10] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] +Condition : (((isnotnull(s_market_id#27) AND (s_market_id#27 = 8)) AND isnotnull(s_store_sk#25)) AND isnotnull(s_zip#29)) -(33) Exchange -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, s_store_name#21, s_state#23, ca_state#26] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#30] +(33) Project [codegen id : 10] +Output [4]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] -(34) Sort [codegen id : 9] -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, s_store_name#21, s_state#23, ca_state#26] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +(34) BroadcastExchange +Input [4]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29] +Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#30] -(35) Scan parquet default.store_returns -Output [3]: [sr_item_sk#31, sr_ticket_number#32, sr_returned_date_sk#33] +(35) Scan parquet default.customer_address +Output [3]: [ca_state#31, ca_zip#32, ca_country#33] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct -(36) ColumnarToRow [codegen id : 10] -Input [3]: [sr_item_sk#31, sr_ticket_number#32, sr_returned_date_sk#33] +(36) ColumnarToRow +Input [3]: [ca_state#31, ca_zip#32, ca_country#33] -(37) Filter [codegen id : 10] -Input [3]: [sr_item_sk#31, sr_ticket_number#32, sr_returned_date_sk#33] -Condition : (isnotnull(sr_ticket_number#32) AND isnotnull(sr_item_sk#31)) +(37) Filter +Input [3]: [ca_state#31, ca_zip#32, ca_country#33] +Condition : (isnotnull(ca_country#33) AND isnotnull(ca_zip#32)) -(38) Project [codegen id : 10] -Output [2]: [sr_item_sk#31, sr_ticket_number#32] -Input [3]: [sr_item_sk#31, sr_ticket_number#32, sr_returned_date_sk#33] +(38) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [s_zip#29] +Right keys [1]: [ca_zip#32] +Join condition: None -(39) Exchange -Input [2]: [sr_item_sk#31, sr_ticket_number#32] -Arguments: hashpartitioning(sr_ticket_number#32, sr_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#34] +(39) Project [codegen id : 11] +Output [5]: [s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] +Input [7]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29, ca_state#31, ca_zip#32, ca_country#33] -(40) Sort [codegen id : 11] -Input [2]: [sr_item_sk#31, sr_ticket_number#32] -Arguments: [sr_ticket_number#32 ASC NULLS FIRST, sr_item_sk#31 ASC NULLS FIRST], false, 0 +(40) BroadcastExchange +Input [5]: [s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#34] -(41) SortMergeJoin [codegen id : 12] -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] -Right keys [2]: [sr_ticket_number#32, sr_item_sk#31] +(41) BroadcastHashJoin [codegen id : 12] +Left keys [2]: [ss_store_sk#3, c_birth_country#18] +Right keys [2]: [s_store_sk#25, upper(ca_country#33)] Join condition: None (42) Project [codegen id : 12] -Output [11]: [ss_net_paid#5, s_store_name#21, s_state#23, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#26] -Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, s_store_name#21, s_state#23, ca_state#26, sr_item_sk#31, sr_ticket_number#32] +Output [11]: [ss_net_paid#5, s_store_name#26, s_state#28, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#31] +Input [15]: [ss_store_sk#3, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] (43) HashAggregate [codegen id : 12] -Input [11]: [ss_net_paid#5, s_store_name#21, s_state#23, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#26] -Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] +Input [11]: [ss_net_paid#5, s_store_name#26, s_state#28, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#31] +Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] Aggregate Attributes [1]: [sum#35] -Results [11]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Results [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] (44) Exchange -Input [11]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] -Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, 5), ENSURE_REQUIREMENTS, [id=#37] +Input [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, 5), ENSURE_REQUIREMENTS, [id=#37] (45) HashAggregate [codegen id : 13] -Input [11]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] -Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#21, ca_state#26, s_state#23, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] +Input [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#38] -Results [4]: [c_last_name#17, c_first_name#16, s_store_name#21, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#38,17,2) AS netpaid#39] +Results [4]: [c_last_name#17, c_first_name#16, s_store_name#26, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#38,17,2) AS netpaid#39] (46) HashAggregate [codegen id : 13] -Input [4]: [c_last_name#17, c_first_name#16, s_store_name#21, netpaid#39] -Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#21] +Input [4]: [c_last_name#17, c_first_name#16, s_store_name#26, netpaid#39] +Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#26] Functions [1]: [partial_sum(netpaid#39)] Aggregate Attributes [2]: [sum#40, isEmpty#41] -Results [5]: [c_last_name#17, c_first_name#16, s_store_name#21, sum#42, isEmpty#43] +Results [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] (47) Exchange -Input [5]: [c_last_name#17, c_first_name#16, s_store_name#21, sum#42, isEmpty#43] -Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#21, 5), ENSURE_REQUIREMENTS, [id=#44] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] +Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#26, 5), ENSURE_REQUIREMENTS, [id=#44] (48) HashAggregate [codegen id : 14] -Input [5]: [c_last_name#17, c_first_name#16, s_store_name#21, sum#42, isEmpty#43] -Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#21] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] +Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#26] Functions [1]: [sum(netpaid#39)] Aggregate Attributes [1]: [sum(netpaid#39)#45] -Results [5]: [c_last_name#17, c_first_name#16, s_store_name#21, sum(netpaid#39)#45 AS paid#46, sum(netpaid#39)#45 AS sum(netpaid#39)#47] +Results [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum(netpaid#39)#45 AS paid#46, sum(netpaid#39)#45 AS sum(netpaid#39)#47] (49) Filter [codegen id : 14] -Input [5]: [c_last_name#17, c_first_name#16, s_store_name#21, paid#46, sum(netpaid#39)#47] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46, sum(netpaid#39)#47] Condition : (isnotnull(sum(netpaid#39)#47) AND (cast(sum(netpaid#39)#47 as decimal(33,8)) > cast(Subquery scalar-subquery#48, [id=#49] as decimal(33,8)))) (50) Project [codegen id : 14] -Output [4]: [c_last_name#17, c_first_name#16, s_store_name#21, paid#46] -Input [5]: [c_last_name#17, c_first_name#16, s_store_name#21, paid#46, sum(netpaid#39)#47] +Output [4]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46, sum(netpaid#39)#47] ===== Subqueries ===== @@ -291,10 +291,10 @@ Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquer +- * HashAggregate (99) +- * Project (98) +- * SortMergeJoin Inner (97) - :- * Sort (90) - : +- Exchange (89) - : +- * Project (88) - : +- * SortMergeJoin Inner (87) + :- * Sort (91) + : +- Exchange (90) + : +- * Project (89) + : +- * SortMergeJoin Inner (88) : :- * Sort (81) : : +- Exchange (80) : : +- * Project (79) @@ -326,17 +326,17 @@ Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquer : : +- * Filter (75) : : +- * ColumnarToRow (74) : : +- Scan parquet default.customer (73) - : +- * Sort (86) - : +- Exchange (85) - : +- * Filter (84) - : +- * ColumnarToRow (83) - : +- Scan parquet default.customer_address (82) + : +- * Sort (87) + : +- Exchange (86) + : +- * Project (85) + : +- * Filter (84) + : +- * ColumnarToRow (83) + : +- Scan parquet default.store_returns (82) +- * Sort (96) +- Exchange (95) - +- * Project (94) - +- * Filter (93) - +- * ColumnarToRow (92) - +- Scan parquet default.store_returns (91) + +- * Filter (94) + +- * ColumnarToRow (93) + +- Scan parquet default.customer_address (92) (51) Scan parquet default.store_sales @@ -468,100 +468,100 @@ Input [16]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid# (80) Exchange Input [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] -Arguments: hashpartitioning(c_birth_country#74, s_zip#60, 5), ENSURE_REQUIREMENTS, [id=#76] +Arguments: hashpartitioning(ss_ticket_number#53, ss_item_sk#50, 5), ENSURE_REQUIREMENTS, [id=#76] (81) Sort [codegen id : 11] Input [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] -Arguments: [c_birth_country#74 ASC NULLS FIRST, s_zip#60 ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#53 ASC NULLS FIRST, ss_item_sk#50 ASC NULLS FIRST], false, 0 -(82) Scan parquet default.customer_address -Output [3]: [ca_state#77, ca_zip#78, ca_country#79] +(82) Scan parquet default.store_returns +Output [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct (83) ColumnarToRow [codegen id : 12] -Input [3]: [ca_state#77, ca_zip#78, ca_country#79] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] (84) Filter [codegen id : 12] -Input [3]: [ca_state#77, ca_zip#78, ca_country#79] -Condition : (isnotnull(ca_country#79) AND isnotnull(ca_zip#78)) +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] +Condition : (isnotnull(sr_ticket_number#78) AND isnotnull(sr_item_sk#77)) -(85) Exchange -Input [3]: [ca_state#77, ca_zip#78, ca_country#79] -Arguments: hashpartitioning(upper(ca_country#79), ca_zip#78, 5), ENSURE_REQUIREMENTS, [id=#80] +(85) Project [codegen id : 12] +Output [2]: [sr_item_sk#77, sr_ticket_number#78] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] -(86) Sort [codegen id : 13] -Input [3]: [ca_state#77, ca_zip#78, ca_country#79] -Arguments: [upper(ca_country#79) ASC NULLS FIRST, ca_zip#78 ASC NULLS FIRST], false, 0 +(86) Exchange +Input [2]: [sr_item_sk#77, sr_ticket_number#78] +Arguments: hashpartitioning(sr_ticket_number#78, sr_item_sk#77, 5), ENSURE_REQUIREMENTS, [id=#80] -(87) SortMergeJoin [codegen id : 14] -Left keys [2]: [c_birth_country#74, s_zip#60] -Right keys [2]: [upper(ca_country#79), ca_zip#78] +(87) Sort [codegen id : 13] +Input [2]: [sr_item_sk#77, sr_ticket_number#78] +Arguments: [sr_ticket_number#78 ASC NULLS FIRST, sr_item_sk#77 ASC NULLS FIRST], false, 0 + +(88) SortMergeJoin [codegen id : 14] +Left keys [2]: [ss_ticket_number#53, ss_item_sk#50] +Right keys [2]: [sr_ticket_number#78, sr_item_sk#77] Join condition: None -(88) Project [codegen id : 14] -Output [13]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Input [17]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, ca_state#77, ca_zip#78, ca_country#79] +(89) Project [codegen id : 14] +Output [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Input [16]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, sr_item_sk#77, sr_ticket_number#78] -(89) Exchange -Input [13]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Arguments: hashpartitioning(cast(ss_ticket_number#53 as bigint), cast(ss_item_sk#50 as bigint), 5), ENSURE_REQUIREMENTS, [id=#81] +(90) Exchange +Input [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: hashpartitioning(c_birth_country#74, s_zip#60, 5), ENSURE_REQUIREMENTS, [id=#81] -(90) Sort [codegen id : 15] -Input [13]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Arguments: [cast(ss_ticket_number#53 as bigint) ASC NULLS FIRST, cast(ss_item_sk#50 as bigint) ASC NULLS FIRST], false, 0 +(91) Sort [codegen id : 15] +Input [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: [c_birth_country#74 ASC NULLS FIRST, s_zip#60 ASC NULLS FIRST], false, 0 -(91) Scan parquet default.store_returns -Output [3]: [sr_item_sk#82, sr_ticket_number#83, sr_returned_date_sk#84] +(92) Scan parquet default.customer_address +Output [3]: [ca_state#82, ca_zip#83, ca_country#84] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct - -(92) ColumnarToRow [codegen id : 16] -Input [3]: [sr_item_sk#82, sr_ticket_number#83, sr_returned_date_sk#84] +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct -(93) Filter [codegen id : 16] -Input [3]: [sr_item_sk#82, sr_ticket_number#83, sr_returned_date_sk#84] -Condition : (isnotnull(sr_ticket_number#83) AND isnotnull(sr_item_sk#82)) +(93) ColumnarToRow [codegen id : 16] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] -(94) Project [codegen id : 16] -Output [2]: [sr_item_sk#82, sr_ticket_number#83] -Input [3]: [sr_item_sk#82, sr_ticket_number#83, sr_returned_date_sk#84] +(94) Filter [codegen id : 16] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Condition : (isnotnull(ca_country#84) AND isnotnull(ca_zip#83)) (95) Exchange -Input [2]: [sr_item_sk#82, sr_ticket_number#83] -Arguments: hashpartitioning(sr_ticket_number#83, sr_item_sk#82, 5), ENSURE_REQUIREMENTS, [id=#85] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Arguments: hashpartitioning(upper(ca_country#84), ca_zip#83, 5), ENSURE_REQUIREMENTS, [id=#85] (96) Sort [codegen id : 17] -Input [2]: [sr_item_sk#82, sr_ticket_number#83] -Arguments: [sr_ticket_number#83 ASC NULLS FIRST, sr_item_sk#82 ASC NULLS FIRST], false, 0 +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Arguments: [upper(ca_country#84) ASC NULLS FIRST, ca_zip#83 ASC NULLS FIRST], false, 0 (97) SortMergeJoin [codegen id : 18] -Left keys [2]: [cast(ss_ticket_number#53 as bigint), cast(ss_item_sk#50 as bigint)] -Right keys [2]: [sr_ticket_number#83, sr_item_sk#82] +Left keys [2]: [c_birth_country#74, s_zip#60] +Right keys [2]: [upper(ca_country#84), ca_zip#83] Join condition: None (98) Project [codegen id : 18] -Output [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Input [15]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77, sr_item_sk#82, sr_ticket_number#83] +Output [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#82] +Input [15]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, ca_state#82, ca_zip#83, ca_country#84] (99) HashAggregate [codegen id : 18] -Input [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#77] -Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] +Input [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#82] +Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#54))] Aggregate Attributes [1]: [sum#86] -Results [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Results [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] (100) Exchange -Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] -Arguments: hashpartitioning(c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, 5), ENSURE_REQUIREMENTS, [id=#88] +Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Arguments: hashpartitioning(c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, 5), ENSURE_REQUIREMENTS, [id=#88] (101) HashAggregate [codegen id : 19] -Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] -Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#77, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] +Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] Functions [1]: [sum(UnscaledValue(ss_net_paid#54))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#54))#89] Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#54))#89,17,2) AS netpaid#39] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt index 7c896c0838a85..46fa83fcfed4b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt @@ -14,20 +14,20 @@ WholeStageCodegen (14) WholeStageCodegen (18) HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] - SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] InputAdapter WholeStageCodegen (15) - Sort [ss_ticket_number,ss_item_sk] + Sort [c_birth_country,s_zip] InputAdapter - Exchange [ss_ticket_number,ss_item_sk] #12 + Exchange [c_birth_country,s_zip] #12 WholeStageCodegen (14) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] - SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] InputAdapter WholeStageCodegen (11) - Sort [c_birth_country,s_zip] + Sort [ss_ticket_number,ss_item_sk] InputAdapter - Exchange [c_birth_country,s_zip] #13 + Exchange [ss_ticket_number,ss_item_sk] #13 WholeStageCodegen (10) Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] @@ -82,25 +82,25 @@ WholeStageCodegen (14) Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] InputAdapter WholeStageCodegen (13) - Sort [ca_country,ca_zip] + Sort [sr_ticket_number,sr_item_sk] InputAdapter - Exchange [ca_country,ca_zip] #19 + Exchange [sr_ticket_number,sr_item_sk] #19 WholeStageCodegen (12) - Filter [ca_country,ca_zip] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_state,ca_zip,ca_country] + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] InputAdapter WholeStageCodegen (17) - Sort [sr_ticket_number,sr_item_sk] + Sort [ca_country,ca_zip] InputAdapter - Exchange [sr_ticket_number,sr_item_sk] #20 + Exchange [ca_country,ca_zip] #20 WholeStageCodegen (16) - Project [sr_item_sk,sr_ticket_number] - Filter [sr_ticket_number,sr_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum(netpaid),sum,isEmpty] InputAdapter Exchange [c_last_name,c_first_name,s_store_name] #1 @@ -112,15 +112,15 @@ WholeStageCodegen (14) WholeStageCodegen (12) HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] - SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] - InputAdapter - WholeStageCodegen (9) - Sort [ss_ticket_number,ss_item_sk] - InputAdapter - Exchange [ss_ticket_number,ss_item_sk] #3 - WholeStageCodegen (8) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,s_store_name,s_state,ca_state] - BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] + BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] + Project [ss_store_sk,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #3 + WholeStageCodegen (6) Project [ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter @@ -153,31 +153,31 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] - InputAdapter - BroadcastExchange #7 - WholeStageCodegen (7) - Project [s_store_sk,s_store_name,s_state,ca_state,ca_country] - BroadcastHashJoin [s_zip,ca_zip] - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (6) - Project [s_store_sk,s_store_name,s_state,s_zip] - Filter [s_market_id,s_store_sk,s_zip] - ColumnarToRow - InputAdapter - Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] - Filter [ca_country,ca_zip] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_state,ca_zip,ca_country] + InputAdapter + WholeStageCodegen (9) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #7 + WholeStageCodegen (8) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] InputAdapter - WholeStageCodegen (11) - Sort [sr_ticket_number,sr_item_sk] - InputAdapter - Exchange [sr_ticket_number,sr_item_sk] #9 - WholeStageCodegen (10) - Project [sr_item_sk,sr_ticket_number] - Filter [sr_ticket_number,sr_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + BroadcastExchange #8 + WholeStageCodegen (11) + Project [s_store_sk,s_store_name,s_state,ca_state,ca_country] + BroadcastHashJoin [s_zip,ca_zip] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (10) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt index aeaf3f56b9e13..2b6c25252d1df 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt @@ -68,18 +68,18 @@ Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, s (5) Exchange Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#7] (6) Sort [codegen id : 2] Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 (7) Scan parquet default.store_returns Output [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (8) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] @@ -101,7 +101,7 @@ Input [2]: [sr_item_sk#8, sr_ticket_number#9] Arguments: [sr_ticket_number#9 ASC NULLS FIRST, sr_item_sk#8 ASC NULLS FIRST], false, 0 (13) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] Right keys [2]: [sr_ticket_number#9, sr_item_sk#8] Join condition: None @@ -335,18 +335,18 @@ Input [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#5 (52) Exchange Input [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] -Arguments: hashpartitioning(cast(ss_ticket_number#52 as bigint), cast(ss_item_sk#49 as bigint), 5), ENSURE_REQUIREMENTS, [id=#55] +Arguments: hashpartitioning(ss_ticket_number#52, ss_item_sk#49, 5), ENSURE_REQUIREMENTS, [id=#55] (53) Sort [codegen id : 2] Input [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] -Arguments: [cast(ss_ticket_number#52 as bigint) ASC NULLS FIRST, cast(ss_item_sk#49 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#52 ASC NULLS FIRST, ss_item_sk#49 ASC NULLS FIRST], false, 0 (54) Scan parquet default.store_returns Output [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (55) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] @@ -368,7 +368,7 @@ Input [2]: [sr_item_sk#56, sr_ticket_number#57] Arguments: [sr_ticket_number#57 ASC NULLS FIRST, sr_item_sk#56 ASC NULLS FIRST], false, 0 (60) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ss_ticket_number#52 as bigint), cast(ss_item_sk#49 as bigint)] +Left keys [2]: [ss_ticket_number#52, ss_item_sk#49] Right keys [2]: [sr_ticket_number#57, sr_item_sk#56] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/explain.txt index 8ebdf815e265c..60be358241b9e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/explain.txt @@ -172,11 +172,11 @@ Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, (26) Exchange Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] -Arguments: hashpartitioning(cast(ss_customer_sk#2 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint), 5), ENSURE_REQUIREMENTS, [id=#21] +Arguments: hashpartitioning(ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#21] (27) Sort [codegen id : 8] Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] -Arguments: [cast(ss_customer_sk#2 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_customer_sk#2 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 (28) Scan parquet default.store_returns Output [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25, sr_returned_date_sk#26] @@ -184,7 +184,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#26), dynamicpruningexpression(sr_returned_date_sk#26 IN dynamicpruning#27)] PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (29) ColumnarToRow [codegen id : 10] Input [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25, sr_returned_date_sk#26] @@ -217,7 +217,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (36) BroadcastHashJoin [codegen id : 10] Left keys [1]: [sr_returned_date_sk#26] -Right keys [1]: [cast(d_date_sk#28 as bigint)] +Right keys [1]: [d_date_sk#28] Join condition: None (37) Project [codegen id : 10] @@ -233,7 +233,7 @@ Input [4]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#2 Arguments: [sr_customer_sk#23 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST, sr_ticket_number#24 ASC NULLS FIRST], false, 0 (40) SortMergeJoin [codegen id : 12] -Left keys [3]: [cast(ss_customer_sk#2 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] Right keys [3]: [sr_customer_sk#23, sr_item_sk#22, sr_ticket_number#24] Join condition: None @@ -253,7 +253,7 @@ Arguments: [sr_customer_sk#23 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST], f Output [4]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36, cs_sold_date_sk#37] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#37), dynamicpruningexpression(cs_sold_date_sk#37 IN dynamicpruning#38)] +PartitionFilters: [isnotnull(cs_sold_date_sk#37), dynamicpruningexpression(cs_sold_date_sk#37 IN dynamicpruning#27)] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] ReadSchema: struct @@ -265,28 +265,28 @@ Input [4]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36, cs_sold_dat Condition : (isnotnull(cs_bill_customer_sk#34) AND isnotnull(cs_item_sk#35)) (47) ReusedExchange [Reuses operator id: 35] -Output [1]: [d_date_sk#39] +Output [1]: [d_date_sk#38] (48) BroadcastHashJoin [codegen id : 15] Left keys [1]: [cs_sold_date_sk#37] -Right keys [1]: [d_date_sk#39] +Right keys [1]: [d_date_sk#38] Join condition: None (49) Project [codegen id : 15] Output [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36] -Input [5]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36, cs_sold_date_sk#37, d_date_sk#39] +Input [5]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36, cs_sold_date_sk#37, d_date_sk#38] (50) Exchange Input [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36] -Arguments: hashpartitioning(cast(cs_bill_customer_sk#34 as bigint), cast(cs_item_sk#35 as bigint), 5), ENSURE_REQUIREMENTS, [id=#40] +Arguments: hashpartitioning(cs_bill_customer_sk#34, cs_item_sk#35, 5), ENSURE_REQUIREMENTS, [id=#39] (51) Sort [codegen id : 16] Input [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36] -Arguments: [cast(cs_bill_customer_sk#34 as bigint) ASC NULLS FIRST, cast(cs_item_sk#35 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [cs_bill_customer_sk#34 ASC NULLS FIRST, cs_item_sk#35 ASC NULLS FIRST], false, 0 (52) SortMergeJoin [codegen id : 17] Left keys [2]: [sr_customer_sk#23, sr_item_sk#22] -Right keys [2]: [cast(cs_bill_customer_sk#34 as bigint), cast(cs_item_sk#35 as bigint)] +Right keys [2]: [cs_bill_customer_sk#34, cs_item_sk#35] Join condition: None (53) Project [codegen id : 17] @@ -297,23 +297,23 @@ Input [11]: [ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_it Input [7]: [ss_net_profit#5, sr_net_loss#25, cs_net_profit#36, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] Keys [4]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14] Functions [3]: [partial_sum(UnscaledValue(ss_net_profit#5)), partial_sum(UnscaledValue(sr_net_loss#25)), partial_sum(UnscaledValue(cs_net_profit#36))] -Aggregate Attributes [3]: [sum#41, sum#42, sum#43] -Results [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#44, sum#45, sum#46] +Aggregate Attributes [3]: [sum#40, sum#41, sum#42] +Results [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#43, sum#44, sum#45] (55) Exchange -Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#44, sum#45, sum#46] -Arguments: hashpartitioning(i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, 5), ENSURE_REQUIREMENTS, [id=#47] +Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#43, sum#44, sum#45] +Arguments: hashpartitioning(i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, 5), ENSURE_REQUIREMENTS, [id=#46] (56) HashAggregate [codegen id : 18] -Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#44, sum#45, sum#46] +Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#43, sum#44, sum#45] Keys [4]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14] Functions [3]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(sr_net_loss#25)), sum(UnscaledValue(cs_net_profit#36))] -Aggregate Attributes [3]: [sum(UnscaledValue(ss_net_profit#5))#48, sum(UnscaledValue(sr_net_loss#25))#49, sum(UnscaledValue(cs_net_profit#36))#50] -Results [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#48,17,2) AS store_sales_profit#51, MakeDecimal(sum(UnscaledValue(sr_net_loss#25))#49,17,2) AS store_returns_loss#52, MakeDecimal(sum(UnscaledValue(cs_net_profit#36))#50,17,2) AS catalog_sales_profit#53] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_net_profit#5))#47, sum(UnscaledValue(sr_net_loss#25))#48, sum(UnscaledValue(cs_net_profit#36))#49] +Results [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#47,17,2) AS store_sales_profit#50, MakeDecimal(sum(UnscaledValue(sr_net_loss#25))#48,17,2) AS store_returns_loss#51, MakeDecimal(sum(UnscaledValue(cs_net_profit#36))#49,17,2) AS catalog_sales_profit#52] (57) TakeOrderedAndProject -Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, store_sales_profit#51, store_returns_loss#52, catalog_sales_profit#53] -Arguments: 100, [i_item_id#18 ASC NULLS FIRST, i_item_desc#19 ASC NULLS FIRST, s_store_id#13 ASC NULLS FIRST, s_store_name#14 ASC NULLS FIRST], [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, store_sales_profit#51, store_returns_loss#52, catalog_sales_profit#53] +Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, store_sales_profit#50, store_returns_loss#51, catalog_sales_profit#52] +Arguments: 100, [i_item_id#18 ASC NULLS FIRST, i_item_desc#19 ASC NULLS FIRST, s_store_id#13 ASC NULLS FIRST, s_store_name#14 ASC NULLS FIRST], [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, store_sales_profit#50, store_returns_loss#51, catalog_sales_profit#52] ===== Subqueries ===== @@ -331,11 +331,6 @@ ReusedExchange (59) (59) ReusedExchange [Reuses operator id: 35] Output [1]: [d_date_sk#28] -Subquery:3 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#37 IN dynamicpruning#38 -ReusedExchange (60) - - -(60) ReusedExchange [Reuses operator id: 35] -Output [1]: [d_date_sk#39] +Subquery:3 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#37 IN dynamicpruning#27 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/simplified.txt index 60358dea7025b..5d7e47650d1b5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/simplified.txt @@ -98,7 +98,6 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_net_profit,cs_sold_date_sk] - SubqueryBroadcast [d_date_sk] #3 - ReusedExchange [d_date_sk] #9 + ReusedSubquery [d_date_sk] #2 InputAdapter ReusedExchange [d_date_sk] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt index 6c0699549db60..184dd07f7d950 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt @@ -70,7 +70,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#12), dynamicpruningexpression(sr_returned_date_sk#12 IN dynamicpruning#13)] PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12] @@ -81,10 +81,10 @@ Condition : ((isnotnull(sr_customer_sk#9) AND isnotnull(sr_item_sk#8)) AND isnot (7) BroadcastExchange Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false], input[2, bigint, false]),false), [id=#14] +Arguments: HashedRelationBroadcastMode(List(input[1, int, false], input[0, int, false], input[2, int, false]),false), [id=#14] (8) BroadcastHashJoin [codegen id : 8] -Left keys [3]: [cast(ss_customer_sk#2 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] Right keys [3]: [sr_customer_sk#9, sr_item_sk#8, sr_ticket_number#10] Join condition: None @@ -96,7 +96,7 @@ Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, Output [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_net_profit#17, cs_sold_date_sk#18] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#19)] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#13)] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] ReadSchema: struct @@ -109,11 +109,11 @@ Condition : (isnotnull(cs_bill_customer_sk#15) AND isnotnull(cs_item_sk#16)) (13) BroadcastExchange Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_net_profit#17, cs_sold_date_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[1, int, false] as bigint)),false), [id=#20] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[1, int, false] as bigint) & 4294967295))),false), [id=#19] (14) BroadcastHashJoin [codegen id : 8] Left keys [2]: [sr_customer_sk#9, sr_item_sk#8] -Right keys [2]: [cast(cs_bill_customer_sk#15 as bigint), cast(cs_item_sk#16 as bigint)] +Right keys [2]: [cs_bill_customer_sk#15, cs_item_sk#16] Join condition: None (15) Project [codegen id : 8] @@ -121,154 +121,154 @@ Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_net_loss#11, sr_returned_date_sk#12, cs_bill_customer_sk#15, cs_item_sk#16, cs_net_profit#17, cs_sold_date_sk#18] (16) Scan parquet default.date_dim -Output [3]: [d_date_sk#21, d_year#22, d_moy#23] +Output [3]: [d_date_sk#20, d_year#21, d_moy#22] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,4), EqualTo(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct (17) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#21, d_year#22, d_moy#23] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] (18) Filter [codegen id : 3] -Input [3]: [d_date_sk#21, d_year#22, d_moy#23] -Condition : ((((isnotnull(d_moy#23) AND isnotnull(d_year#22)) AND (d_moy#23 = 4)) AND (d_year#22 = 2001)) AND isnotnull(d_date_sk#21)) +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] +Condition : ((((isnotnull(d_moy#22) AND isnotnull(d_year#21)) AND (d_moy#22 = 4)) AND (d_year#21 = 2001)) AND isnotnull(d_date_sk#20)) (19) Project [codegen id : 3] -Output [1]: [d_date_sk#21] -Input [3]: [d_date_sk#21, d_year#22, d_moy#23] +Output [1]: [d_date_sk#20] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] (20) BroadcastExchange -Input [1]: [d_date_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (21) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ss_sold_date_sk#6] -Right keys [1]: [d_date_sk#21] +Right keys [1]: [d_date_sk#20] Join condition: None (22) Project [codegen id : 8] Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#17, cs_sold_date_sk#18] -Input [9]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#17, cs_sold_date_sk#18, d_date_sk#21] +Input [9]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#17, cs_sold_date_sk#18, d_date_sk#20] (23) Scan parquet default.date_dim -Output [3]: [d_date_sk#25, d_year#26, d_moy#27] +Output [3]: [d_date_sk#24, d_year#25, d_moy#26] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,10), EqualTo(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct (24) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#25, d_year#26, d_moy#27] +Input [3]: [d_date_sk#24, d_year#25, d_moy#26] (25) Filter [codegen id : 4] -Input [3]: [d_date_sk#25, d_year#26, d_moy#27] -Condition : (((((isnotnull(d_moy#27) AND isnotnull(d_year#26)) AND (d_moy#27 >= 4)) AND (d_moy#27 <= 10)) AND (d_year#26 = 2001)) AND isnotnull(d_date_sk#25)) +Input [3]: [d_date_sk#24, d_year#25, d_moy#26] +Condition : (((((isnotnull(d_moy#26) AND isnotnull(d_year#25)) AND (d_moy#26 >= 4)) AND (d_moy#26 <= 10)) AND (d_year#25 = 2001)) AND isnotnull(d_date_sk#24)) (26) Project [codegen id : 4] -Output [1]: [d_date_sk#25] -Input [3]: [d_date_sk#25, d_year#26, d_moy#27] +Output [1]: [d_date_sk#24] +Input [3]: [d_date_sk#24, d_year#25, d_moy#26] (27) BroadcastExchange -Input [1]: [d_date_sk#25] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] (28) BroadcastHashJoin [codegen id : 8] Left keys [1]: [sr_returned_date_sk#12] -Right keys [1]: [cast(d_date_sk#25 as bigint)] +Right keys [1]: [d_date_sk#24] Join condition: None (29) Project [codegen id : 8] Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, cs_sold_date_sk#18] -Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#17, cs_sold_date_sk#18, d_date_sk#25] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#17, cs_sold_date_sk#18, d_date_sk#24] (30) ReusedExchange [Reuses operator id: 27] -Output [1]: [d_date_sk#29] +Output [1]: [d_date_sk#28] (31) BroadcastHashJoin [codegen id : 8] Left keys [1]: [cs_sold_date_sk#18] -Right keys [1]: [d_date_sk#29] +Right keys [1]: [d_date_sk#28] Join condition: None (32) Project [codegen id : 8] Output [5]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17] -Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, cs_sold_date_sk#18, d_date_sk#29] +Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, cs_sold_date_sk#18, d_date_sk#28] (33) Scan parquet default.store -Output [3]: [s_store_sk#30, s_store_id#31, s_store_name#32] +Output [3]: [s_store_sk#29, s_store_id#30, s_store_name#31] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (34) ColumnarToRow [codegen id : 6] -Input [3]: [s_store_sk#30, s_store_id#31, s_store_name#32] +Input [3]: [s_store_sk#29, s_store_id#30, s_store_name#31] (35) Filter [codegen id : 6] -Input [3]: [s_store_sk#30, s_store_id#31, s_store_name#32] -Condition : isnotnull(s_store_sk#30) +Input [3]: [s_store_sk#29, s_store_id#30, s_store_name#31] +Condition : isnotnull(s_store_sk#29) (36) BroadcastExchange -Input [3]: [s_store_sk#30, s_store_id#31, s_store_name#32] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] +Input [3]: [s_store_sk#29, s_store_id#30, s_store_name#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (37) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ss_store_sk#3] -Right keys [1]: [s_store_sk#30] +Right keys [1]: [s_store_sk#29] Join condition: None (38) Project [codegen id : 8] -Output [6]: [ss_item_sk#1, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#31, s_store_name#32] -Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_sk#30, s_store_id#31, s_store_name#32] +Output [6]: [ss_item_sk#1, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#30, s_store_name#31] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_sk#29, s_store_id#30, s_store_name#31] (39) Scan parquet default.item -Output [3]: [i_item_sk#34, i_item_id#35, i_item_desc#36] +Output [3]: [i_item_sk#33, i_item_id#34, i_item_desc#35] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct (40) ColumnarToRow [codegen id : 7] -Input [3]: [i_item_sk#34, i_item_id#35, i_item_desc#36] +Input [3]: [i_item_sk#33, i_item_id#34, i_item_desc#35] (41) Filter [codegen id : 7] -Input [3]: [i_item_sk#34, i_item_id#35, i_item_desc#36] -Condition : isnotnull(i_item_sk#34) +Input [3]: [i_item_sk#33, i_item_id#34, i_item_desc#35] +Condition : isnotnull(i_item_sk#33) (42) BroadcastExchange -Input [3]: [i_item_sk#34, i_item_id#35, i_item_desc#36] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#37] +Input [3]: [i_item_sk#33, i_item_id#34, i_item_desc#35] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#36] (43) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ss_item_sk#1] -Right keys [1]: [i_item_sk#34] +Right keys [1]: [i_item_sk#33] Join condition: None (44) Project [codegen id : 8] -Output [7]: [ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#31, s_store_name#32, i_item_id#35, i_item_desc#36] -Input [9]: [ss_item_sk#1, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#31, s_store_name#32, i_item_sk#34, i_item_id#35, i_item_desc#36] +Output [7]: [ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#30, s_store_name#31, i_item_id#34, i_item_desc#35] +Input [9]: [ss_item_sk#1, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#30, s_store_name#31, i_item_sk#33, i_item_id#34, i_item_desc#35] (45) HashAggregate [codegen id : 8] -Input [7]: [ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#31, s_store_name#32, i_item_id#35, i_item_desc#36] -Keys [4]: [i_item_id#35, i_item_desc#36, s_store_id#31, s_store_name#32] +Input [7]: [ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#30, s_store_name#31, i_item_id#34, i_item_desc#35] +Keys [4]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31] Functions [3]: [partial_sum(UnscaledValue(ss_net_profit#5)), partial_sum(UnscaledValue(sr_net_loss#11)), partial_sum(UnscaledValue(cs_net_profit#17))] -Aggregate Attributes [3]: [sum#38, sum#39, sum#40] -Results [7]: [i_item_id#35, i_item_desc#36, s_store_id#31, s_store_name#32, sum#41, sum#42, sum#43] +Aggregate Attributes [3]: [sum#37, sum#38, sum#39] +Results [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, sum#40, sum#41, sum#42] (46) Exchange -Input [7]: [i_item_id#35, i_item_desc#36, s_store_id#31, s_store_name#32, sum#41, sum#42, sum#43] -Arguments: hashpartitioning(i_item_id#35, i_item_desc#36, s_store_id#31, s_store_name#32, 5), ENSURE_REQUIREMENTS, [id=#44] +Input [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, sum#40, sum#41, sum#42] +Arguments: hashpartitioning(i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, 5), ENSURE_REQUIREMENTS, [id=#43] (47) HashAggregate [codegen id : 9] -Input [7]: [i_item_id#35, i_item_desc#36, s_store_id#31, s_store_name#32, sum#41, sum#42, sum#43] -Keys [4]: [i_item_id#35, i_item_desc#36, s_store_id#31, s_store_name#32] +Input [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, sum#40, sum#41, sum#42] +Keys [4]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31] Functions [3]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(sr_net_loss#11)), sum(UnscaledValue(cs_net_profit#17))] -Aggregate Attributes [3]: [sum(UnscaledValue(ss_net_profit#5))#45, sum(UnscaledValue(sr_net_loss#11))#46, sum(UnscaledValue(cs_net_profit#17))#47] -Results [7]: [i_item_id#35, i_item_desc#36, s_store_id#31, s_store_name#32, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#45,17,2) AS store_sales_profit#48, MakeDecimal(sum(UnscaledValue(sr_net_loss#11))#46,17,2) AS store_returns_loss#49, MakeDecimal(sum(UnscaledValue(cs_net_profit#17))#47,17,2) AS catalog_sales_profit#50] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_net_profit#5))#44, sum(UnscaledValue(sr_net_loss#11))#45, sum(UnscaledValue(cs_net_profit#17))#46] +Results [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#44,17,2) AS store_sales_profit#47, MakeDecimal(sum(UnscaledValue(sr_net_loss#11))#45,17,2) AS store_returns_loss#48, MakeDecimal(sum(UnscaledValue(cs_net_profit#17))#46,17,2) AS catalog_sales_profit#49] (48) TakeOrderedAndProject -Input [7]: [i_item_id#35, i_item_desc#36, s_store_id#31, s_store_name#32, store_sales_profit#48, store_returns_loss#49, catalog_sales_profit#50] -Arguments: 100, [i_item_id#35 ASC NULLS FIRST, i_item_desc#36 ASC NULLS FIRST, s_store_id#31 ASC NULLS FIRST, s_store_name#32 ASC NULLS FIRST], [i_item_id#35, i_item_desc#36, s_store_id#31, s_store_name#32, store_sales_profit#48, store_returns_loss#49, catalog_sales_profit#50] +Input [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, store_sales_profit#47, store_returns_loss#48, catalog_sales_profit#49] +Arguments: 100, [i_item_id#34 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST, s_store_id#30 ASC NULLS FIRST, s_store_name#31 ASC NULLS FIRST], [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, store_sales_profit#47, store_returns_loss#48, catalog_sales_profit#49] ===== Subqueries ===== @@ -277,20 +277,15 @@ ReusedExchange (49) (49) ReusedExchange [Reuses operator id: 20] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#20] Subquery:2 Hosting operator id = 4 Hosting Expression = sr_returned_date_sk#12 IN dynamicpruning#13 ReusedExchange (50) (50) ReusedExchange [Reuses operator id: 27] -Output [1]: [d_date_sk#25] +Output [1]: [d_date_sk#24] -Subquery:3 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#19 -ReusedExchange (51) - - -(51) ReusedExchange [Reuses operator id: 27] -Output [1]: [d_date_sk#29] +Subquery:3 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#13 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt index f218fce3a2b5d..6b22b6392eade 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt @@ -41,8 +41,7 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_net_profit,cs_sold_date_sk] - SubqueryBroadcast [d_date_sk] #3 - ReusedExchange [d_date_sk] #4 + ReusedSubquery [d_date_sk] #2 InputAdapter BroadcastExchange #2 WholeStageCodegen (3) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt index 780ba7e7d5367..d07d84fda4259 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt @@ -176,11 +176,11 @@ Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s (26) Exchange Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] -Arguments: hashpartitioning(cast(ss_customer_sk#2 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint), 5), ENSURE_REQUIREMENTS, [id=#21] +Arguments: hashpartitioning(ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#21] (27) Sort [codegen id : 8] Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] -Arguments: [cast(ss_customer_sk#2 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_customer_sk#2 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 (28) Scan parquet default.store_returns Output [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25, sr_returned_date_sk#26] @@ -188,7 +188,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#26), dynamicpruningexpression(sr_returned_date_sk#26 IN dynamicpruning#27)] PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (29) ColumnarToRow [codegen id : 10] Input [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25, sr_returned_date_sk#26] @@ -221,7 +221,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (36) BroadcastHashJoin [codegen id : 10] Left keys [1]: [sr_returned_date_sk#26] -Right keys [1]: [cast(d_date_sk#28 as bigint)] +Right keys [1]: [d_date_sk#28] Join condition: None (37) Project [codegen id : 10] @@ -237,7 +237,7 @@ Input [4]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_qua Arguments: [sr_customer_sk#23 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST, sr_ticket_number#24 ASC NULLS FIRST], false, 0 (40) SortMergeJoin [codegen id : 12] -Left keys [3]: [cast(ss_customer_sk#2 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] Right keys [3]: [sr_customer_sk#23, sr_item_sk#22, sr_ticket_number#24] Join condition: None @@ -301,15 +301,15 @@ Input [5]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36, cs_sold_date_ (54) Exchange Input [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36] -Arguments: hashpartitioning(cast(cs_bill_customer_sk#34 as bigint), cast(cs_item_sk#35 as bigint), 5), ENSURE_REQUIREMENTS, [id=#42] +Arguments: hashpartitioning(cs_bill_customer_sk#34, cs_item_sk#35, 5), ENSURE_REQUIREMENTS, [id=#42] (55) Sort [codegen id : 16] Input [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36] -Arguments: [cast(cs_bill_customer_sk#34 as bigint) ASC NULLS FIRST, cast(cs_item_sk#35 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [cs_bill_customer_sk#34 ASC NULLS FIRST, cs_item_sk#35 ASC NULLS FIRST], false, 0 (56) SortMergeJoin [codegen id : 17] Left keys [2]: [sr_customer_sk#23, sr_item_sk#22] -Right keys [2]: [cast(cs_bill_customer_sk#34 as bigint), cast(cs_item_sk#35 as bigint)] +Right keys [2]: [cs_bill_customer_sk#34, cs_item_sk#35] Join condition: None (57) Project [codegen id : 17] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/explain.txt index 3a4c078c6b6cb..45a02422e92b1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/explain.txt @@ -74,7 +74,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#12), dynamicpruningexpression(sr_returned_date_sk#12 IN dynamicpruning#13)] PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] @@ -85,10 +85,10 @@ Condition : ((isnotnull(sr_customer_sk#9) AND isnotnull(sr_item_sk#8)) AND isnot (7) BroadcastExchange Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false], input[2, bigint, false]),false), [id=#14] +Arguments: HashedRelationBroadcastMode(List(input[1, int, false], input[0, int, false], input[2, int, false]),false), [id=#14] (8) BroadcastHashJoin [codegen id : 8] -Left keys [3]: [cast(ss_customer_sk#2 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] Right keys [3]: [sr_customer_sk#9, sr_item_sk#8, sr_ticket_number#10] Join condition: None @@ -113,11 +113,11 @@ Condition : (isnotnull(cs_bill_customer_sk#15) AND isnotnull(cs_item_sk#16)) (13) BroadcastExchange Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[1, int, false] as bigint)),false), [id=#20] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[1, int, false] as bigint) & 4294967295))),false), [id=#20] (14) BroadcastHashJoin [codegen id : 8] Left keys [2]: [sr_customer_sk#9, sr_item_sk#8] -Right keys [2]: [cast(cs_bill_customer_sk#15 as bigint), cast(cs_item_sk#16 as bigint)] +Right keys [2]: [cs_bill_customer_sk#15, cs_item_sk#16] Join condition: None (15) Project [codegen id : 8] @@ -179,7 +179,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (28) BroadcastHashJoin [codegen id : 8] Left keys [1]: [sr_returned_date_sk#12] -Right keys [1]: [cast(d_date_sk#25 as bigint)] +Right keys [1]: [d_date_sk#25] Join condition: None (29) Project [codegen id : 8] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt index 9e84e385be302..6fdac15976957 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt @@ -2,346 +2,346 @@ TakeOrderedAndProject (59) +- * Project (58) +- * BroadcastHashJoin Inner BuildRight (57) - :- * Project (45) - : +- * BroadcastHashJoin Inner BuildRight (44) - : :- * Filter (23) - : : +- * HashAggregate (22) - : : +- Exchange (21) - : : +- * HashAggregate (20) - : : +- * Project (19) - : : +- * SortMergeJoin Inner (18) - : : :- * Sort (12) - : : : +- Exchange (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.web_returns (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) - : : +- * Sort (17) - : : +- Exchange (16) - : : +- * Filter (15) - : : +- * ColumnarToRow (14) - : : +- Scan parquet default.customer_address (13) - : +- BroadcastExchange (43) - : +- * Filter (42) - : +- * HashAggregate (41) - : +- Exchange (40) - : +- * HashAggregate (39) - : +- * HashAggregate (38) - : +- Exchange (37) - : +- * HashAggregate (36) - : +- * Project (35) - : +- * SortMergeJoin Inner (34) - : :- * Sort (31) - : : +- Exchange (30) - : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Filter (26) - : : : +- * ColumnarToRow (25) - : : : +- Scan parquet default.web_returns (24) - : : +- ReusedExchange (27) - : +- * Sort (33) - : +- ReusedExchange (32) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildLeft (35) + : :- BroadcastExchange (11) + : : +- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.customer (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.customer_address (4) + : +- * Filter (34) + : +- * HashAggregate (33) + : +- Exchange (32) + : +- * HashAggregate (31) + : +- * Project (30) + : +- * SortMergeJoin Inner (29) + : :- * Sort (23) + : : +- Exchange (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.web_returns (12) + : : +- BroadcastExchange (19) + : : +- * Project (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.date_dim (15) + : +- * Sort (28) + : +- Exchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.customer_address (24) +- BroadcastExchange (56) - +- * Project (55) - +- * BroadcastHashJoin Inner BuildRight (54) - :- * Filter (48) - : +- * ColumnarToRow (47) - : +- Scan parquet default.customer (46) - +- BroadcastExchange (53) - +- * Project (52) - +- * Filter (51) - +- * ColumnarToRow (50) - +- Scan parquet default.customer_address (49) - - -(1) Scan parquet default.web_returns -Output [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4] + +- * Filter (55) + +- * HashAggregate (54) + +- Exchange (53) + +- * HashAggregate (52) + +- * HashAggregate (51) + +- Exchange (50) + +- * HashAggregate (49) + +- * Project (48) + +- * SortMergeJoin Inner (47) + :- * Sort (44) + : +- Exchange (43) + : +- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Filter (39) + : : +- * ColumnarToRow (38) + : : +- Scan parquet default.web_returns (37) + : +- ReusedExchange (40) + +- * Sort (46) + +- ReusedExchange (45) + + +(1) Scan parquet default.customer +Output [14]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] Batched: true -Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#4), dynamicpruningexpression(wr_returned_date_sk#4 IN dynamicpruning#5)] -PushedFilters: [IsNotNull(wr_returning_addr_sk), IsNotNull(wr_returning_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 2] -Input [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] (3) Filter [codegen id : 2] -Input [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4] -Condition : (isnotnull(wr_returning_addr_sk#2) AND isnotnull(wr_returning_customer_sk#1)) +Input [14]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#6, d_year#7] +(4) Scan parquet default.customer_address +Output [2]: [ca_address_sk#15, ca_state#16] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#6, d_year#7] +Input [2]: [ca_address_sk#15, ca_state#16] (6) Filter [codegen id : 1] -Input [2]: [d_date_sk#6, d_year#7] -Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2002)) AND isnotnull(d_date_sk#6)) +Input [2]: [ca_address_sk#15, ca_state#16] +Condition : ((isnotnull(ca_state#16) AND (ca_state#16 = GA)) AND isnotnull(ca_address_sk#15)) (7) Project [codegen id : 1] -Output [1]: [d_date_sk#6] -Input [2]: [d_date_sk#6, d_year#7] +Output [1]: [ca_address_sk#15] +Input [2]: [ca_address_sk#15, ca_state#16] (8) BroadcastExchange -Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +Input [1]: [ca_address_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [wr_returned_date_sk#4] -Right keys [1]: [cast(d_date_sk#6 as bigint)] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#15] Join condition: None (10) Project [codegen id : 2] -Output [3]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3] -Input [5]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4, d_date_sk#6] +Output [13]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] +Input [15]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ca_address_sk#15] -(11) Exchange -Input [3]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3] -Arguments: hashpartitioning(wr_returning_addr_sk#2, 5), ENSURE_REQUIREMENTS, [id=#9] +(11) BroadcastExchange +Input [13]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] -(12) Sort [codegen id : 3] -Input [3]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3] -Arguments: [wr_returning_addr_sk#2 ASC NULLS FIRST], false, 0 +(12) Scan parquet default.web_returns +Output [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#22), dynamicpruningexpression(wr_returned_date_sk#22 IN dynamicpruning#23)] +PushedFilters: [IsNotNull(wr_returning_addr_sk), IsNotNull(wr_returning_customer_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 4] +Input [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] + +(14) Filter [codegen id : 4] +Input [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] +Condition : (isnotnull(wr_returning_addr_sk#20) AND isnotnull(wr_returning_customer_sk#19)) -(13) Scan parquet default.customer_address -Output [2]: [ca_address_sk#10, ca_state#11] +(15) Scan parquet default.date_dim +Output [2]: [d_date_sk#24, d_year#25] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [2]: [ca_address_sk#10, ca_state#11] +(16) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#24, d_year#25] -(15) Filter [codegen id : 4] -Input [2]: [ca_address_sk#10, ca_state#11] -Condition : (isnotnull(ca_address_sk#10) AND isnotnull(ca_state#11)) +(17) Filter [codegen id : 3] +Input [2]: [d_date_sk#24, d_year#25] +Condition : ((isnotnull(d_year#25) AND (d_year#25 = 2002)) AND isnotnull(d_date_sk#24)) -(16) Exchange -Input [2]: [ca_address_sk#10, ca_state#11] -Arguments: hashpartitioning(cast(ca_address_sk#10 as bigint), 5), ENSURE_REQUIREMENTS, [id=#12] +(18) Project [codegen id : 3] +Output [1]: [d_date_sk#24] +Input [2]: [d_date_sk#24, d_year#25] -(17) Sort [codegen id : 5] -Input [2]: [ca_address_sk#10, ca_state#11] -Arguments: [cast(ca_address_sk#10 as bigint) ASC NULLS FIRST], false, 0 +(19) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [wr_returning_addr_sk#2] -Right keys [1]: [cast(ca_address_sk#10 as bigint)] +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [wr_returned_date_sk#22] +Right keys [1]: [d_date_sk#24] Join condition: None -(19) Project [codegen id : 6] -Output [3]: [wr_returning_customer_sk#1, wr_return_amt#3, ca_state#11] -Input [5]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, ca_address_sk#10, ca_state#11] - -(20) HashAggregate [codegen id : 6] -Input [3]: [wr_returning_customer_sk#1, wr_return_amt#3, ca_state#11] -Keys [2]: [wr_returning_customer_sk#1, ca_state#11] -Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#3))] -Aggregate Attributes [1]: [sum#13] -Results [3]: [wr_returning_customer_sk#1, ca_state#11, sum#14] - -(21) Exchange -Input [3]: [wr_returning_customer_sk#1, ca_state#11, sum#14] -Arguments: hashpartitioning(wr_returning_customer_sk#1, ca_state#11, 5), ENSURE_REQUIREMENTS, [id=#15] - -(22) HashAggregate [codegen id : 17] -Input [3]: [wr_returning_customer_sk#1, ca_state#11, sum#14] -Keys [2]: [wr_returning_customer_sk#1, ca_state#11] -Functions [1]: [sum(UnscaledValue(wr_return_amt#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#3))#16] -Results [3]: [wr_returning_customer_sk#1 AS ctr_customer_sk#17, ca_state#11 AS ctr_state#18, MakeDecimal(sum(UnscaledValue(wr_return_amt#3))#16,17,2) AS ctr_total_return#19] - -(23) Filter [codegen id : 17] -Input [3]: [ctr_customer_sk#17, ctr_state#18, ctr_total_return#19] -Condition : isnotnull(ctr_total_return#19) - -(24) Scan parquet default.web_returns -Output [4]: [wr_returning_customer_sk#20, wr_returning_addr_sk#21, wr_return_amt#22, wr_returned_date_sk#23] -Batched: true -Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#23), dynamicpruningexpression(wr_returned_date_sk#23 IN dynamicpruning#5)] -PushedFilters: [IsNotNull(wr_returning_addr_sk)] -ReadSchema: struct - -(25) ColumnarToRow [codegen id : 8] -Input [4]: [wr_returning_customer_sk#20, wr_returning_addr_sk#21, wr_return_amt#22, wr_returned_date_sk#23] +(21) Project [codegen id : 4] +Output [3]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21] +Input [5]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22, d_date_sk#24] -(26) Filter [codegen id : 8] -Input [4]: [wr_returning_customer_sk#20, wr_returning_addr_sk#21, wr_return_amt#22, wr_returned_date_sk#23] -Condition : isnotnull(wr_returning_addr_sk#21) +(22) Exchange +Input [3]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21] +Arguments: hashpartitioning(wr_returning_addr_sk#20, 5), ENSURE_REQUIREMENTS, [id=#27] -(27) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#24] +(23) Sort [codegen id : 5] +Input [3]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21] +Arguments: [wr_returning_addr_sk#20 ASC NULLS FIRST], false, 0 -(28) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [wr_returned_date_sk#23] -Right keys [1]: [cast(d_date_sk#24 as bigint)] -Join condition: None +(24) Scan parquet default.customer_address +Output [2]: [ca_address_sk#28, ca_state#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] +ReadSchema: struct -(29) Project [codegen id : 8] -Output [3]: [wr_returning_customer_sk#20, wr_returning_addr_sk#21, wr_return_amt#22] -Input [5]: [wr_returning_customer_sk#20, wr_returning_addr_sk#21, wr_return_amt#22, wr_returned_date_sk#23, d_date_sk#24] +(25) ColumnarToRow [codegen id : 6] +Input [2]: [ca_address_sk#28, ca_state#29] -(30) Exchange -Input [3]: [wr_returning_customer_sk#20, wr_returning_addr_sk#21, wr_return_amt#22] -Arguments: hashpartitioning(wr_returning_addr_sk#21, 5), ENSURE_REQUIREMENTS, [id=#25] +(26) Filter [codegen id : 6] +Input [2]: [ca_address_sk#28, ca_state#29] +Condition : (isnotnull(ca_address_sk#28) AND isnotnull(ca_state#29)) -(31) Sort [codegen id : 9] -Input [3]: [wr_returning_customer_sk#20, wr_returning_addr_sk#21, wr_return_amt#22] -Arguments: [wr_returning_addr_sk#21 ASC NULLS FIRST], false, 0 +(27) Exchange +Input [2]: [ca_address_sk#28, ca_state#29] +Arguments: hashpartitioning(ca_address_sk#28, 5), ENSURE_REQUIREMENTS, [id=#30] -(32) ReusedExchange [Reuses operator id: 16] -Output [2]: [ca_address_sk#26, ca_state#27] +(28) Sort [codegen id : 7] +Input [2]: [ca_address_sk#28, ca_state#29] +Arguments: [ca_address_sk#28 ASC NULLS FIRST], false, 0 -(33) Sort [codegen id : 11] -Input [2]: [ca_address_sk#26, ca_state#27] -Arguments: [cast(ca_address_sk#26 as bigint) ASC NULLS FIRST], false, 0 +(29) SortMergeJoin [codegen id : 8] +Left keys [1]: [wr_returning_addr_sk#20] +Right keys [1]: [ca_address_sk#28] +Join condition: None -(34) SortMergeJoin [codegen id : 12] -Left keys [1]: [wr_returning_addr_sk#21] -Right keys [1]: [cast(ca_address_sk#26 as bigint)] +(30) Project [codegen id : 8] +Output [3]: [wr_returning_customer_sk#19, wr_return_amt#21, ca_state#29] +Input [5]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, ca_address_sk#28, ca_state#29] + +(31) HashAggregate [codegen id : 8] +Input [3]: [wr_returning_customer_sk#19, wr_return_amt#21, ca_state#29] +Keys [2]: [wr_returning_customer_sk#19, ca_state#29] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#21))] +Aggregate Attributes [1]: [sum#31] +Results [3]: [wr_returning_customer_sk#19, ca_state#29, sum#32] + +(32) Exchange +Input [3]: [wr_returning_customer_sk#19, ca_state#29, sum#32] +Arguments: hashpartitioning(wr_returning_customer_sk#19, ca_state#29, 5), ENSURE_REQUIREMENTS, [id=#33] + +(33) HashAggregate +Input [3]: [wr_returning_customer_sk#19, ca_state#29, sum#32] +Keys [2]: [wr_returning_customer_sk#19, ca_state#29] +Functions [1]: [sum(UnscaledValue(wr_return_amt#21))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#21))#34] +Results [3]: [wr_returning_customer_sk#19 AS ctr_customer_sk#35, ca_state#29 AS ctr_state#36, MakeDecimal(sum(UnscaledValue(wr_return_amt#21))#34,17,2) AS ctr_total_return#37] + +(34) Filter +Input [3]: [ctr_customer_sk#35, ctr_state#36, ctr_total_return#37] +Condition : isnotnull(ctr_total_return#37) + +(35) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ctr_customer_sk#35] Join condition: None -(35) Project [codegen id : 12] -Output [3]: [wr_returning_customer_sk#20, wr_return_amt#22, ca_state#27] -Input [5]: [wr_returning_customer_sk#20, wr_returning_addr_sk#21, wr_return_amt#22, ca_address_sk#26, ca_state#27] - -(36) HashAggregate [codegen id : 12] -Input [3]: [wr_returning_customer_sk#20, wr_return_amt#22, ca_state#27] -Keys [2]: [wr_returning_customer_sk#20, ca_state#27] -Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#22))] -Aggregate Attributes [1]: [sum#28] -Results [3]: [wr_returning_customer_sk#20, ca_state#27, sum#29] - -(37) Exchange -Input [3]: [wr_returning_customer_sk#20, ca_state#27, sum#29] -Arguments: hashpartitioning(wr_returning_customer_sk#20, ca_state#27, 5), ENSURE_REQUIREMENTS, [id=#30] - -(38) HashAggregate [codegen id : 13] -Input [3]: [wr_returning_customer_sk#20, ca_state#27, sum#29] -Keys [2]: [wr_returning_customer_sk#20, ca_state#27] -Functions [1]: [sum(UnscaledValue(wr_return_amt#22))] -Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#22))#31] -Results [2]: [ca_state#27 AS ctr_state#18, MakeDecimal(sum(UnscaledValue(wr_return_amt#22))#31,17,2) AS ctr_total_return#19] - -(39) HashAggregate [codegen id : 13] -Input [2]: [ctr_state#18, ctr_total_return#19] -Keys [1]: [ctr_state#18] -Functions [1]: [partial_avg(ctr_total_return#19)] -Aggregate Attributes [2]: [sum#32, count#33] -Results [3]: [ctr_state#18, sum#34, count#35] - -(40) Exchange -Input [3]: [ctr_state#18, sum#34, count#35] -Arguments: hashpartitioning(ctr_state#18, 5), ENSURE_REQUIREMENTS, [id=#36] - -(41) HashAggregate [codegen id : 14] -Input [3]: [ctr_state#18, sum#34, count#35] -Keys [1]: [ctr_state#18] -Functions [1]: [avg(ctr_total_return#19)] -Aggregate Attributes [1]: [avg(ctr_total_return#19)#37] -Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#19)#37) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#38, ctr_state#18 AS ctr_state#18#39] - -(42) Filter [codegen id : 14] -Input [2]: [(avg(ctr_total_return) * 1.2)#38, ctr_state#18#39] -Condition : isnotnull((avg(ctr_total_return) * 1.2)#38) - -(43) BroadcastExchange -Input [2]: [(avg(ctr_total_return) * 1.2)#38, ctr_state#18#39] -Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#40] - -(44) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ctr_state#18] -Right keys [1]: [ctr_state#18#39] -Join condition: (cast(ctr_total_return#19 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#38) - -(45) Project [codegen id : 17] -Output [2]: [ctr_customer_sk#17, ctr_total_return#19] -Input [5]: [ctr_customer_sk#17, ctr_state#18, ctr_total_return#19, (avg(ctr_total_return) * 1.2)#38, ctr_state#18#39] - -(46) Scan parquet default.customer -Output [14]: [c_customer_sk#41, c_customer_id#42, c_current_addr_sk#43, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54] +(36) Project [codegen id : 17] +Output [14]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_state#36, ctr_total_return#37] +Input [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_customer_sk#35, ctr_state#36, ctr_total_return#37] + +(37) Scan parquet default.web_returns +Output [4]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, wr_returned_date_sk#41] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#41), dynamicpruningexpression(wr_returned_date_sk#41 IN dynamicpruning#23)] +PushedFilters: [IsNotNull(wr_returning_addr_sk)] +ReadSchema: struct -(47) ColumnarToRow [codegen id : 16] -Input [14]: [c_customer_sk#41, c_customer_id#42, c_current_addr_sk#43, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54] +(38) ColumnarToRow [codegen id : 10] +Input [4]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, wr_returned_date_sk#41] -(48) Filter [codegen id : 16] -Input [14]: [c_customer_sk#41, c_customer_id#42, c_current_addr_sk#43, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54] -Condition : (isnotnull(c_customer_sk#41) AND isnotnull(c_current_addr_sk#43)) +(39) Filter [codegen id : 10] +Input [4]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, wr_returned_date_sk#41] +Condition : isnotnull(wr_returning_addr_sk#39) -(49) Scan parquet default.customer_address -Output [2]: [ca_address_sk#55, ca_state#56] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] -ReadSchema: struct +(40) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#42] + +(41) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [wr_returned_date_sk#41] +Right keys [1]: [d_date_sk#42] +Join condition: None -(50) ColumnarToRow [codegen id : 15] -Input [2]: [ca_address_sk#55, ca_state#56] +(42) Project [codegen id : 10] +Output [3]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40] +Input [5]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, wr_returned_date_sk#41, d_date_sk#42] -(51) Filter [codegen id : 15] -Input [2]: [ca_address_sk#55, ca_state#56] -Condition : ((isnotnull(ca_state#56) AND (ca_state#56 = GA)) AND isnotnull(ca_address_sk#55)) +(43) Exchange +Input [3]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40] +Arguments: hashpartitioning(wr_returning_addr_sk#39, 5), ENSURE_REQUIREMENTS, [id=#43] -(52) Project [codegen id : 15] -Output [1]: [ca_address_sk#55] -Input [2]: [ca_address_sk#55, ca_state#56] +(44) Sort [codegen id : 11] +Input [3]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40] +Arguments: [wr_returning_addr_sk#39 ASC NULLS FIRST], false, 0 -(53) BroadcastExchange -Input [1]: [ca_address_sk#55] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#57] +(45) ReusedExchange [Reuses operator id: 27] +Output [2]: [ca_address_sk#44, ca_state#45] -(54) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [c_current_addr_sk#43] -Right keys [1]: [ca_address_sk#55] +(46) Sort [codegen id : 13] +Input [2]: [ca_address_sk#44, ca_state#45] +Arguments: [ca_address_sk#44 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 14] +Left keys [1]: [wr_returning_addr_sk#39] +Right keys [1]: [ca_address_sk#44] Join condition: None -(55) Project [codegen id : 16] -Output [13]: [c_customer_sk#41, c_customer_id#42, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54] -Input [15]: [c_customer_sk#41, c_customer_id#42, c_current_addr_sk#43, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54, ca_address_sk#55] +(48) Project [codegen id : 14] +Output [3]: [wr_returning_customer_sk#38, wr_return_amt#40, ca_state#45] +Input [5]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, ca_address_sk#44, ca_state#45] + +(49) HashAggregate [codegen id : 14] +Input [3]: [wr_returning_customer_sk#38, wr_return_amt#40, ca_state#45] +Keys [2]: [wr_returning_customer_sk#38, ca_state#45] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#40))] +Aggregate Attributes [1]: [sum#46] +Results [3]: [wr_returning_customer_sk#38, ca_state#45, sum#47] + +(50) Exchange +Input [3]: [wr_returning_customer_sk#38, ca_state#45, sum#47] +Arguments: hashpartitioning(wr_returning_customer_sk#38, ca_state#45, 5), ENSURE_REQUIREMENTS, [id=#48] + +(51) HashAggregate [codegen id : 15] +Input [3]: [wr_returning_customer_sk#38, ca_state#45, sum#47] +Keys [2]: [wr_returning_customer_sk#38, ca_state#45] +Functions [1]: [sum(UnscaledValue(wr_return_amt#40))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#40))#49] +Results [2]: [ca_state#45 AS ctr_state#36, MakeDecimal(sum(UnscaledValue(wr_return_amt#40))#49,17,2) AS ctr_total_return#37] + +(52) HashAggregate [codegen id : 15] +Input [2]: [ctr_state#36, ctr_total_return#37] +Keys [1]: [ctr_state#36] +Functions [1]: [partial_avg(ctr_total_return#37)] +Aggregate Attributes [2]: [sum#50, count#51] +Results [3]: [ctr_state#36, sum#52, count#53] + +(53) Exchange +Input [3]: [ctr_state#36, sum#52, count#53] +Arguments: hashpartitioning(ctr_state#36, 5), ENSURE_REQUIREMENTS, [id=#54] + +(54) HashAggregate [codegen id : 16] +Input [3]: [ctr_state#36, sum#52, count#53] +Keys [1]: [ctr_state#36] +Functions [1]: [avg(ctr_total_return#37)] +Aggregate Attributes [1]: [avg(ctr_total_return#37)#55] +Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#37)#55) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#56, ctr_state#36 AS ctr_state#36#57] + +(55) Filter [codegen id : 16] +Input [2]: [(avg(ctr_total_return) * 1.2)#56, ctr_state#36#57] +Condition : isnotnull((avg(ctr_total_return) * 1.2)#56) (56) BroadcastExchange -Input [13]: [c_customer_sk#41, c_customer_id#42, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#58] +Input [2]: [(avg(ctr_total_return) * 1.2)#56, ctr_state#36#57] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#58] (57) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ctr_customer_sk#17] -Right keys [1]: [cast(c_customer_sk#41 as bigint)] -Join condition: None +Left keys [1]: [ctr_state#36] +Right keys [1]: [ctr_state#36#57] +Join condition: (cast(ctr_total_return#37 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#56) (58) Project [codegen id : 17] -Output [13]: [c_customer_id#42, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54, ctr_total_return#19] -Input [15]: [ctr_customer_sk#17, ctr_total_return#19, c_customer_sk#41, c_customer_id#42, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54] +Output [13]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_total_return#37] +Input [16]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_state#36, ctr_total_return#37, (avg(ctr_total_return) * 1.2)#56, ctr_state#36#57] (59) TakeOrderedAndProject -Input [13]: [c_customer_id#42, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54, ctr_total_return#19] -Arguments: 100, [c_customer_id#42 ASC NULLS FIRST, c_salutation#44 ASC NULLS FIRST, c_first_name#45 ASC NULLS FIRST, c_last_name#46 ASC NULLS FIRST, c_preferred_cust_flag#47 ASC NULLS FIRST, c_birth_day#48 ASC NULLS FIRST, c_birth_month#49 ASC NULLS FIRST, c_birth_year#50 ASC NULLS FIRST, c_birth_country#51 ASC NULLS FIRST, c_login#52 ASC NULLS FIRST, c_email_address#53 ASC NULLS FIRST, c_last_review_date#54 ASC NULLS FIRST, ctr_total_return#19 ASC NULLS FIRST], [c_customer_id#42, c_salutation#44, c_first_name#45, c_last_name#46, c_preferred_cust_flag#47, c_birth_day#48, c_birth_month#49, c_birth_year#50, c_birth_country#51, c_login#52, c_email_address#53, c_last_review_date#54, ctr_total_return#19] +Input [13]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_total_return#37] +Arguments: 100, [c_customer_id#2 ASC NULLS FIRST, c_salutation#4 ASC NULLS FIRST, c_first_name#5 ASC NULLS FIRST, c_last_name#6 ASC NULLS FIRST, c_preferred_cust_flag#7 ASC NULLS FIRST, c_birth_day#8 ASC NULLS FIRST, c_birth_month#9 ASC NULLS FIRST, c_birth_year#10 ASC NULLS FIRST, c_birth_country#11 ASC NULLS FIRST, c_login#12 ASC NULLS FIRST, c_email_address#13 ASC NULLS FIRST, c_last_review_date#14 ASC NULLS FIRST, ctr_total_return#37 ASC NULLS FIRST], [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_total_return#37] ===== Subqueries ===== -Subquery:1 Hosting operator id = 1 Hosting Expression = wr_returned_date_sk#4 IN dynamicpruning#5 +Subquery:1 Hosting operator id = 12 Hosting Expression = wr_returned_date_sk#22 IN dynamicpruning#23 ReusedExchange (60) -(60) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#6] +(60) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#24] -Subquery:2 Hosting operator id = 24 Hosting Expression = wr_returned_date_sk#23 IN dynamicpruning#5 +Subquery:2 Hosting operator id = 37 Hosting Expression = wr_returned_date_sk#41 IN dynamicpruning#23 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt index ceb33bfadd37f..e8c44d275d745 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt @@ -1,23 +1,40 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] WholeStageCodegen (17) Project [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] - BroadcastHashJoin [ctr_customer_sk,c_customer_sk] - Project [ctr_customer_sk,ctr_total_return] - BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(avg(ctr_total_return) * 1.2)] + BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(avg(ctr_total_return) * 1.2)] + Project [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_state,ctr_total_return] + BroadcastHashJoin [c_customer_sk,ctr_customer_sk] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (2) + Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] Filter [ctr_total_return] HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_customer_sk,ctr_state,ctr_total_return,sum] InputAdapter - Exchange [wr_returning_customer_sk,ca_state] #1 - WholeStageCodegen (6) + Exchange [wr_returning_customer_sk,ca_state] #3 + WholeStageCodegen (8) HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] Project [wr_returning_customer_sk,wr_return_amt,ca_state] SortMergeJoin [wr_returning_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (3) + WholeStageCodegen (5) Sort [wr_returning_addr_sk] InputAdapter - Exchange [wr_returning_addr_sk] #2 - WholeStageCodegen (2) + Exchange [wr_returning_addr_sk] #4 + WholeStageCodegen (4) Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] BroadcastHashJoin [wr_returned_date_sk,d_date_sk] Filter [wr_returning_addr_sk,wr_returning_customer_sk] @@ -25,75 +42,58 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,c_pre InputAdapter Scan parquet default.web_returns [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt,wr_returned_date_sk] SubqueryBroadcast [d_date_sk] #1 - ReusedExchange [d_date_sk] #3 + ReusedExchange [d_date_sk] #5 InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) + BroadcastExchange #5 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter - WholeStageCodegen (5) + WholeStageCodegen (7) Sort [ca_address_sk] InputAdapter - Exchange [ca_address_sk] #4 - WholeStageCodegen (4) + Exchange [ca_address_sk] #6 + WholeStageCodegen (6) Filter [ca_address_sk,ca_state] ColumnarToRow InputAdapter Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter - BroadcastExchange #5 - WholeStageCodegen (14) - Filter [(avg(ctr_total_return) * 1.2)] - HashAggregate [ctr_state,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_state,sum,count] - InputAdapter - Exchange [ctr_state] #6 - WholeStageCodegen (13) - HashAggregate [ctr_state,ctr_total_return] [sum,count,sum,count] - HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_state,ctr_total_return,sum] - InputAdapter - Exchange [wr_returning_customer_sk,ca_state] #7 - WholeStageCodegen (12) - HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] - Project [wr_returning_customer_sk,wr_return_amt,ca_state] - SortMergeJoin [wr_returning_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (9) - Sort [wr_returning_addr_sk] - InputAdapter - Exchange [wr_returning_addr_sk] #8 - WholeStageCodegen (8) - Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] - BroadcastHashJoin [wr_returned_date_sk,d_date_sk] - Filter [wr_returning_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_returns [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt,wr_returned_date_sk] - ReusedSubquery [d_date_sk] #1 - InputAdapter - ReusedExchange [d_date_sk] #3 - InputAdapter - WholeStageCodegen (11) - Sort [ca_address_sk] - InputAdapter - ReusedExchange [ca_address_sk,ca_state] #4 InputAdapter - BroadcastExchange #9 + BroadcastExchange #7 WholeStageCodegen (16) - Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + Filter [(avg(ctr_total_return) * 1.2)] + HashAggregate [ctr_state,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_state,sum,count] InputAdapter - BroadcastExchange #10 + Exchange [ctr_state] #8 WholeStageCodegen (15) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + HashAggregate [ctr_state,ctr_total_return] [sum,count,sum,count] + HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_state,ctr_total_return,sum] + InputAdapter + Exchange [wr_returning_customer_sk,ca_state] #9 + WholeStageCodegen (14) + HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] + Project [wr_returning_customer_sk,wr_return_amt,ca_state] + SortMergeJoin [wr_returning_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (11) + Sort [wr_returning_addr_sk] + InputAdapter + Exchange [wr_returning_addr_sk] #10 + WholeStageCodegen (10) + Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_returning_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (13) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_state] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/explain.txt index 1aaebad9f1920..ca8b8d966ea92 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/explain.txt @@ -60,7 +60,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(wr_returned_date_sk#4), dynamicpruningexpression(wr_returned_date_sk#4 IN dynamicpruning#5)] PushedFilters: [IsNotNull(wr_returning_addr_sk), IsNotNull(wr_returning_customer_sk)] -ReadSchema: struct +ReadSchema: struct (2) ColumnarToRow [codegen id : 3] Input [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4] @@ -93,7 +93,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (9) BroadcastHashJoin [codegen id : 3] Left keys [1]: [wr_returned_date_sk#4] -Right keys [1]: [cast(d_date_sk#6 as bigint)] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 3] @@ -120,7 +120,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (15) BroadcastHashJoin [codegen id : 3] Left keys [1]: [wr_returning_addr_sk#2] -Right keys [1]: [cast(ca_address_sk#9 as bigint)] +Right keys [1]: [ca_address_sk#9] Join condition: None (16) Project [codegen id : 3] @@ -155,7 +155,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(wr_returned_date_sk#22), dynamicpruningexpression(wr_returned_date_sk#22 IN dynamicpruning#5)] PushedFilters: [IsNotNull(wr_returning_addr_sk)] -ReadSchema: struct +ReadSchema: struct (22) ColumnarToRow [codegen id : 6] Input [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] @@ -169,7 +169,7 @@ Output [1]: [d_date_sk#23] (25) BroadcastHashJoin [codegen id : 6] Left keys [1]: [wr_returned_date_sk#22] -Right keys [1]: [cast(d_date_sk#23 as bigint)] +Right keys [1]: [d_date_sk#23] Join condition: None (26) Project [codegen id : 6] @@ -181,7 +181,7 @@ Output [2]: [ca_address_sk#24, ca_state#25] (28) BroadcastHashJoin [codegen id : 6] Left keys [1]: [wr_returning_addr_sk#20] -Right keys [1]: [cast(ca_address_sk#24 as bigint)] +Right keys [1]: [ca_address_sk#24] Join condition: None (29) Project [codegen id : 6] @@ -261,7 +261,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (44) BroadcastHashJoin [codegen id : 11] Left keys [1]: [ctr_customer_sk#16] -Right keys [1]: [cast(c_customer_sk#39 as bigint)] +Right keys [1]: [c_customer_sk#39] Join condition: None (45) Project [codegen id : 11] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt index 3f30183af3a94..593d1ecf287e1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt @@ -143,18 +143,18 @@ Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_so (12) Exchange Input [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] -Arguments: hashpartitioning(cast(ws_order_number#2 as bigint), cast(ws_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#12] +Arguments: hashpartitioning(ws_order_number#2, ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#12] (13) Sort [codegen id : 3] Input [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] -Arguments: [cast(ws_order_number#2 as bigint) ASC NULLS FIRST, cast(ws_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_order_number#2 ASC NULLS FIRST, ws_item_sk#1 ASC NULLS FIRST], false, 0 (14) Scan parquet default.web_returns Output [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_return_amt), GreaterThan(wr_return_amt,10000.00), IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (15) ColumnarToRow [codegen id : 4] Input [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] @@ -176,7 +176,7 @@ Input [4]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_ Arguments: [wr_order_number#14 ASC NULLS FIRST, wr_item_sk#13 ASC NULLS FIRST], false, 0 (20) SortMergeJoin [codegen id : 6] -Left keys [2]: [cast(ws_order_number#2 as bigint), cast(ws_item_sk#1 as bigint)] +Left keys [2]: [ws_order_number#2, ws_item_sk#1] Right keys [2]: [wr_order_number#14, wr_item_sk#13] Join condition: None @@ -383,18 +383,18 @@ Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, (66) Exchange Input [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] -Arguments: hashpartitioning(cast(ss_ticket_number#82 as bigint), cast(ss_item_sk#81 as bigint), 5), ENSURE_REQUIREMENTS, [id=#88] +Arguments: hashpartitioning(ss_ticket_number#82, ss_item_sk#81, 5), ENSURE_REQUIREMENTS, [id=#88] (67) Sort [codegen id : 23] Input [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] -Arguments: [cast(ss_ticket_number#82 as bigint) ASC NULLS FIRST, cast(ss_item_sk#81 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#82 ASC NULLS FIRST, ss_item_sk#81 ASC NULLS FIRST], false, 0 (68) Scan parquet default.store_returns Output [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_return_amt), GreaterThan(sr_return_amt,10000.00), IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (69) ColumnarToRow [codegen id : 24] Input [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] @@ -416,7 +416,7 @@ Input [4]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return Arguments: [sr_ticket_number#90 ASC NULLS FIRST, sr_item_sk#89 ASC NULLS FIRST], false, 0 (74) SortMergeJoin [codegen id : 26] -Left keys [2]: [cast(ss_ticket_number#82 as bigint), cast(ss_item_sk#81 as bigint)] +Left keys [2]: [ss_ticket_number#82, ss_item_sk#81] Right keys [2]: [sr_ticket_number#90, sr_item_sk#89] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt index a98f59f84be7d..f5411b5681aad 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt @@ -103,14 +103,14 @@ Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_ne (5) BroadcastExchange Input [5]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint), cast(input[0, int, true] as bigint)),false), [id=#8] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#8] (6) Scan parquet default.web_returns Output [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_return_amt), GreaterThan(wr_return_amt,10000.00), IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] @@ -124,7 +124,7 @@ Output [4]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_ Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] (10) BroadcastHashJoin [codegen id : 3] -Left keys [2]: [cast(ws_order_number#2 as bigint), cast(ws_item_sk#1 as bigint)] +Left keys [2]: [ws_order_number#2, ws_item_sk#1] Right keys [2]: [wr_order_number#10, wr_item_sk#9] Join condition: None @@ -338,14 +338,14 @@ Input [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, (57) BroadcastExchange Input [5]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint), cast(input[0, int, true] as bigint)),false), [id=#85] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#85] (58) Scan parquet default.store_returns Output [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_return_amt), GreaterThan(sr_return_amt,10000.00), IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (59) ColumnarToRow Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] @@ -359,7 +359,7 @@ Output [4]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_retur Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] (62) BroadcastHashJoin [codegen id : 17] -Left keys [2]: [cast(ss_ticket_number#80 as bigint), cast(ss_item_sk#79 as bigint)] +Left keys [2]: [ss_ticket_number#80, ss_item_sk#79] Right keys [2]: [sr_ticket_number#87, sr_item_sk#86] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt index c9a772d3163ca..ec4a566d0e4c4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt @@ -86,7 +86,8 @@ TakeOrderedAndProject (81) Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cast(ss_sold_date_sk#4 as bigint)), dynamicpruningexpression(cast(ss_sold_date_sk#4 as bigint) IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] ReadSchema: struct (2) ColumnarToRow [codegen id : 1] @@ -94,10 +95,10 @@ Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_s (3) Filter [codegen id : 1] Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] -Condition : isnotnull(cast(ss_store_sk#1 as bigint)) +Condition : isnotnull(ss_store_sk#1) (4) Project [codegen id : 1] -Output [6]: [cast(ss_store_sk#1 as bigint) AS store_sk#6, cast(ss_sold_date_sk#4 as bigint) AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] +Output [6]: [ss_store_sk#1 AS store_sk#6, ss_sold_date_sk#4 AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] (5) Scan parquet default.store_returns @@ -106,7 +107,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#15), dynamicpruningexpression(sr_returned_date_sk#15 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (6) ColumnarToRow [codegen id : 2] Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] @@ -141,7 +142,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (14) BroadcastHashJoin [codegen id : 5] Left keys [1]: [store_sk#6] -Right keys [1]: [cast(s_store_sk#22 as bigint)] +Right keys [1]: [s_store_sk#22] Join condition: None (15) Project [codegen id : 5] @@ -172,7 +173,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (21) BroadcastHashJoin [codegen id : 5] Left keys [1]: [date_sk#7] -Right keys [1]: [cast(d_date_sk#25 as bigint)] +Right keys [1]: [d_date_sk#25] Join condition: None (22) Project [codegen id : 5] @@ -201,7 +202,7 @@ Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#8))#37,17,2) AS sales#41 Output [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#50)] +PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#5)] PushedFilters: [IsNotNull(cs_catalog_page_sk)] ReadSchema: struct @@ -213,249 +214,249 @@ Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_s Condition : isnotnull(cs_catalog_page_sk#46) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#46 AS page_sk#51, cs_sold_date_sk#49 AS date_sk#52, cs_ext_sales_price#47 AS sales_price#53, cs_net_profit#48 AS profit#54, 0.00 AS return_amt#55, 0.00 AS net_loss#56] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#50, cs_sold_date_sk#49 AS date_sk#51, cs_ext_sales_price#47 AS sales_price#52, cs_net_profit#48 AS profit#53, 0.00 AS return_amt#54, 0.00 AS net_loss#55] Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] (30) Scan parquet default.catalog_returns -Output [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Output [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cr_returned_date_sk#60), dynamicpruningexpression(cr_returned_date_sk#60 IN dynamicpruning#50)] +PartitionFilters: [isnotnull(cr_returned_date_sk#59), dynamicpruningexpression(cr_returned_date_sk#59 IN dynamicpruning#5)] PushedFilters: [IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] (32) Filter [codegen id : 8] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] -Condition : isnotnull(cr_catalog_page_sk#57) +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : isnotnull(cr_catalog_page_sk#56) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#57 AS page_sk#61, cr_returned_date_sk#60 AS date_sk#62, 0.00 AS sales_price#63, 0.00 AS profit#64, cr_return_amount#58 AS return_amt#65, cr_net_loss#59 AS net_loss#66] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#60, cr_returned_date_sk#59 AS date_sk#61, 0.00 AS sales_price#62, 0.00 AS profit#63, cr_return_amount#57 AS return_amt#64, cr_net_loss#58 AS net_loss#65] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] (34) Union (35) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Output [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (36) ColumnarToRow [codegen id : 9] -Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] (37) Filter [codegen id : 9] -Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] -Condition : isnotnull(cp_catalog_page_sk#67) +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Condition : isnotnull(cp_catalog_page_sk#66) (38) BroadcastExchange -Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#68] (39) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#51] -Right keys [1]: [cp_catalog_page_sk#67] +Left keys [1]: [page_sk#50] +Right keys [1]: [cp_catalog_page_sk#66] Join condition: None (40) Project [codegen id : 11] -Output [6]: [date_sk#52, sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#68] -Input [8]: [page_sk#51, date_sk#52, sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_sk#67, cp_catalog_page_id#68] +Output [6]: [date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Input [8]: [page_sk#50, date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_sk#66, cp_catalog_page_id#67] (41) ReusedExchange [Reuses operator id: 20] -Output [1]: [d_date_sk#70] +Output [1]: [d_date_sk#69] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#52] -Right keys [1]: [d_date_sk#70] +Left keys [1]: [date_sk#51] +Right keys [1]: [d_date_sk#69] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#68] -Input [7]: [date_sk#52, sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#68, d_date_sk#70] +Output [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Input [7]: [date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67, d_date_sk#69] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#68] -Keys [1]: [cp_catalog_page_id#68] -Functions [4]: [partial_sum(UnscaledValue(sales_price#53)), partial_sum(UnscaledValue(return_amt#55)), partial_sum(UnscaledValue(profit#54)), partial_sum(UnscaledValue(net_loss#56))] -Aggregate Attributes [4]: [sum#71, sum#72, sum#73, sum#74] -Results [5]: [cp_catalog_page_id#68, sum#75, sum#76, sum#77, sum#78] +Input [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Keys [1]: [cp_catalog_page_id#67] +Functions [4]: [partial_sum(UnscaledValue(sales_price#52)), partial_sum(UnscaledValue(return_amt#54)), partial_sum(UnscaledValue(profit#53)), partial_sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum#70, sum#71, sum#72, sum#73] +Results [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] (45) Exchange -Input [5]: [cp_catalog_page_id#68, sum#75, sum#76, sum#77, sum#78] -Arguments: hashpartitioning(cp_catalog_page_id#68, 5), ENSURE_REQUIREMENTS, [id=#79] +Input [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] +Arguments: hashpartitioning(cp_catalog_page_id#67, 5), ENSURE_REQUIREMENTS, [id=#78] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#68, sum#75, sum#76, sum#77, sum#78] -Keys [1]: [cp_catalog_page_id#68] -Functions [4]: [sum(UnscaledValue(sales_price#53)), sum(UnscaledValue(return_amt#55)), sum(UnscaledValue(profit#54)), sum(UnscaledValue(net_loss#56))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#53))#80, sum(UnscaledValue(return_amt#55))#81, sum(UnscaledValue(profit#54))#82, sum(UnscaledValue(net_loss#56))#83] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#53))#80,17,2) AS sales#84, MakeDecimal(sum(UnscaledValue(return_amt#55))#81,17,2) AS RETURNS#85, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#54))#82,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#56))#83,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#86, catalog channel AS channel#87, concat(catalog_page, cp_catalog_page_id#68) AS id#88] +Input [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] +Keys [1]: [cp_catalog_page_id#67] +Functions [4]: [sum(UnscaledValue(sales_price#52)), sum(UnscaledValue(return_amt#54)), sum(UnscaledValue(profit#53)), sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#52))#79, sum(UnscaledValue(return_amt#54))#80, sum(UnscaledValue(profit#53))#81, sum(UnscaledValue(net_loss#55))#82] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#52))#79,17,2) AS sales#83, MakeDecimal(sum(UnscaledValue(return_amt#54))#80,17,2) AS RETURNS#84, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#53))#81,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#55))#82,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#85, catalog channel AS channel#86, concat(catalog_page, cp_catalog_page_id#67) AS id#87] (47) Scan parquet default.web_sales -Output [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Output [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cast(ws_sold_date_sk#92 as bigint)), dynamicpruningexpression(cast(ws_sold_date_sk#92 as bigint) IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ws_sold_date_sk#91), dynamicpruningexpression(ws_sold_date_sk#91 IN dynamicpruning#5)] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] (49) Filter [codegen id : 13] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Condition : isnotnull(ws_web_site_sk#89) +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Condition : isnotnull(ws_web_site_sk#88) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#89 AS wsr_web_site_sk#93, cast(ws_sold_date_sk#92 as bigint) AS date_sk#94, ws_ext_sales_price#90 AS sales_price#95, ws_net_profit#91 AS profit#96, 0.00 AS return_amt#97, 0.00 AS net_loss#98] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Output [6]: [ws_web_site_sk#88 AS wsr_web_site_sk#92, ws_sold_date_sk#91 AS date_sk#93, ws_ext_sales_price#89 AS sales_price#94, ws_net_profit#90 AS profit#95, 0.00 AS return_amt#96, 0.00 AS net_loss#97] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] (51) Scan parquet default.web_returns -Output [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] +Output [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#103), dynamicpruningexpression(wr_returned_date_sk#103 IN dynamicpruning#5)] -ReadSchema: struct +PartitionFilters: [isnotnull(wr_returned_date_sk#102), dynamicpruningexpression(wr_returned_date_sk#102 IN dynamicpruning#5)] +ReadSchema: struct (52) ColumnarToRow [codegen id : 14] -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] (53) Exchange -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] -Arguments: hashpartitioning(wr_item_sk#99, wr_order_number#100, 5), ENSURE_REQUIREMENTS, [id=#104] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: hashpartitioning(wr_item_sk#98, wr_order_number#99, 5), ENSURE_REQUIREMENTS, [id=#103] (54) Sort [codegen id : 15] -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] -Arguments: [wr_item_sk#99 ASC NULLS FIRST, wr_order_number#100 ASC NULLS FIRST], false, 0 +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: [wr_item_sk#98 ASC NULLS FIRST, wr_order_number#99 ASC NULLS FIRST], false, 0 (55) Scan parquet default.web_sales -Output [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Output [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (56) ColumnarToRow [codegen id : 16] -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] (57) Filter [codegen id : 16] -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] -Condition : ((isnotnull(ws_item_sk#105) AND isnotnull(ws_order_number#107)) AND isnotnull(ws_web_site_sk#106)) +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Condition : ((isnotnull(ws_item_sk#104) AND isnotnull(ws_order_number#106)) AND isnotnull(ws_web_site_sk#105)) (58) Project [codegen id : 16] -Output [3]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Output [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] (59) Exchange -Input [3]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] -Arguments: hashpartitioning(cast(ws_item_sk#105 as bigint), cast(ws_order_number#107 as bigint), 5), ENSURE_REQUIREMENTS, [id=#109] +Input [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Arguments: hashpartitioning(ws_item_sk#104, ws_order_number#106, 5), ENSURE_REQUIREMENTS, [id=#108] (60) Sort [codegen id : 17] -Input [3]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] -Arguments: [cast(ws_item_sk#105 as bigint) ASC NULLS FIRST, cast(ws_order_number#107 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Arguments: [ws_item_sk#104 ASC NULLS FIRST, ws_order_number#106 ASC NULLS FIRST], false, 0 (61) SortMergeJoin [codegen id : 18] -Left keys [2]: [wr_item_sk#99, wr_order_number#100] -Right keys [2]: [cast(ws_item_sk#105 as bigint), cast(ws_order_number#107 as bigint)] +Left keys [2]: [wr_item_sk#98, wr_order_number#99] +Right keys [2]: [ws_item_sk#104, ws_order_number#106] Join condition: None (62) Project [codegen id : 18] -Output [6]: [ws_web_site_sk#106 AS wsr_web_site_sk#110, wr_returned_date_sk#103 AS date_sk#111, 0.00 AS sales_price#112, 0.00 AS profit#113, wr_return_amt#101 AS return_amt#114, wr_net_loss#102 AS net_loss#115] -Input [8]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103, ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] +Output [6]: [ws_web_site_sk#105 AS wsr_web_site_sk#109, wr_returned_date_sk#102 AS date_sk#110, 0.00 AS sales_price#111, 0.00 AS profit#112, wr_return_amt#100 AS return_amt#113, wr_net_loss#101 AS net_loss#114] +Input [8]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102, ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] (63) Union (64) Scan parquet default.web_site -Output [2]: [web_site_sk#116, web_site_id#117] +Output [2]: [web_site_sk#115, web_site_id#116] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (65) ColumnarToRow [codegen id : 19] -Input [2]: [web_site_sk#116, web_site_id#117] +Input [2]: [web_site_sk#115, web_site_id#116] (66) Filter [codegen id : 19] -Input [2]: [web_site_sk#116, web_site_id#117] -Condition : isnotnull(web_site_sk#116) +Input [2]: [web_site_sk#115, web_site_id#116] +Condition : isnotnull(web_site_sk#115) (67) BroadcastExchange -Input [2]: [web_site_sk#116, web_site_id#117] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#118] +Input [2]: [web_site_sk#115, web_site_id#116] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#117] (68) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [wsr_web_site_sk#93] -Right keys [1]: [web_site_sk#116] +Left keys [1]: [wsr_web_site_sk#92] +Right keys [1]: [web_site_sk#115] Join condition: None (69) Project [codegen id : 21] -Output [6]: [date_sk#94, sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Input [8]: [wsr_web_site_sk#93, date_sk#94, sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_sk#116, web_site_id#117] +Output [6]: [date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [8]: [wsr_web_site_sk#92, date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_sk#115, web_site_id#116] (70) ReusedExchange [Reuses operator id: 20] -Output [1]: [d_date_sk#119] +Output [1]: [d_date_sk#118] (71) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [date_sk#94] -Right keys [1]: [cast(d_date_sk#119 as bigint)] +Left keys [1]: [date_sk#93] +Right keys [1]: [d_date_sk#118] Join condition: None (72) Project [codegen id : 21] -Output [5]: [sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Input [7]: [date_sk#94, sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117, d_date_sk#119] +Output [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [7]: [date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116, d_date_sk#118] (73) HashAggregate [codegen id : 21] -Input [5]: [sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Keys [1]: [web_site_id#117] -Functions [4]: [partial_sum(UnscaledValue(sales_price#95)), partial_sum(UnscaledValue(return_amt#97)), partial_sum(UnscaledValue(profit#96)), partial_sum(UnscaledValue(net_loss#98))] -Aggregate Attributes [4]: [sum#120, sum#121, sum#122, sum#123] -Results [5]: [web_site_id#117, sum#124, sum#125, sum#126, sum#127] +Input [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Keys [1]: [web_site_id#116] +Functions [4]: [partial_sum(UnscaledValue(sales_price#94)), partial_sum(UnscaledValue(return_amt#96)), partial_sum(UnscaledValue(profit#95)), partial_sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum#119, sum#120, sum#121, sum#122] +Results [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] (74) Exchange -Input [5]: [web_site_id#117, sum#124, sum#125, sum#126, sum#127] -Arguments: hashpartitioning(web_site_id#117, 5), ENSURE_REQUIREMENTS, [id=#128] +Input [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] +Arguments: hashpartitioning(web_site_id#116, 5), ENSURE_REQUIREMENTS, [id=#127] (75) HashAggregate [codegen id : 22] -Input [5]: [web_site_id#117, sum#124, sum#125, sum#126, sum#127] -Keys [1]: [web_site_id#117] -Functions [4]: [sum(UnscaledValue(sales_price#95)), sum(UnscaledValue(return_amt#97)), sum(UnscaledValue(profit#96)), sum(UnscaledValue(net_loss#98))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#95))#129, sum(UnscaledValue(return_amt#97))#130, sum(UnscaledValue(profit#96))#131, sum(UnscaledValue(net_loss#98))#132] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#95))#129,17,2) AS sales#133, MakeDecimal(sum(UnscaledValue(return_amt#97))#130,17,2) AS RETURNS#134, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#96))#131,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#98))#132,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#135, web channel AS channel#136, concat(web_site, web_site_id#117) AS id#137] +Input [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] +Keys [1]: [web_site_id#116] +Functions [4]: [sum(UnscaledValue(sales_price#94)), sum(UnscaledValue(return_amt#96)), sum(UnscaledValue(profit#95)), sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#94))#128, sum(UnscaledValue(return_amt#96))#129, sum(UnscaledValue(profit#95))#130, sum(UnscaledValue(net_loss#97))#131] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#94))#128,17,2) AS sales#132, MakeDecimal(sum(UnscaledValue(return_amt#96))#129,17,2) AS RETURNS#133, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#95))#130,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#97))#131,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#134, web channel AS channel#135, concat(web_site, web_site_id#116) AS id#136] (76) Union (77) Expand [codegen id : 23] Input [5]: [sales#41, RETURNS#42, profit#43, channel#44, id#45] -Arguments: [ArrayBuffer(sales#41, returns#42, profit#43, channel#44, id#45, 0), ArrayBuffer(sales#41, returns#42, profit#43, channel#44, null, 1), ArrayBuffer(sales#41, returns#42, profit#43, null, null, 3)], [sales#41, returns#42, profit#43, channel#138, id#139, spark_grouping_id#140] +Arguments: [ArrayBuffer(sales#41, returns#42, profit#43, channel#44, id#45, 0), ArrayBuffer(sales#41, returns#42, profit#43, channel#44, null, 1), ArrayBuffer(sales#41, returns#42, profit#43, null, null, 3)], [sales#41, returns#42, profit#43, channel#137, id#138, spark_grouping_id#139] (78) HashAggregate [codegen id : 23] -Input [6]: [sales#41, returns#42, profit#43, channel#138, id#139, spark_grouping_id#140] -Keys [3]: [channel#138, id#139, spark_grouping_id#140] +Input [6]: [sales#41, returns#42, profit#43, channel#137, id#138, spark_grouping_id#139] +Keys [3]: [channel#137, id#138, spark_grouping_id#139] Functions [3]: [partial_sum(sales#41), partial_sum(returns#42), partial_sum(profit#43)] -Aggregate Attributes [6]: [sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] -Results [9]: [channel#138, id#139, spark_grouping_id#140, sum#147, isEmpty#148, sum#149, isEmpty#150, sum#151, isEmpty#152] +Aggregate Attributes [6]: [sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] +Results [9]: [channel#137, id#138, spark_grouping_id#139, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] (79) Exchange -Input [9]: [channel#138, id#139, spark_grouping_id#140, sum#147, isEmpty#148, sum#149, isEmpty#150, sum#151, isEmpty#152] -Arguments: hashpartitioning(channel#138, id#139, spark_grouping_id#140, 5), ENSURE_REQUIREMENTS, [id=#153] +Input [9]: [channel#137, id#138, spark_grouping_id#139, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] +Arguments: hashpartitioning(channel#137, id#138, spark_grouping_id#139, 5), ENSURE_REQUIREMENTS, [id=#152] (80) HashAggregate [codegen id : 24] -Input [9]: [channel#138, id#139, spark_grouping_id#140, sum#147, isEmpty#148, sum#149, isEmpty#150, sum#151, isEmpty#152] -Keys [3]: [channel#138, id#139, spark_grouping_id#140] +Input [9]: [channel#137, id#138, spark_grouping_id#139, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] +Keys [3]: [channel#137, id#138, spark_grouping_id#139] Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] -Aggregate Attributes [3]: [sum(sales#41)#154, sum(returns#42)#155, sum(profit#43)#156] -Results [5]: [channel#138, id#139, sum(sales#41)#154 AS sales#157, sum(returns#42)#155 AS returns#158, sum(profit#43)#156 AS profit#159] +Aggregate Attributes [3]: [sum(sales#41)#153, sum(returns#42)#154, sum(profit#43)#155] +Results [5]: [channel#137, id#138, sum(sales#41)#153 AS sales#156, sum(returns#42)#154 AS returns#157, sum(profit#43)#155 AS profit#158] (81) TakeOrderedAndProject -Input [5]: [channel#138, id#139, sales#157, returns#158, profit#159] -Arguments: 100, [channel#138 ASC NULLS FIRST, id#139 ASC NULLS FIRST], [channel#138, id#139, sales#157, returns#158, profit#159] +Input [5]: [channel#137, id#138, sales#156, returns#157, profit#158] +Arguments: 100, [channel#137 ASC NULLS FIRST, id#138 ASC NULLS FIRST], [channel#137, id#138, sales#156, returns#157, profit#158] ===== Subqueries ===== -Subquery:1 Hosting operator id = 1 Hosting Expression = cast(ss_sold_date_sk#4 as bigint) IN dynamicpruning#5 +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 ReusedExchange (82) @@ -464,17 +465,12 @@ Output [1]: [d_date_sk#25] Subquery:2 Hosting operator id = 5 Hosting Expression = sr_returned_date_sk#15 IN dynamicpruning#5 -Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#50 -ReusedExchange (83) +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#5 +Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#59 IN dynamicpruning#5 -(83) ReusedExchange [Reuses operator id: 20] -Output [1]: [d_date_sk#70] +Subquery:5 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#91 IN dynamicpruning#5 -Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#60 IN dynamicpruning#50 - -Subquery:5 Hosting operator id = 47 Hosting Expression = cast(ws_sold_date_sk#92 as bigint) IN dynamicpruning#5 - -Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#103 IN dynamicpruning#5 +Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#102 IN dynamicpruning#5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt index 6239f80c2d62d..2b62a0f686b43 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt @@ -68,15 +68,14 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] - SubqueryBroadcast [d_date_sk] #2 - ReusedExchange [d_date_sk] #3 + ReusedSubquery [d_date_sk] #1 WholeStageCodegen (8) Project [cr_catalog_page_sk,cr_returned_date_sk,cr_return_amount,cr_net_loss] Filter [cr_catalog_page_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_catalog_page_sk,cr_return_amount,cr_net_loss,cr_returned_date_sk] - ReusedSubquery [d_date_sk] #2 + ReusedSubquery [d_date_sk] #1 InputAdapter BroadcastExchange #6 WholeStageCodegen (9) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt index c01302bf69a40..7c0804a51c860 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt @@ -83,7 +83,8 @@ TakeOrderedAndProject (78) Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cast(ss_sold_date_sk#4 as bigint)), dynamicpruningexpression(cast(ss_sold_date_sk#4 as bigint) IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] ReadSchema: struct (2) ColumnarToRow [codegen id : 1] @@ -91,10 +92,10 @@ Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_s (3) Filter [codegen id : 1] Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] -Condition : isnotnull(cast(ss_store_sk#1 as bigint)) +Condition : isnotnull(ss_store_sk#1) (4) Project [codegen id : 1] -Output [6]: [cast(ss_store_sk#1 as bigint) AS store_sk#6, cast(ss_sold_date_sk#4 as bigint) AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] +Output [6]: [ss_store_sk#1 AS store_sk#6, ss_sold_date_sk#4 AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] (5) Scan parquet default.store_returns @@ -103,7 +104,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#15), dynamicpruningexpression(sr_returned_date_sk#15 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (6) ColumnarToRow [codegen id : 2] Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] @@ -142,7 +143,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (15) BroadcastHashJoin [codegen id : 5] Left keys [1]: [date_sk#7] -Right keys [1]: [cast(d_date_sk#22 as bigint)] +Right keys [1]: [d_date_sk#22] Join condition: None (16) Project [codegen id : 5] @@ -169,7 +170,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (21) BroadcastHashJoin [codegen id : 5] Left keys [1]: [store_sk#6] -Right keys [1]: [cast(s_store_sk#25 as bigint)] +Right keys [1]: [s_store_sk#25] Join condition: None (22) Project [codegen id : 5] @@ -198,7 +199,7 @@ Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#8))#37,17,2) AS sales#41 Output [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#50)] +PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#5)] PushedFilters: [IsNotNull(cs_catalog_page_sk)] ReadSchema: struct @@ -210,237 +211,237 @@ Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_s Condition : isnotnull(cs_catalog_page_sk#46) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#46 AS page_sk#51, cs_sold_date_sk#49 AS date_sk#52, cs_ext_sales_price#47 AS sales_price#53, cs_net_profit#48 AS profit#54, 0.00 AS return_amt#55, 0.00 AS net_loss#56] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#50, cs_sold_date_sk#49 AS date_sk#51, cs_ext_sales_price#47 AS sales_price#52, cs_net_profit#48 AS profit#53, 0.00 AS return_amt#54, 0.00 AS net_loss#55] Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] (30) Scan parquet default.catalog_returns -Output [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Output [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cr_returned_date_sk#60), dynamicpruningexpression(cr_returned_date_sk#60 IN dynamicpruning#50)] +PartitionFilters: [isnotnull(cr_returned_date_sk#59), dynamicpruningexpression(cr_returned_date_sk#59 IN dynamicpruning#5)] PushedFilters: [IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] (32) Filter [codegen id : 8] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] -Condition : isnotnull(cr_catalog_page_sk#57) +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : isnotnull(cr_catalog_page_sk#56) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#57 AS page_sk#61, cr_returned_date_sk#60 AS date_sk#62, 0.00 AS sales_price#63, 0.00 AS profit#64, cr_return_amount#58 AS return_amt#65, cr_net_loss#59 AS net_loss#66] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#60, cr_returned_date_sk#59 AS date_sk#61, 0.00 AS sales_price#62, 0.00 AS profit#63, cr_return_amount#57 AS return_amt#64, cr_net_loss#58 AS net_loss#65] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] (34) Union (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#67] +Output [1]: [d_date_sk#66] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#52] -Right keys [1]: [d_date_sk#67] +Left keys [1]: [date_sk#51] +Right keys [1]: [d_date_sk#66] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#51, sales_price#53, profit#54, return_amt#55, net_loss#56] -Input [7]: [page_sk#51, date_sk#52, sales_price#53, profit#54, return_amt#55, net_loss#56, d_date_sk#67] +Output [5]: [page_sk#50, sales_price#52, profit#53, return_amt#54, net_loss#55] +Input [7]: [page_sk#50, date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, d_date_sk#66] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#68, cp_catalog_page_id#69] +Output [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#68, cp_catalog_page_id#69] +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#68, cp_catalog_page_id#69] -Condition : isnotnull(cp_catalog_page_sk#68) +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Condition : isnotnull(cp_catalog_page_sk#67) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#68, cp_catalog_page_id#69] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#70] +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#51] -Right keys [1]: [cp_catalog_page_sk#68] +Left keys [1]: [page_sk#50] +Right keys [1]: [cp_catalog_page_sk#67] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#69] -Input [7]: [page_sk#51, sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_sk#68, cp_catalog_page_id#69] +Output [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#68] +Input [7]: [page_sk#50, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_sk#67, cp_catalog_page_id#68] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#69] -Keys [1]: [cp_catalog_page_id#69] -Functions [4]: [partial_sum(UnscaledValue(sales_price#53)), partial_sum(UnscaledValue(return_amt#55)), partial_sum(UnscaledValue(profit#54)), partial_sum(UnscaledValue(net_loss#56))] -Aggregate Attributes [4]: [sum#71, sum#72, sum#73, sum#74] -Results [5]: [cp_catalog_page_id#69, sum#75, sum#76, sum#77, sum#78] +Input [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#68] +Keys [1]: [cp_catalog_page_id#68] +Functions [4]: [partial_sum(UnscaledValue(sales_price#52)), partial_sum(UnscaledValue(return_amt#54)), partial_sum(UnscaledValue(profit#53)), partial_sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum#70, sum#71, sum#72, sum#73] +Results [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] (45) Exchange -Input [5]: [cp_catalog_page_id#69, sum#75, sum#76, sum#77, sum#78] -Arguments: hashpartitioning(cp_catalog_page_id#69, 5), ENSURE_REQUIREMENTS, [id=#79] +Input [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] +Arguments: hashpartitioning(cp_catalog_page_id#68, 5), ENSURE_REQUIREMENTS, [id=#78] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#69, sum#75, sum#76, sum#77, sum#78] -Keys [1]: [cp_catalog_page_id#69] -Functions [4]: [sum(UnscaledValue(sales_price#53)), sum(UnscaledValue(return_amt#55)), sum(UnscaledValue(profit#54)), sum(UnscaledValue(net_loss#56))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#53))#80, sum(UnscaledValue(return_amt#55))#81, sum(UnscaledValue(profit#54))#82, sum(UnscaledValue(net_loss#56))#83] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#53))#80,17,2) AS sales#84, MakeDecimal(sum(UnscaledValue(return_amt#55))#81,17,2) AS RETURNS#85, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#54))#82,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#56))#83,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#86, catalog channel AS channel#87, concat(catalog_page, cp_catalog_page_id#69) AS id#88] +Input [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] +Keys [1]: [cp_catalog_page_id#68] +Functions [4]: [sum(UnscaledValue(sales_price#52)), sum(UnscaledValue(return_amt#54)), sum(UnscaledValue(profit#53)), sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#52))#79, sum(UnscaledValue(return_amt#54))#80, sum(UnscaledValue(profit#53))#81, sum(UnscaledValue(net_loss#55))#82] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#52))#79,17,2) AS sales#83, MakeDecimal(sum(UnscaledValue(return_amt#54))#80,17,2) AS RETURNS#84, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#53))#81,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#55))#82,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#85, catalog channel AS channel#86, concat(catalog_page, cp_catalog_page_id#68) AS id#87] (47) Scan parquet default.web_sales -Output [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Output [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cast(ws_sold_date_sk#92 as bigint)), dynamicpruningexpression(cast(ws_sold_date_sk#92 as bigint) IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ws_sold_date_sk#91), dynamicpruningexpression(ws_sold_date_sk#91 IN dynamicpruning#5)] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] (49) Filter [codegen id : 13] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Condition : isnotnull(ws_web_site_sk#89) +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Condition : isnotnull(ws_web_site_sk#88) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#89 AS wsr_web_site_sk#93, cast(ws_sold_date_sk#92 as bigint) AS date_sk#94, ws_ext_sales_price#90 AS sales_price#95, ws_net_profit#91 AS profit#96, 0.00 AS return_amt#97, 0.00 AS net_loss#98] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Output [6]: [ws_web_site_sk#88 AS wsr_web_site_sk#92, ws_sold_date_sk#91 AS date_sk#93, ws_ext_sales_price#89 AS sales_price#94, ws_net_profit#90 AS profit#95, 0.00 AS return_amt#96, 0.00 AS net_loss#97] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] (51) Scan parquet default.web_returns -Output [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] +Output [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#103), dynamicpruningexpression(wr_returned_date_sk#103 IN dynamicpruning#5)] -ReadSchema: struct +PartitionFilters: [isnotnull(wr_returned_date_sk#102), dynamicpruningexpression(wr_returned_date_sk#102 IN dynamicpruning#5)] +ReadSchema: struct (52) ColumnarToRow [codegen id : 14] -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] (53) BroadcastExchange -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] -Arguments: HashedRelationBroadcastMode(List(input[0, bigint, true], input[1, bigint, true]),false), [id=#104] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[1, int, true] as bigint) & 4294967295))),false), [id=#103] (54) Scan parquet default.web_sales -Output [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Output [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (55) ColumnarToRow -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] (56) Filter -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] -Condition : ((isnotnull(ws_item_sk#105) AND isnotnull(ws_order_number#107)) AND isnotnull(ws_web_site_sk#106)) +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Condition : ((isnotnull(ws_item_sk#104) AND isnotnull(ws_order_number#106)) AND isnotnull(ws_web_site_sk#105)) (57) Project -Output [3]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Output [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] (58) BroadcastHashJoin [codegen id : 15] -Left keys [2]: [wr_item_sk#99, wr_order_number#100] -Right keys [2]: [cast(ws_item_sk#105 as bigint), cast(ws_order_number#107 as bigint)] +Left keys [2]: [wr_item_sk#98, wr_order_number#99] +Right keys [2]: [ws_item_sk#104, ws_order_number#106] Join condition: None (59) Project [codegen id : 15] -Output [6]: [ws_web_site_sk#106 AS wsr_web_site_sk#109, wr_returned_date_sk#103 AS date_sk#110, 0.00 AS sales_price#111, 0.00 AS profit#112, wr_return_amt#101 AS return_amt#113, wr_net_loss#102 AS net_loss#114] -Input [8]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103, ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] +Output [6]: [ws_web_site_sk#105 AS wsr_web_site_sk#108, wr_returned_date_sk#102 AS date_sk#109, 0.00 AS sales_price#110, 0.00 AS profit#111, wr_return_amt#100 AS return_amt#112, wr_net_loss#101 AS net_loss#113] +Input [8]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102, ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] (60) Union (61) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#115] +Output [1]: [d_date_sk#114] (62) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [date_sk#94] -Right keys [1]: [cast(d_date_sk#115 as bigint)] +Left keys [1]: [date_sk#93] +Right keys [1]: [d_date_sk#114] Join condition: None (63) Project [codegen id : 18] -Output [5]: [wsr_web_site_sk#93, sales_price#95, profit#96, return_amt#97, net_loss#98] -Input [7]: [wsr_web_site_sk#93, date_sk#94, sales_price#95, profit#96, return_amt#97, net_loss#98, d_date_sk#115] +Output [5]: [wsr_web_site_sk#92, sales_price#94, profit#95, return_amt#96, net_loss#97] +Input [7]: [wsr_web_site_sk#92, date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, d_date_sk#114] (64) Scan parquet default.web_site -Output [2]: [web_site_sk#116, web_site_id#117] +Output [2]: [web_site_sk#115, web_site_id#116] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (65) ColumnarToRow [codegen id : 17] -Input [2]: [web_site_sk#116, web_site_id#117] +Input [2]: [web_site_sk#115, web_site_id#116] (66) Filter [codegen id : 17] -Input [2]: [web_site_sk#116, web_site_id#117] -Condition : isnotnull(web_site_sk#116) +Input [2]: [web_site_sk#115, web_site_id#116] +Condition : isnotnull(web_site_sk#115) (67) BroadcastExchange -Input [2]: [web_site_sk#116, web_site_id#117] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#118] +Input [2]: [web_site_sk#115, web_site_id#116] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#117] (68) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [wsr_web_site_sk#93] -Right keys [1]: [web_site_sk#116] +Left keys [1]: [wsr_web_site_sk#92] +Right keys [1]: [web_site_sk#115] Join condition: None (69) Project [codegen id : 18] -Output [5]: [sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Input [7]: [wsr_web_site_sk#93, sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_sk#116, web_site_id#117] +Output [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [7]: [wsr_web_site_sk#92, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_sk#115, web_site_id#116] (70) HashAggregate [codegen id : 18] -Input [5]: [sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Keys [1]: [web_site_id#117] -Functions [4]: [partial_sum(UnscaledValue(sales_price#95)), partial_sum(UnscaledValue(return_amt#97)), partial_sum(UnscaledValue(profit#96)), partial_sum(UnscaledValue(net_loss#98))] -Aggregate Attributes [4]: [sum#119, sum#120, sum#121, sum#122] -Results [5]: [web_site_id#117, sum#123, sum#124, sum#125, sum#126] +Input [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Keys [1]: [web_site_id#116] +Functions [4]: [partial_sum(UnscaledValue(sales_price#94)), partial_sum(UnscaledValue(return_amt#96)), partial_sum(UnscaledValue(profit#95)), partial_sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum#118, sum#119, sum#120, sum#121] +Results [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] (71) Exchange -Input [5]: [web_site_id#117, sum#123, sum#124, sum#125, sum#126] -Arguments: hashpartitioning(web_site_id#117, 5), ENSURE_REQUIREMENTS, [id=#127] +Input [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] +Arguments: hashpartitioning(web_site_id#116, 5), ENSURE_REQUIREMENTS, [id=#126] (72) HashAggregate [codegen id : 19] -Input [5]: [web_site_id#117, sum#123, sum#124, sum#125, sum#126] -Keys [1]: [web_site_id#117] -Functions [4]: [sum(UnscaledValue(sales_price#95)), sum(UnscaledValue(return_amt#97)), sum(UnscaledValue(profit#96)), sum(UnscaledValue(net_loss#98))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#95))#128, sum(UnscaledValue(return_amt#97))#129, sum(UnscaledValue(profit#96))#130, sum(UnscaledValue(net_loss#98))#131] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#95))#128,17,2) AS sales#132, MakeDecimal(sum(UnscaledValue(return_amt#97))#129,17,2) AS RETURNS#133, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#96))#130,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#98))#131,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#134, web channel AS channel#135, concat(web_site, web_site_id#117) AS id#136] +Input [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] +Keys [1]: [web_site_id#116] +Functions [4]: [sum(UnscaledValue(sales_price#94)), sum(UnscaledValue(return_amt#96)), sum(UnscaledValue(profit#95)), sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#94))#127, sum(UnscaledValue(return_amt#96))#128, sum(UnscaledValue(profit#95))#129, sum(UnscaledValue(net_loss#97))#130] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#94))#127,17,2) AS sales#131, MakeDecimal(sum(UnscaledValue(return_amt#96))#128,17,2) AS RETURNS#132, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#95))#129,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#97))#130,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#133, web channel AS channel#134, concat(web_site, web_site_id#116) AS id#135] (73) Union (74) Expand [codegen id : 20] Input [5]: [sales#41, RETURNS#42, profit#43, channel#44, id#45] -Arguments: [ArrayBuffer(sales#41, returns#42, profit#43, channel#44, id#45, 0), ArrayBuffer(sales#41, returns#42, profit#43, channel#44, null, 1), ArrayBuffer(sales#41, returns#42, profit#43, null, null, 3)], [sales#41, returns#42, profit#43, channel#137, id#138, spark_grouping_id#139] +Arguments: [ArrayBuffer(sales#41, returns#42, profit#43, channel#44, id#45, 0), ArrayBuffer(sales#41, returns#42, profit#43, channel#44, null, 1), ArrayBuffer(sales#41, returns#42, profit#43, null, null, 3)], [sales#41, returns#42, profit#43, channel#136, id#137, spark_grouping_id#138] (75) HashAggregate [codegen id : 20] -Input [6]: [sales#41, returns#42, profit#43, channel#137, id#138, spark_grouping_id#139] -Keys [3]: [channel#137, id#138, spark_grouping_id#139] +Input [6]: [sales#41, returns#42, profit#43, channel#136, id#137, spark_grouping_id#138] +Keys [3]: [channel#136, id#137, spark_grouping_id#138] Functions [3]: [partial_sum(sales#41), partial_sum(returns#42), partial_sum(profit#43)] -Aggregate Attributes [6]: [sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] -Results [9]: [channel#137, id#138, spark_grouping_id#139, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] +Aggregate Attributes [6]: [sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Results [9]: [channel#136, id#137, spark_grouping_id#138, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] (76) Exchange -Input [9]: [channel#137, id#138, spark_grouping_id#139, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] -Arguments: hashpartitioning(channel#137, id#138, spark_grouping_id#139, 5), ENSURE_REQUIREMENTS, [id=#152] +Input [9]: [channel#136, id#137, spark_grouping_id#138, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] +Arguments: hashpartitioning(channel#136, id#137, spark_grouping_id#138, 5), ENSURE_REQUIREMENTS, [id=#151] (77) HashAggregate [codegen id : 21] -Input [9]: [channel#137, id#138, spark_grouping_id#139, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] -Keys [3]: [channel#137, id#138, spark_grouping_id#139] +Input [9]: [channel#136, id#137, spark_grouping_id#138, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] +Keys [3]: [channel#136, id#137, spark_grouping_id#138] Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] -Aggregate Attributes [3]: [sum(sales#41)#153, sum(returns#42)#154, sum(profit#43)#155] -Results [5]: [channel#137, id#138, sum(sales#41)#153 AS sales#156, sum(returns#42)#154 AS returns#157, sum(profit#43)#155 AS profit#158] +Aggregate Attributes [3]: [sum(sales#41)#152, sum(returns#42)#153, sum(profit#43)#154] +Results [5]: [channel#136, id#137, sum(sales#41)#152 AS sales#155, sum(returns#42)#153 AS returns#156, sum(profit#43)#154 AS profit#157] (78) TakeOrderedAndProject -Input [5]: [channel#137, id#138, sales#156, returns#157, profit#158] -Arguments: 100, [channel#137 ASC NULLS FIRST, id#138 ASC NULLS FIRST], [channel#137, id#138, sales#156, returns#157, profit#158] +Input [5]: [channel#136, id#137, sales#155, returns#156, profit#157] +Arguments: 100, [channel#136 ASC NULLS FIRST, id#137 ASC NULLS FIRST], [channel#136, id#137, sales#155, returns#156, profit#157] ===== Subqueries ===== -Subquery:1 Hosting operator id = 1 Hosting Expression = cast(ss_sold_date_sk#4 as bigint) IN dynamicpruning#5 +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 ReusedExchange (79) @@ -449,17 +450,12 @@ Output [1]: [d_date_sk#22] Subquery:2 Hosting operator id = 5 Hosting Expression = sr_returned_date_sk#15 IN dynamicpruning#5 -Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#50 -ReusedExchange (80) +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#5 +Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#59 IN dynamicpruning#5 -(80) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#67] +Subquery:5 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#91 IN dynamicpruning#5 -Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#60 IN dynamicpruning#50 - -Subquery:5 Hosting operator id = 47 Hosting Expression = cast(ws_sold_date_sk#92 as bigint) IN dynamicpruning#5 - -Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#103 IN dynamicpruning#5 +Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#102 IN dynamicpruning#5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt index 50dde50e729d1..99ad64a42ab28 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt @@ -68,15 +68,14 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] - SubqueryBroadcast [d_date_sk] #2 - ReusedExchange [d_date_sk] #3 + ReusedSubquery [d_date_sk] #1 WholeStageCodegen (8) Project [cr_catalog_page_sk,cr_returned_date_sk,cr_return_amount,cr_net_loss] Filter [cr_catalog_page_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_catalog_page_sk,cr_return_amount,cr_net_loss,cr_returned_date_sk] - ReusedSubquery [d_date_sk] #2 + ReusedSubquery [d_date_sk] #1 InputAdapter ReusedExchange [d_date_sk] #3 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt index a94c3f6044e6d..ccb95a316cb28 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt @@ -4,207 +4,207 @@ TakeOrderedAndProject (35) +- Exchange (33) +- * HashAggregate (32) +- * Project (31) - +- * SortMergeJoin Inner (30) - :- * Sort (17) - : +- Exchange (16) - : +- * Project (15) - : +- * BroadcastHashJoin Inner BuildRight (14) - : :- * Project (9) - : : +- * BroadcastHashJoin Inner BuildRight (8) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.date_dim (4) - : +- BroadcastExchange (13) - : +- * Filter (12) - : +- * ColumnarToRow (11) - : +- Scan parquet default.store (10) - +- * Sort (29) - +- Exchange (28) - +- * Project (27) - +- * BroadcastHashJoin Inner BuildRight (26) - :- * Filter (20) - : +- * ColumnarToRow (19) - : +- Scan parquet default.store_returns (18) - +- BroadcastExchange (25) - +- * Project (24) - +- * Filter (23) - +- * ColumnarToRow (22) - +- Scan parquet default.date_dim (21) - - -(1) Scan parquet default.store_sales -Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +- * BroadcastHashJoin Inner BuildRight (30) + :- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (19) + : : +- * SortMergeJoin Inner (18) + : : :- * Sort (12) + : : : +- Exchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_returns (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- * Sort (17) + : : +- Exchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.store_sales (13) + : +- BroadcastExchange (23) + : +- * Filter (22) + : +- * ColumnarToRow (21) + : +- Scan parquet default.date_dim (20) + +- BroadcastExchange (29) + +- * Filter (28) + +- * ColumnarToRow (27) + +- Scan parquet default.store (26) + + +(1) Scan parquet default.store_returns +Output [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ss_sold_date_sk#5)] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +PartitionFilters: [isnotnull(sr_returned_date_sk#4), dynamicpruningexpression(sr_returned_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk), IsNotNull(sr_customer_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 3] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +(2) ColumnarToRow [codegen id : 2] +Input [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] -(3) Filter [codegen id : 3] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] -Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_store_sk#3)) +(3) Filter [codegen id : 2] +Input [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] +Condition : ((isnotnull(sr_ticket_number#3) AND isnotnull(sr_item_sk#1)) AND isnotnull(sr_customer_sk#2)) (4) Scan parquet default.date_dim -Output [1]: [d_date_sk#6] +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date_sk)] -ReadSchema: struct +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,8), IsNotNull(d_date_sk)] +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] -Input [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] (6) Filter [codegen id : 1] -Input [1]: [d_date_sk#6] -Condition : isnotnull(d_date_sk#6) +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 2001)) AND (d_moy#8 = 8)) AND isnotnull(d_date_sk#6)) -(7) BroadcastExchange +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] -(8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#5] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [sr_returned_date_sk#4] Right keys [1]: [d_date_sk#6] Join condition: None -(9) Project [codegen id : 3] -Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] -Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#6] - -(10) Scan parquet default.store -Output [11]: [s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store] -PushedFilters: [IsNotNull(s_store_sk)] -ReadSchema: struct +(10) Project [codegen id : 2] +Output [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] +Input [5]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4, d_date_sk#6] -(11) ColumnarToRow [codegen id : 2] -Input [11]: [s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +(11) Exchange +Input [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] +Arguments: hashpartitioning(sr_ticket_number#3, sr_item_sk#1, sr_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#10] -(12) Filter [codegen id : 2] -Input [11]: [s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Condition : isnotnull(s_store_sk#8) +(12) Sort [codegen id : 3] +Input [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] +Arguments: [sr_ticket_number#3 ASC NULLS FIRST, sr_item_sk#1 ASC NULLS FIRST, sr_customer_sk#2 ASC NULLS FIRST], false, 0 -(13) BroadcastExchange -Input [11]: [s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] +(13) Scan parquet default.store_sales +Output [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#15)] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#3] -Right keys [1]: [s_store_sk#8] -Join condition: None +(14) ColumnarToRow [codegen id : 4] +Input [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] -(15) Project [codegen id : 3] -Output [14]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_sold_date_sk#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Input [16]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +(15) Filter [codegen id : 4] +Input [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] +Condition : (((isnotnull(ss_ticket_number#14) AND isnotnull(ss_item_sk#11)) AND isnotnull(ss_customer_sk#12)) AND isnotnull(ss_store_sk#13)) (16) Exchange -Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_sold_date_sk#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_customer_sk#2 as bigint), 5), ENSURE_REQUIREMENTS, [id=#20] - -(17) Sort [codegen id : 4] -Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_sold_date_sk#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_customer_sk#2 as bigint) ASC NULLS FIRST], false, 0 +Input [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] +Arguments: hashpartitioning(ss_ticket_number#14, ss_item_sk#11, ss_customer_sk#12, 5), ENSURE_REQUIREMENTS, [id=#16] -(18) Scan parquet default.store_returns -Output [4]: [sr_item_sk#21, sr_customer_sk#22, sr_ticket_number#23, sr_returned_date_sk#24] -Batched: true -Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(sr_returned_date_sk#24), dynamicpruningexpression(sr_returned_date_sk#24 IN dynamicpruning#25)] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk), IsNotNull(sr_customer_sk)] -ReadSchema: struct +(17) Sort [codegen id : 5] +Input [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] +Arguments: [ss_ticket_number#14 ASC NULLS FIRST, ss_item_sk#11 ASC NULLS FIRST, ss_customer_sk#12 ASC NULLS FIRST], false, 0 -(19) ColumnarToRow [codegen id : 6] -Input [4]: [sr_item_sk#21, sr_customer_sk#22, sr_ticket_number#23, sr_returned_date_sk#24] +(18) SortMergeJoin [codegen id : 8] +Left keys [3]: [sr_ticket_number#3, sr_item_sk#1, sr_customer_sk#2] +Right keys [3]: [ss_ticket_number#14, ss_item_sk#11, ss_customer_sk#12] +Join condition: None -(20) Filter [codegen id : 6] -Input [4]: [sr_item_sk#21, sr_customer_sk#22, sr_ticket_number#23, sr_returned_date_sk#24] -Condition : ((isnotnull(sr_ticket_number#23) AND isnotnull(sr_item_sk#21)) AND isnotnull(sr_customer_sk#22)) +(19) Project [codegen id : 8] +Output [3]: [sr_returned_date_sk#4, ss_store_sk#13, ss_sold_date_sk#15] +Input [9]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4, ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] -(21) Scan parquet default.date_dim -Output [3]: [d_date_sk#26, d_year#27, d_moy#28] +(20) Scan parquet default.date_dim +Output [1]: [d_date_sk#17] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,8), IsNotNull(d_date_sk)] -ReadSchema: struct - -(22) ColumnarToRow [codegen id : 5] -Input [3]: [d_date_sk#26, d_year#27, d_moy#28] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct -(23) Filter [codegen id : 5] -Input [3]: [d_date_sk#26, d_year#27, d_moy#28] -Condition : ((((isnotnull(d_year#27) AND isnotnull(d_moy#28)) AND (d_year#27 = 2001)) AND (d_moy#28 = 8)) AND isnotnull(d_date_sk#26)) +(21) ColumnarToRow [codegen id : 6] +Input [1]: [d_date_sk#17] -(24) Project [codegen id : 5] -Output [1]: [d_date_sk#26] -Input [3]: [d_date_sk#26, d_year#27, d_moy#28] +(22) Filter [codegen id : 6] +Input [1]: [d_date_sk#17] +Condition : isnotnull(d_date_sk#17) -(25) BroadcastExchange -Input [1]: [d_date_sk#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +(23) BroadcastExchange +Input [1]: [d_date_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] -(26) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sr_returned_date_sk#24] -Right keys [1]: [cast(d_date_sk#26 as bigint)] +(24) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_date_sk#15] +Right keys [1]: [d_date_sk#17] Join condition: None -(27) Project [codegen id : 6] -Output [4]: [sr_item_sk#21, sr_customer_sk#22, sr_ticket_number#23, sr_returned_date_sk#24] -Input [5]: [sr_item_sk#21, sr_customer_sk#22, sr_ticket_number#23, sr_returned_date_sk#24, d_date_sk#26] +(25) Project [codegen id : 8] +Output [3]: [sr_returned_date_sk#4, ss_store_sk#13, ss_sold_date_sk#15] +Input [4]: [sr_returned_date_sk#4, ss_store_sk#13, ss_sold_date_sk#15, d_date_sk#17] -(28) Exchange -Input [4]: [sr_item_sk#21, sr_customer_sk#22, sr_ticket_number#23, sr_returned_date_sk#24] -Arguments: hashpartitioning(sr_ticket_number#23, sr_item_sk#21, sr_customer_sk#22, 5), ENSURE_REQUIREMENTS, [id=#30] +(26) Scan parquet default.store +Output [11]: [s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 7] +Input [11]: [s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] -(29) Sort [codegen id : 7] -Input [4]: [sr_item_sk#21, sr_customer_sk#22, sr_ticket_number#23, sr_returned_date_sk#24] -Arguments: [sr_ticket_number#23 ASC NULLS FIRST, sr_item_sk#21 ASC NULLS FIRST, sr_customer_sk#22 ASC NULLS FIRST], false, 0 +(28) Filter [codegen id : 7] +Input [11]: [s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Condition : isnotnull(s_store_sk#19) -(30) SortMergeJoin [codegen id : 8] -Left keys [3]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_customer_sk#2 as bigint)] -Right keys [3]: [sr_ticket_number#23, sr_item_sk#21, sr_customer_sk#22] +(29) BroadcastExchange +Input [11]: [s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] + +(30) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#13] +Right keys [1]: [s_store_sk#19] Join condition: None (31) Project [codegen id : 8] -Output [12]: [ss_sold_date_sk#5, sr_returned_date_sk#24, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Input [18]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_sold_date_sk#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sr_item_sk#21, sr_customer_sk#22, sr_ticket_number#23, sr_returned_date_sk#24] +Output [12]: [ss_sold_date_sk#15, sr_returned_date_sk#4, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Input [14]: [sr_returned_date_sk#4, ss_store_sk#13, ss_sold_date_sk#15, s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] (32) HashAggregate [codegen id : 8] -Input [12]: [ss_sold_date_sk#5, sr_returned_date_sk#24, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Keys [10]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Functions [5]: [partial_sum(CASE WHEN ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 30) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 60) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 90) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 120) THEN 1 ELSE 0 END)] +Input [12]: [ss_sold_date_sk#15, sr_returned_date_sk#4, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Keys [10]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Functions [5]: [partial_sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 30) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 60) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 90) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 120) THEN 1 ELSE 0 END)] Aggregate Attributes [5]: [sum#31, sum#32, sum#33, sum#34, sum#35] -Results [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum#36, sum#37, sum#38, sum#39, sum#40] +Results [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, sum#36, sum#37, sum#38, sum#39, sum#40] (33) Exchange -Input [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum#36, sum#37, sum#38, sum#39, sum#40] -Arguments: hashpartitioning(s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, 5), ENSURE_REQUIREMENTS, [id=#41] +Input [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, sum#36, sum#37, sum#38, sum#39, sum#40] +Arguments: hashpartitioning(s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, 5), ENSURE_REQUIREMENTS, [id=#41] (34) HashAggregate [codegen id : 9] -Input [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum#36, sum#37, sum#38, sum#39, sum#40] -Keys [10]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Functions [5]: [sum(CASE WHEN ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 30) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 60) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 90) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 120) THEN 1 ELSE 0 END)] -Aggregate Attributes [5]: [sum(CASE WHEN ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 30) THEN 1 ELSE 0 END)#42, sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 30) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 60)) THEN 1 ELSE 0 END)#43, sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 60) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 90)) THEN 1 ELSE 0 END)#44, sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 90) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 120)) THEN 1 ELSE 0 END)#45, sum(CASE WHEN ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 120) THEN 1 ELSE 0 END)#46] -Results [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum(CASE WHEN ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 30) THEN 1 ELSE 0 END)#42 AS 30 days #47, sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 30) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 60)) THEN 1 ELSE 0 END)#43 AS 31 - 60 days #48, sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 60) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 90)) THEN 1 ELSE 0 END)#44 AS 61 - 90 days #49, sum(CASE WHEN (((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 90) AND ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) <= 120)) THEN 1 ELSE 0 END)#45 AS 91 - 120 days #50, sum(CASE WHEN ((sr_returned_date_sk#24 - cast(ss_sold_date_sk#5 as bigint)) > 120) THEN 1 ELSE 0 END)#46 AS >120 days #51] +Input [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, sum#36, sum#37, sum#38, sum#39, sum#40] +Keys [10]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Functions [5]: [sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 30) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 60) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 90) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 30) THEN 1 ELSE 0 END)#42, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 30) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 60)) THEN 1 ELSE 0 END)#43, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 60) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 90)) THEN 1 ELSE 0 END)#44, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 90) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 120)) THEN 1 ELSE 0 END)#45, sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 120) THEN 1 ELSE 0 END)#46] +Results [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 30) THEN 1 ELSE 0 END)#42 AS 30 days #47, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 30) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 60)) THEN 1 ELSE 0 END)#43 AS 31 - 60 days #48, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 60) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 90)) THEN 1 ELSE 0 END)#44 AS 61 - 90 days #49, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 90) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 120)) THEN 1 ELSE 0 END)#45 AS 91 - 120 days #50, sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 120) THEN 1 ELSE 0 END)#46 AS >120 days #51] (35) TakeOrderedAndProject -Input [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, 30 days #47, 31 - 60 days #48, 61 - 90 days #49, 91 - 120 days #50, >120 days #51] -Arguments: 100, [s_store_name#9 ASC NULLS FIRST, s_company_id#10 ASC NULLS FIRST, s_street_number#11 ASC NULLS FIRST, s_street_name#12 ASC NULLS FIRST, s_street_type#13 ASC NULLS FIRST, s_suite_number#14 ASC NULLS FIRST, s_city#15 ASC NULLS FIRST, s_county#16 ASC NULLS FIRST, s_state#17 ASC NULLS FIRST, s_zip#18 ASC NULLS FIRST], [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, 30 days #47, 31 - 60 days #48, 61 - 90 days #49, 91 - 120 days #50, >120 days #51] +Input [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, 30 days #47, 31 - 60 days #48, 61 - 90 days #49, 91 - 120 days #50, >120 days #51] +Arguments: 100, [s_store_name#20 ASC NULLS FIRST, s_company_id#21 ASC NULLS FIRST, s_street_number#22 ASC NULLS FIRST, s_street_name#23 ASC NULLS FIRST, s_street_type#24 ASC NULLS FIRST, s_suite_number#25 ASC NULLS FIRST, s_city#26 ASC NULLS FIRST, s_county#27 ASC NULLS FIRST, s_state#28 ASC NULLS FIRST, s_zip#29 ASC NULLS FIRST], [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, 30 days #47, 31 - 60 days #48, 61 - 90 days #49, 91 - 120 days #50, >120 days #51] ===== Subqueries ===== -Subquery:1 Hosting operator id = 18 Hosting Expression = sr_returned_date_sk#24 IN dynamicpruning#25 +Subquery:1 Hosting operator id = 1 Hosting Expression = sr_returned_date_sk#4 IN dynamicpruning#5 ReusedExchange (36) -(36) ReusedExchange [Reuses operator id: 25] -Output [1]: [d_date_sk#26] +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt index a77f51b586a0b..441e0963f478c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt @@ -1,59 +1,59 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ] WholeStageCodegen (9) - HashAggregate [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,sum,sum,sum,sum,sum] [sum(CASE WHEN ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) > 30) AND ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) > 60) AND ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) > 90) AND ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) > 120) THEN 1 ELSE 0 END),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] + HashAggregate [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,sum,sum,sum,sum,sum] [sum(CASE WHEN ((sr_returned_date_sk - ss_sold_date_sk) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 30) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 60) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 90) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((sr_returned_date_sk - ss_sold_date_sk) > 120) THEN 1 ELSE 0 END),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] InputAdapter Exchange [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] #1 WholeStageCodegen (8) HashAggregate [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,sr_returned_date_sk,ss_sold_date_sk] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] Project [ss_sold_date_sk,sr_returned_date_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] - SortMergeJoin [ss_ticket_number,ss_item_sk,ss_customer_sk,sr_ticket_number,sr_item_sk,sr_customer_sk] - InputAdapter - WholeStageCodegen (4) - Sort [ss_ticket_number,ss_item_sk,ss_customer_sk] - InputAdapter - Exchange [ss_ticket_number,ss_item_sk,ss_customer_sk] #2 + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [sr_returned_date_sk,ss_store_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [sr_returned_date_sk,ss_store_sk,ss_sold_date_sk] + SortMergeJoin [sr_ticket_number,sr_item_sk,sr_customer_sk,ss_ticket_number,ss_item_sk,ss_customer_sk] + InputAdapter WholeStageCodegen (3) - Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_sold_date_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] - BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Sort [sr_ticket_number,sr_item_sk,sr_customer_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk,sr_customer_sk] #2 + WholeStageCodegen (2) + Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_returned_date_sk] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_ticket_number,sr_item_sk,sr_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + WholeStageCodegen (5) + Sort [ss_ticket_number,ss_item_sk,ss_customer_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk,ss_customer_sk] #4 + WholeStageCodegen (4) Filter [ss_ticket_number,ss_item_sk,ss_customer_sk,ss_store_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Filter [d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (2) - Filter [s_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store [s_store_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (6) + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk] InputAdapter - WholeStageCodegen (7) - Sort [sr_ticket_number,sr_item_sk,sr_customer_sk] - InputAdapter - Exchange [sr_ticket_number,sr_item_sk,sr_customer_sk] #5 - WholeStageCodegen (6) - Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_returned_date_sk] - BroadcastHashJoin [sr_returned_date_sk,d_date_sk] - Filter [sr_ticket_number,sr_item_sk,sr_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_returned_date_sk] - SubqueryBroadcast [d_date_sk] #1 - ReusedExchange [d_date_sk] #6 - InputAdapter - BroadcastExchange #6 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_year,d_moy,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + BroadcastExchange #6 + WholeStageCodegen (7) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/explain.txt index 87d0ec77100c8..0598c5b81f90a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/explain.txt @@ -54,7 +54,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#9), dynamicpruningexpression(sr_returned_date_sk#9 IN dynamicpruning#10)] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk), IsNotNull(sr_customer_sk)] -ReadSchema: struct +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] Input [4]: [sr_item_sk#6, sr_customer_sk#7, sr_ticket_number#8, sr_returned_date_sk#9] @@ -65,10 +65,10 @@ Condition : ((isnotnull(sr_ticket_number#8) AND isnotnull(sr_item_sk#6)) AND isn (7) BroadcastExchange Input [4]: [sr_item_sk#6, sr_customer_sk#7, sr_ticket_number#8, sr_returned_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(input[2, bigint, false], input[0, bigint, false], input[1, bigint, false]),false), [id=#11] +Arguments: HashedRelationBroadcastMode(List(input[2, int, false], input[0, int, false], input[1, int, false]),false), [id=#11] (8) BroadcastHashJoin [codegen id : 5] -Left keys [3]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), cast(ss_customer_sk#2 as bigint)] +Left keys [3]: [ss_ticket_number#4, ss_item_sk#1, ss_customer_sk#2] Right keys [3]: [sr_ticket_number#8, sr_item_sk#6, sr_customer_sk#7] Join condition: None @@ -154,7 +154,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (27) BroadcastHashJoin [codegen id : 5] Left keys [1]: [sr_returned_date_sk#9] -Right keys [1]: [cast(d_date_sk#26 as bigint)] +Right keys [1]: [d_date_sk#26] Join condition: None (28) Project [codegen id : 5] @@ -164,7 +164,7 @@ Input [13]: [ss_sold_date_sk#5, sr_returned_date_sk#9, s_store_name#13, s_compan (29) HashAggregate [codegen id : 5] Input [12]: [ss_sold_date_sk#5, sr_returned_date_sk#9, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] Keys [10]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] -Functions [5]: [partial_sum(CASE WHEN ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 30) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 60) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 90) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 120) THEN 1 ELSE 0 END)] +Functions [5]: [partial_sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 30) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 60) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 90) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] Aggregate Attributes [5]: [sum#30, sum#31, sum#32, sum#33, sum#34] Results [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, sum#35, sum#36, sum#37, sum#38, sum#39] @@ -175,9 +175,9 @@ Arguments: hashpartitioning(s_store_name#13, s_company_id#14, s_street_number#15 (31) HashAggregate [codegen id : 6] Input [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, sum#35, sum#36, sum#37, sum#38, sum#39] Keys [10]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] -Functions [5]: [sum(CASE WHEN ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 30) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 60) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 90) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 120) THEN 1 ELSE 0 END)] -Aggregate Attributes [5]: [sum(CASE WHEN ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 30) THEN 1 ELSE 0 END)#41, sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 30) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 60)) THEN 1 ELSE 0 END)#42, sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 60) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 90)) THEN 1 ELSE 0 END)#43, sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 90) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 120)) THEN 1 ELSE 0 END)#44, sum(CASE WHEN ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 120) THEN 1 ELSE 0 END)#45] -Results [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, sum(CASE WHEN ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 30) THEN 1 ELSE 0 END)#41 AS 30 days #46, sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 30) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 60)) THEN 1 ELSE 0 END)#42 AS 31 - 60 days #47, sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 60) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 90)) THEN 1 ELSE 0 END)#43 AS 61 - 90 days #48, sum(CASE WHEN (((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 90) AND ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) <= 120)) THEN 1 ELSE 0 END)#44 AS 91 - 120 days #49, sum(CASE WHEN ((sr_returned_date_sk#9 - cast(ss_sold_date_sk#5 as bigint)) > 120) THEN 1 ELSE 0 END)#45 AS >120 days #50] +Functions [5]: [sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 30) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 60) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 90) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#41, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 30) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#42, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 60) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#43, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 90) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#44, sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#45] +Results [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#41 AS 30 days #46, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 30) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#42 AS 31 - 60 days #47, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 60) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#43 AS 61 - 90 days #48, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 90) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#44 AS 91 - 120 days #49, sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#45 AS >120 days #50] (32) TakeOrderedAndProject Input [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, 30 days #46, 31 - 60 days #47, 61 - 90 days #48, 91 - 120 days #49, >120 days #50] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/simplified.txt index 05b5fc78cd5c2..446b8705f3553 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/simplified.txt @@ -1,6 +1,6 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ] WholeStageCodegen (6) - HashAggregate [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,sum,sum,sum,sum,sum] [sum(CASE WHEN ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) > 30) AND ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) > 60) AND ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) > 90) AND ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((sr_returned_date_skL - cast(ss_sold_date_sk as bigint)) > 120) THEN 1 ELSE 0 END),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] + HashAggregate [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,sum,sum,sum,sum,sum] [sum(CASE WHEN ((sr_returned_date_sk - ss_sold_date_sk) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 30) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 60) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 90) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((sr_returned_date_sk - ss_sold_date_sk) > 120) THEN 1 ELSE 0 END),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] InputAdapter Exchange [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] #1 WholeStageCodegen (5) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/explain.txt index 931e72bba7182..d8b825209f8bd 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/explain.txt @@ -233,18 +233,18 @@ Condition : (((((((isnotnull(ss_item_sk#1) AND isnotnull(ss_ticket_number#8)) AN (4) Exchange Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] -Arguments: hashpartitioning(cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#8 as bigint), 5), ENSURE_REQUIREMENTS, [id=#14] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#8, 5), ENSURE_REQUIREMENTS, [id=#14] (5) Sort [codegen id : 2] Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] -Arguments: [cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#8 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#8 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] @@ -266,7 +266,7 @@ Input [2]: [sr_item_sk#15, sr_ticket_number#16] Arguments: [sr_item_sk#15 ASC NULLS FIRST, sr_ticket_number#16 ASC NULLS FIRST], false, 0 (12) SortMergeJoin [codegen id : 13] -Left keys [2]: [cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#8 as bigint)] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#8] Right keys [2]: [sr_item_sk#15, sr_ticket_number#16] Join condition: None @@ -811,11 +811,11 @@ Condition : (((((((isnotnull(ss_item_sk#129) AND isnotnull(ss_ticket_number#136) (135) Exchange Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] -Arguments: hashpartitioning(cast(ss_item_sk#129 as bigint), cast(ss_ticket_number#136 as bigint), 5), ENSURE_REQUIREMENTS, [id=#142] +Arguments: hashpartitioning(ss_item_sk#129, ss_ticket_number#136, 5), ENSURE_REQUIREMENTS, [id=#142] (136) Sort [codegen id : 45] Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] -Arguments: [cast(ss_item_sk#129 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#136 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#129 ASC NULLS FIRST, ss_ticket_number#136 ASC NULLS FIRST], false, 0 (137) ReusedExchange [Reuses operator id: 10] Output [2]: [sr_item_sk#143, sr_ticket_number#144] @@ -825,7 +825,7 @@ Input [2]: [sr_item_sk#143, sr_ticket_number#144] Arguments: [sr_item_sk#143 ASC NULLS FIRST, sr_ticket_number#144 ASC NULLS FIRST], false, 0 (139) SortMergeJoin [codegen id : 56] -Left keys [2]: [cast(ss_item_sk#129 as bigint), cast(ss_ticket_number#136 as bigint)] +Left keys [2]: [ss_item_sk#129, ss_ticket_number#136] Right keys [2]: [sr_item_sk#143, sr_ticket_number#144] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/explain.txt index a866c8aa9b486..c1138bbbf315e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/explain.txt @@ -207,14 +207,14 @@ Condition : (((((((isnotnull(ss_item_sk#1) AND isnotnull(ss_ticket_number#8)) AN (4) BroadcastExchange Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[7, int, false] as bigint)),false), [id=#14] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[7, int, false] as bigint) & 4294967295))),false), [id=#14] (5) Scan parquet default.store_returns Output [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (6) ColumnarToRow Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] @@ -228,7 +228,7 @@ Output [2]: [sr_item_sk#15, sr_ticket_number#16] Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] (9) BroadcastHashJoin [codegen id : 2] -Left keys [2]: [cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#8 as bigint)] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#8] Right keys [2]: [sr_item_sk#15, sr_ticket_number#16] Join condition: None @@ -717,14 +717,14 @@ Condition : (((((((isnotnull(ss_item_sk#122) AND isnotnull(ss_ticket_number#129) (118) BroadcastExchange Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[7, int, false] as bigint)),false), [id=#135] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[7, int, false] as bigint) & 4294967295))),false), [id=#135] (119) Scan parquet default.store_returns Output [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (120) ColumnarToRow Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] @@ -738,7 +738,7 @@ Output [2]: [sr_item_sk#136, sr_ticket_number#137] Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] (123) BroadcastHashJoin [codegen id : 28] -Left keys [2]: [cast(ss_item_sk#122 as bigint), cast(ss_ticket_number#129 as bigint)] +Left keys [2]: [ss_item_sk#122, ss_ticket_number#129] Right keys [2]: [sr_item_sk#136, sr_ticket_number#137] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt index a06e41562f8ff..0c5773a89e580 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt @@ -291,18 +291,18 @@ Input [11]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_pr (36) Exchange Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] -Arguments: hashpartitioning(cast(ss_ticket_number#27 as bigint), cast(ss_item_sk#26 as bigint), 5), ENSURE_REQUIREMENTS, [id=#38] +Arguments: hashpartitioning(ss_ticket_number#27, ss_item_sk#26, 5), ENSURE_REQUIREMENTS, [id=#38] (37) Sort [codegen id : 11] Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] -Arguments: [cast(ss_ticket_number#27 as bigint) ASC NULLS FIRST, cast(ss_item_sk#26 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#27 ASC NULLS FIRST, ss_item_sk#26 ASC NULLS FIRST], false, 0 (38) Scan parquet default.store_returns Output [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (39) ColumnarToRow [codegen id : 12] Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] @@ -324,7 +324,7 @@ Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return Arguments: [sr_ticket_number#40 ASC NULLS FIRST, sr_item_sk#39 ASC NULLS FIRST], false, 0 (44) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#27 as bigint), cast(ss_item_sk#26 as bigint)] +Left keys [2]: [ss_ticket_number#27, ss_item_sk#26] Right keys [2]: [sr_ticket_number#40, sr_item_sk#39] Join condition: None @@ -373,18 +373,18 @@ Input [11]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_pri (55) Exchange Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] -Arguments: hashpartitioning(cast(ws_order_number#48 as bigint), cast(ws_item_sk#47 as bigint), 5), ENSURE_REQUIREMENTS, [id=#59] +Arguments: hashpartitioning(ws_order_number#48, ws_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#59] (56) Sort [codegen id : 18] Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] -Arguments: [cast(ws_order_number#48 as bigint) ASC NULLS FIRST, cast(ws_item_sk#47 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_order_number#48 ASC NULLS FIRST, ws_item_sk#47 ASC NULLS FIRST], false, 0 (57) Scan parquet default.web_returns Output [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (58) ColumnarToRow [codegen id : 19] Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] @@ -406,7 +406,7 @@ Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_ Arguments: [wr_order_number#61 ASC NULLS FIRST, wr_item_sk#60 ASC NULLS FIRST], false, 0 (63) SortMergeJoin -Left keys [2]: [cast(ws_order_number#48 as bigint), cast(ws_item_sk#47 as bigint)] +Left keys [2]: [ws_order_number#48, ws_item_sk#47] Right keys [2]: [wr_order_number#61, wr_item_sk#60] Join condition: None @@ -579,11 +579,11 @@ Input [11]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_p (101) Exchange Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] -Arguments: hashpartitioning(cast(ss_ticket_number#99 as bigint), cast(ss_item_sk#98 as bigint), 5), ENSURE_REQUIREMENTS, [id=#110] +Arguments: hashpartitioning(ss_ticket_number#99, ss_item_sk#98, 5), ENSURE_REQUIREMENTS, [id=#110] (102) Sort [codegen id : 36] Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] -Arguments: [cast(ss_ticket_number#99 as bigint) ASC NULLS FIRST, cast(ss_item_sk#98 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#99 ASC NULLS FIRST, ss_item_sk#98 ASC NULLS FIRST], false, 0 (103) ReusedExchange [Reuses operator id: 42] Output [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] @@ -593,76 +593,76 @@ Input [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_ret Arguments: [sr_ticket_number#112 ASC NULLS FIRST, sr_item_sk#111 ASC NULLS FIRST], false, 0 (105) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#99 as bigint), cast(ss_item_sk#98 as bigint)] +Left keys [2]: [ss_ticket_number#99, ss_item_sk#98] Right keys [2]: [sr_ticket_number#112, sr_item_sk#111] Join condition: None (106) Project [codegen id : 39] -Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#115] +Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] Input [13]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109, sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] (107) Scan parquet default.web_sales -Output [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] +Output [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#120), dynamicpruningexpression(ws_sold_date_sk#120 IN dynamicpruning#84)] +PartitionFilters: [isnotnull(ws_sold_date_sk#119), dynamicpruningexpression(ws_sold_date_sk#119 IN dynamicpruning#84)] PushedFilters: [IsNotNull(ws_item_sk)] ReadSchema: struct (108) ColumnarToRow [codegen id : 42] -Input [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] (109) Filter [codegen id : 42] -Input [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] -Condition : isnotnull(ws_item_sk#116) +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Condition : isnotnull(ws_item_sk#115) (110) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#121, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] +Output [5]: [i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] (111) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ws_item_sk#116] -Right keys [1]: [i_item_sk#121] +Left keys [1]: [ws_item_sk#115] +Right keys [1]: [i_item_sk#120] Join condition: None (112) Project [codegen id : 42] -Output [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] -Input [10]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_item_sk#121, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] +Input [10]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] (113) ReusedExchange [Reuses operator id: 83] -Output [2]: [d_date_sk#126, d_year#127] +Output [2]: [d_date_sk#125, d_year#126] (114) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ws_sold_date_sk#120] -Right keys [1]: [d_date_sk#126] +Left keys [1]: [ws_sold_date_sk#119] +Right keys [1]: [d_date_sk#125] Join condition: None (115) Project [codegen id : 42] -Output [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Input [11]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_date_sk#126, d_year#127] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Input [11]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_date_sk#125, d_year#126] (116) Exchange -Input [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Arguments: hashpartitioning(cast(ws_order_number#117 as bigint), cast(ws_item_sk#116 as bigint), 5), ENSURE_REQUIREMENTS, [id=#128] +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: hashpartitioning(ws_order_number#116, ws_item_sk#115, 5), ENSURE_REQUIREMENTS, [id=#127] (117) Sort [codegen id : 43] -Input [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Arguments: [cast(ws_order_number#117 as bigint) ASC NULLS FIRST, cast(ws_item_sk#116 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: [ws_order_number#116 ASC NULLS FIRST, ws_item_sk#115 ASC NULLS FIRST], false, 0 (118) ReusedExchange [Reuses operator id: 61] -Output [4]: [wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] +Output [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] (119) Sort [codegen id : 45] -Input [4]: [wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] -Arguments: [wr_order_number#130 ASC NULLS FIRST, wr_item_sk#129 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] +Arguments: [wr_order_number#129 ASC NULLS FIRST, wr_item_sk#128 ASC NULLS FIRST], false, 0 (120) SortMergeJoin -Left keys [2]: [cast(ws_order_number#117 as bigint), cast(ws_item_sk#116 as bigint)] -Right keys [2]: [wr_order_number#130, wr_item_sk#129] +Left keys [2]: [ws_order_number#116, ws_item_sk#115] +Right keys [2]: [wr_order_number#129, wr_item_sk#128] Join condition: None (121) Project [codegen id : 46] -Output [7]: [d_year#127, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, (ws_quantity#118 - coalesce(wr_return_quantity#131, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#119 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#132, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#133] -Input [13]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127, wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] +Output [7]: [d_year#126, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, (ws_quantity#117 - coalesce(wr_return_quantity#130, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#118 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#131, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126, wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] (122) Union @@ -675,7 +675,7 @@ Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manuf (124) Exchange Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] -Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#134] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#132] (125) HashAggregate [codegen id : 48] Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] @@ -688,40 +688,40 @@ Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manuf Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] -Aggregate Attributes [2]: [sum#135, sum#136] -Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] +Aggregate Attributes [2]: [sum#133, sum#134] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] (127) Exchange -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] -Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#139] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#137] (128) HashAggregate [codegen id : 49] -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] -Aggregate Attributes [2]: [sum(sales_cnt#24)#140, sum(UnscaledValue(sales_amt#25))#141] -Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#140 AS sales_cnt#142, MakeDecimal(sum(UnscaledValue(sales_amt#25))#141,18,2) AS sales_amt#143] +Aggregate Attributes [2]: [sum(sales_cnt#24)#138, sum(UnscaledValue(sales_amt#25))#139] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#138 AS sales_cnt#140, MakeDecimal(sum(UnscaledValue(sales_amt#25))#139,18,2) AS sales_amt#141] (129) Exchange -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] -Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#144] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#142] (130) Sort [codegen id : 50] -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] Arguments: [i_brand_id#86 ASC NULLS FIRST, i_class_id#87 ASC NULLS FIRST, i_category_id#88 ASC NULLS FIRST, i_manufact_id#89 ASC NULLS FIRST], false, 0 (131) SortMergeJoin [codegen id : 51] Left keys [4]: [i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] Right keys [4]: [i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#142 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#140 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (132) Project [codegen id : 51] -Output [10]: [d_year#91 AS prev_year#145, d_year#15 AS year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#142 AS prev_yr_cnt#147, sales_cnt#76 AS curr_yr_cnt#148, (sales_cnt#76 - sales_cnt#142) AS sales_cnt_diff#149, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#143 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#150] -Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] +Output [10]: [d_year#91 AS prev_year#143, d_year#15 AS year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#140 AS prev_yr_cnt#145, sales_cnt#76 AS curr_yr_cnt#146, (sales_cnt#76 - sales_cnt#140) AS sales_cnt_diff#147, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#141 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#148] +Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] (133) TakeOrderedAndProject -Input [10]: [prev_year#145, year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#147, curr_yr_cnt#148, sales_cnt_diff#149, sales_amt_diff#150] -Arguments: 100, [sales_cnt_diff#149 ASC NULLS FIRST], [prev_year#145, year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#147, curr_yr_cnt#148, sales_cnt_diff#149, sales_amt_diff#150] +Input [10]: [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] +Arguments: 100, [sales_cnt_diff#147 ASC NULLS FIRST], [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] ===== Subqueries ===== @@ -745,6 +745,6 @@ Output [2]: [d_date_sk#90, d_year#91] Subquery:5 Hosting operator id = 92 Hosting Expression = ss_sold_date_sk#102 IN dynamicpruning#84 -Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#120 IN dynamicpruning#84 +Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#119 IN dynamicpruning#84 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt index a06e41562f8ff..0c5773a89e580 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt @@ -291,18 +291,18 @@ Input [11]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_pr (36) Exchange Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] -Arguments: hashpartitioning(cast(ss_ticket_number#27 as bigint), cast(ss_item_sk#26 as bigint), 5), ENSURE_REQUIREMENTS, [id=#38] +Arguments: hashpartitioning(ss_ticket_number#27, ss_item_sk#26, 5), ENSURE_REQUIREMENTS, [id=#38] (37) Sort [codegen id : 11] Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] -Arguments: [cast(ss_ticket_number#27 as bigint) ASC NULLS FIRST, cast(ss_item_sk#26 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#27 ASC NULLS FIRST, ss_item_sk#26 ASC NULLS FIRST], false, 0 (38) Scan parquet default.store_returns Output [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (39) ColumnarToRow [codegen id : 12] Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] @@ -324,7 +324,7 @@ Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return Arguments: [sr_ticket_number#40 ASC NULLS FIRST, sr_item_sk#39 ASC NULLS FIRST], false, 0 (44) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#27 as bigint), cast(ss_item_sk#26 as bigint)] +Left keys [2]: [ss_ticket_number#27, ss_item_sk#26] Right keys [2]: [sr_ticket_number#40, sr_item_sk#39] Join condition: None @@ -373,18 +373,18 @@ Input [11]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_pri (55) Exchange Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] -Arguments: hashpartitioning(cast(ws_order_number#48 as bigint), cast(ws_item_sk#47 as bigint), 5), ENSURE_REQUIREMENTS, [id=#59] +Arguments: hashpartitioning(ws_order_number#48, ws_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#59] (56) Sort [codegen id : 18] Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] -Arguments: [cast(ws_order_number#48 as bigint) ASC NULLS FIRST, cast(ws_item_sk#47 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_order_number#48 ASC NULLS FIRST, ws_item_sk#47 ASC NULLS FIRST], false, 0 (57) Scan parquet default.web_returns Output [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (58) ColumnarToRow [codegen id : 19] Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] @@ -406,7 +406,7 @@ Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_ Arguments: [wr_order_number#61 ASC NULLS FIRST, wr_item_sk#60 ASC NULLS FIRST], false, 0 (63) SortMergeJoin -Left keys [2]: [cast(ws_order_number#48 as bigint), cast(ws_item_sk#47 as bigint)] +Left keys [2]: [ws_order_number#48, ws_item_sk#47] Right keys [2]: [wr_order_number#61, wr_item_sk#60] Join condition: None @@ -579,11 +579,11 @@ Input [11]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_p (101) Exchange Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] -Arguments: hashpartitioning(cast(ss_ticket_number#99 as bigint), cast(ss_item_sk#98 as bigint), 5), ENSURE_REQUIREMENTS, [id=#110] +Arguments: hashpartitioning(ss_ticket_number#99, ss_item_sk#98, 5), ENSURE_REQUIREMENTS, [id=#110] (102) Sort [codegen id : 36] Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] -Arguments: [cast(ss_ticket_number#99 as bigint) ASC NULLS FIRST, cast(ss_item_sk#98 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#99 ASC NULLS FIRST, ss_item_sk#98 ASC NULLS FIRST], false, 0 (103) ReusedExchange [Reuses operator id: 42] Output [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] @@ -593,76 +593,76 @@ Input [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_ret Arguments: [sr_ticket_number#112 ASC NULLS FIRST, sr_item_sk#111 ASC NULLS FIRST], false, 0 (105) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#99 as bigint), cast(ss_item_sk#98 as bigint)] +Left keys [2]: [ss_ticket_number#99, ss_item_sk#98] Right keys [2]: [sr_ticket_number#112, sr_item_sk#111] Join condition: None (106) Project [codegen id : 39] -Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#115] +Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] Input [13]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109, sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] (107) Scan parquet default.web_sales -Output [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] +Output [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#120), dynamicpruningexpression(ws_sold_date_sk#120 IN dynamicpruning#84)] +PartitionFilters: [isnotnull(ws_sold_date_sk#119), dynamicpruningexpression(ws_sold_date_sk#119 IN dynamicpruning#84)] PushedFilters: [IsNotNull(ws_item_sk)] ReadSchema: struct (108) ColumnarToRow [codegen id : 42] -Input [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] (109) Filter [codegen id : 42] -Input [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] -Condition : isnotnull(ws_item_sk#116) +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Condition : isnotnull(ws_item_sk#115) (110) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#121, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] +Output [5]: [i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] (111) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ws_item_sk#116] -Right keys [1]: [i_item_sk#121] +Left keys [1]: [ws_item_sk#115] +Right keys [1]: [i_item_sk#120] Join condition: None (112) Project [codegen id : 42] -Output [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] -Input [10]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_item_sk#121, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] +Input [10]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] (113) ReusedExchange [Reuses operator id: 83] -Output [2]: [d_date_sk#126, d_year#127] +Output [2]: [d_date_sk#125, d_year#126] (114) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ws_sold_date_sk#120] -Right keys [1]: [d_date_sk#126] +Left keys [1]: [ws_sold_date_sk#119] +Right keys [1]: [d_date_sk#125] Join condition: None (115) Project [codegen id : 42] -Output [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Input [11]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_date_sk#126, d_year#127] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Input [11]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_date_sk#125, d_year#126] (116) Exchange -Input [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Arguments: hashpartitioning(cast(ws_order_number#117 as bigint), cast(ws_item_sk#116 as bigint), 5), ENSURE_REQUIREMENTS, [id=#128] +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: hashpartitioning(ws_order_number#116, ws_item_sk#115, 5), ENSURE_REQUIREMENTS, [id=#127] (117) Sort [codegen id : 43] -Input [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Arguments: [cast(ws_order_number#117 as bigint) ASC NULLS FIRST, cast(ws_item_sk#116 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: [ws_order_number#116 ASC NULLS FIRST, ws_item_sk#115 ASC NULLS FIRST], false, 0 (118) ReusedExchange [Reuses operator id: 61] -Output [4]: [wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] +Output [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] (119) Sort [codegen id : 45] -Input [4]: [wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] -Arguments: [wr_order_number#130 ASC NULLS FIRST, wr_item_sk#129 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] +Arguments: [wr_order_number#129 ASC NULLS FIRST, wr_item_sk#128 ASC NULLS FIRST], false, 0 (120) SortMergeJoin -Left keys [2]: [cast(ws_order_number#117 as bigint), cast(ws_item_sk#116 as bigint)] -Right keys [2]: [wr_order_number#130, wr_item_sk#129] +Left keys [2]: [ws_order_number#116, ws_item_sk#115] +Right keys [2]: [wr_order_number#129, wr_item_sk#128] Join condition: None (121) Project [codegen id : 46] -Output [7]: [d_year#127, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, (ws_quantity#118 - coalesce(wr_return_quantity#131, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#119 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#132, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#133] -Input [13]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127, wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] +Output [7]: [d_year#126, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, (ws_quantity#117 - coalesce(wr_return_quantity#130, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#118 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#131, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126, wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] (122) Union @@ -675,7 +675,7 @@ Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manuf (124) Exchange Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] -Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#134] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#132] (125) HashAggregate [codegen id : 48] Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] @@ -688,40 +688,40 @@ Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manuf Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] -Aggregate Attributes [2]: [sum#135, sum#136] -Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] +Aggregate Attributes [2]: [sum#133, sum#134] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] (127) Exchange -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] -Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#139] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#137] (128) HashAggregate [codegen id : 49] -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] -Aggregate Attributes [2]: [sum(sales_cnt#24)#140, sum(UnscaledValue(sales_amt#25))#141] -Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#140 AS sales_cnt#142, MakeDecimal(sum(UnscaledValue(sales_amt#25))#141,18,2) AS sales_amt#143] +Aggregate Attributes [2]: [sum(sales_cnt#24)#138, sum(UnscaledValue(sales_amt#25))#139] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#138 AS sales_cnt#140, MakeDecimal(sum(UnscaledValue(sales_amt#25))#139,18,2) AS sales_amt#141] (129) Exchange -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] -Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#144] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#142] (130) Sort [codegen id : 50] -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] Arguments: [i_brand_id#86 ASC NULLS FIRST, i_class_id#87 ASC NULLS FIRST, i_category_id#88 ASC NULLS FIRST, i_manufact_id#89 ASC NULLS FIRST], false, 0 (131) SortMergeJoin [codegen id : 51] Left keys [4]: [i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] Right keys [4]: [i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#142 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#140 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (132) Project [codegen id : 51] -Output [10]: [d_year#91 AS prev_year#145, d_year#15 AS year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#142 AS prev_yr_cnt#147, sales_cnt#76 AS curr_yr_cnt#148, (sales_cnt#76 - sales_cnt#142) AS sales_cnt_diff#149, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#143 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#150] -Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] +Output [10]: [d_year#91 AS prev_year#143, d_year#15 AS year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#140 AS prev_yr_cnt#145, sales_cnt#76 AS curr_yr_cnt#146, (sales_cnt#76 - sales_cnt#140) AS sales_cnt_diff#147, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#141 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#148] +Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] (133) TakeOrderedAndProject -Input [10]: [prev_year#145, year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#147, curr_yr_cnt#148, sales_cnt_diff#149, sales_amt_diff#150] -Arguments: 100, [sales_cnt_diff#149 ASC NULLS FIRST], [prev_year#145, year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#147, curr_yr_cnt#148, sales_cnt_diff#149, sales_amt_diff#150] +Input [10]: [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] +Arguments: 100, [sales_cnt_diff#147 ASC NULLS FIRST], [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] ===== Subqueries ===== @@ -745,6 +745,6 @@ Output [2]: [d_date_sk#90, d_year#91] Subquery:5 Hosting operator id = 92 Hosting Expression = ss_sold_date_sk#102 IN dynamicpruning#84 -Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#120 IN dynamicpruning#84 +Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#119 IN dynamicpruning#84 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt index dc5a7fc792af9..34d2ec82f500d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt @@ -185,9 +185,9 @@ Results [3]: [s_store_sk#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2)) Output [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#24)] +PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (21) ColumnarToRow [codegen id : 6] Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] @@ -196,51 +196,51 @@ Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_s Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] Condition : isnotnull(sr_store_sk#20) -(23) ReusedExchange [Reuses operator id: 14] -Output [1]: [s_store_sk#25] +(23) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#24] (24) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sr_store_sk#20] -Right keys [1]: [cast(s_store_sk#25 as bigint)] +Left keys [1]: [sr_returned_date_sk#23] +Right keys [1]: [d_date_sk#24] Join condition: None (25) Project [codegen id : 6] -Output [4]: [sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, s_store_sk#25] -Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, s_store_sk#25] +Output [3]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] +Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#24] -(26) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#26] +(26) ReusedExchange [Reuses operator id: 14] +Output [1]: [s_store_sk#25] (27) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sr_returned_date_sk#23] -Right keys [1]: [cast(d_date_sk#26 as bigint)] +Left keys [1]: [sr_store_sk#20] +Right keys [1]: [s_store_sk#25] Join condition: None (28) Project [codegen id : 6] Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] -Input [5]: [sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, s_store_sk#25, d_date_sk#26] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#25] (29) HashAggregate [codegen id : 6] Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] Keys [1]: [s_store_sk#25] Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] -Aggregate Attributes [2]: [sum#27, sum#28] -Results [3]: [s_store_sk#25, sum#29, sum#30] +Aggregate Attributes [2]: [sum#26, sum#27] +Results [3]: [s_store_sk#25, sum#28, sum#29] (30) Exchange -Input [3]: [s_store_sk#25, sum#29, sum#30] -Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#31] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] (31) HashAggregate [codegen id : 7] -Input [3]: [s_store_sk#25, sum#29, sum#30] +Input [3]: [s_store_sk#25, sum#28, sum#29] Keys [1]: [s_store_sk#25] Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] -Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#32, sum(UnscaledValue(sr_net_loss#22))#33] -Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#32,17,2) AS returns#34, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#33,17,2) AS profit_loss#35] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#31, sum(UnscaledValue(sr_net_loss#22))#32] +Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#31,17,2) AS returns#33, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#32,17,2) AS profit_loss#34] (32) BroadcastExchange -Input [3]: [s_store_sk#25, returns#34, profit_loss#35] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#36] +Input [3]: [s_store_sk#25, returns#33, profit_loss#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] (33) BroadcastHashJoin [codegen id : 8] Left keys [1]: [s_store_sk#9] @@ -248,269 +248,269 @@ Right keys [1]: [s_store_sk#25] Join condition: None (34) Project [codegen id : 8] -Output [5]: [sales#18, coalesce(returns#34, 0.00) AS returns#37, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#35, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#38, store channel AS channel#39, s_store_sk#9 AS id#40] -Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#34, profit_loss#35] +Output [5]: [sales#18, coalesce(returns#33, 0.00) AS returns#36, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#34, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#37, store channel AS channel#38, s_store_sk#9 AS id#39] +Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#33, profit_loss#34] (35) Scan parquet default.catalog_sales -Output [4]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44] +Output [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#44), dynamicpruningexpression(cs_sold_date_sk#44 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(cs_sold_date_sk#43), dynamicpruningexpression(cs_sold_date_sk#43 IN dynamicpruning#5)] ReadSchema: struct (36) ColumnarToRow [codegen id : 10] -Input [4]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44] +Input [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] (37) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#45] +Output [1]: [d_date_sk#44] (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#44] -Right keys [1]: [d_date_sk#45] +Left keys [1]: [cs_sold_date_sk#43] +Right keys [1]: [d_date_sk#44] Join condition: None (39) Project [codegen id : 10] -Output [3]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43] -Input [5]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44, d_date_sk#45] +Output [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Input [5]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43, d_date_sk#44] (40) HashAggregate [codegen id : 10] -Input [3]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43] -Keys [1]: [cs_call_center_sk#41] -Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#42)), partial_sum(UnscaledValue(cs_net_profit#43))] -Aggregate Attributes [2]: [sum#46, sum#47] -Results [3]: [cs_call_center_sk#41, sum#48, sum#49] +Input [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#41)), partial_sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum#45, sum#46] +Results [3]: [cs_call_center_sk#40, sum#47, sum#48] (41) Exchange -Input [3]: [cs_call_center_sk#41, sum#48, sum#49] -Arguments: hashpartitioning(cs_call_center_sk#41, 5), ENSURE_REQUIREMENTS, [id=#50] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Arguments: hashpartitioning(cs_call_center_sk#40, 5), ENSURE_REQUIREMENTS, [id=#49] (42) HashAggregate [codegen id : 14] -Input [3]: [cs_call_center_sk#41, sum#48, sum#49] -Keys [1]: [cs_call_center_sk#41] -Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#42)), sum(UnscaledValue(cs_net_profit#43))] -Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#42))#51, sum(UnscaledValue(cs_net_profit#43))#52] -Results [3]: [cs_call_center_sk#41, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#42))#51,17,2) AS sales#53, MakeDecimal(sum(UnscaledValue(cs_net_profit#43))#52,17,2) AS profit#54] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#41)), sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#41))#50, sum(UnscaledValue(cs_net_profit#42))#51] +Results [3]: [cs_call_center_sk#40, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#41))#50,17,2) AS sales#52, MakeDecimal(sum(UnscaledValue(cs_net_profit#42))#51,17,2) AS profit#53] (43) Scan parquet default.catalog_returns -Output [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] +Output [3]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cr_returned_date_sk#57), dynamicpruningexpression(cr_returned_date_sk#57 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(cr_returned_date_sk#56), dynamicpruningexpression(cr_returned_date_sk#56 IN dynamicpruning#5)] ReadSchema: struct (44) ColumnarToRow [codegen id : 12] -Input [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] +Input [3]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56] (45) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#58] +Output [1]: [d_date_sk#57] (46) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [cr_returned_date_sk#57] -Right keys [1]: [d_date_sk#58] +Left keys [1]: [cr_returned_date_sk#56] +Right keys [1]: [d_date_sk#57] Join condition: None (47) Project [codegen id : 12] -Output [2]: [cr_return_amount#55, cr_net_loss#56] -Input [4]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57, d_date_sk#58] +Output [2]: [cr_return_amount#54, cr_net_loss#55] +Input [4]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56, d_date_sk#57] (48) HashAggregate [codegen id : 12] -Input [2]: [cr_return_amount#55, cr_net_loss#56] +Input [2]: [cr_return_amount#54, cr_net_loss#55] Keys: [] -Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#55)), partial_sum(UnscaledValue(cr_net_loss#56))] -Aggregate Attributes [2]: [sum#59, sum#60] -Results [2]: [sum#61, sum#62] +Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#54)), partial_sum(UnscaledValue(cr_net_loss#55))] +Aggregate Attributes [2]: [sum#58, sum#59] +Results [2]: [sum#60, sum#61] (49) Exchange -Input [2]: [sum#61, sum#62] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#63] +Input [2]: [sum#60, sum#61] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#62] (50) HashAggregate [codegen id : 13] -Input [2]: [sum#61, sum#62] +Input [2]: [sum#60, sum#61] Keys: [] -Functions [2]: [sum(UnscaledValue(cr_return_amount#55)), sum(UnscaledValue(cr_net_loss#56))] -Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#55))#64, sum(UnscaledValue(cr_net_loss#56))#65] -Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#55))#64,17,2) AS returns#66, MakeDecimal(sum(UnscaledValue(cr_net_loss#56))#65,17,2) AS profit_loss#67] +Functions [2]: [sum(UnscaledValue(cr_return_amount#54)), sum(UnscaledValue(cr_net_loss#55))] +Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#54))#63, sum(UnscaledValue(cr_net_loss#55))#64] +Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#54))#63,17,2) AS returns#65, MakeDecimal(sum(UnscaledValue(cr_net_loss#55))#64,17,2) AS profit_loss#66] (51) BroadcastExchange -Input [2]: [returns#66, profit_loss#67] -Arguments: IdentityBroadcastMode, [id=#68] +Input [2]: [returns#65, profit_loss#66] +Arguments: IdentityBroadcastMode, [id=#67] (52) BroadcastNestedLoopJoin [codegen id : 14] Join condition: None (53) Project [codegen id : 14] -Output [5]: [sales#53, returns#66, CheckOverflow((promote_precision(cast(profit#54 as decimal(18,2))) - promote_precision(cast(profit_loss#67 as decimal(18,2)))), DecimalType(18,2), true) AS profit#69, catalog channel AS channel#70, cs_call_center_sk#41 AS id#71] -Input [5]: [cs_call_center_sk#41, sales#53, profit#54, returns#66, profit_loss#67] +Output [5]: [sales#52, returns#65, CheckOverflow((promote_precision(cast(profit#53 as decimal(18,2))) - promote_precision(cast(profit_loss#66 as decimal(18,2)))), DecimalType(18,2), true) AS profit#68, catalog channel AS channel#69, cs_call_center_sk#40 AS id#70] +Input [5]: [cs_call_center_sk#40, sales#52, profit#53, returns#65, profit_loss#66] (54) Scan parquet default.web_sales -Output [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] +Output [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#75), dynamicpruningexpression(ws_sold_date_sk#75 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ws_sold_date_sk#74), dynamicpruningexpression(ws_sold_date_sk#74 IN dynamicpruning#5)] PushedFilters: [IsNotNull(ws_web_page_sk)] ReadSchema: struct (55) ColumnarToRow [codegen id : 17] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] (56) Filter [codegen id : 17] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] -Condition : isnotnull(ws_web_page_sk#72) +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Condition : isnotnull(ws_web_page_sk#71) (57) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#76] +Output [1]: [d_date_sk#75] (58) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_sold_date_sk#75] -Right keys [1]: [d_date_sk#76] +Left keys [1]: [ws_sold_date_sk#74] +Right keys [1]: [d_date_sk#75] Join condition: None (59) Project [codegen id : 17] -Output [3]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74] -Input [5]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75, d_date_sk#76] +Output [3]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73] +Input [5]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74, d_date_sk#75] (60) Scan parquet default.web_page -Output [1]: [wp_web_page_sk#77] +Output [1]: [wp_web_page_sk#76] Batched: true Location [not included in comparison]/{warehouse_dir}/web_page] PushedFilters: [IsNotNull(wp_web_page_sk)] ReadSchema: struct (61) ColumnarToRow [codegen id : 16] -Input [1]: [wp_web_page_sk#77] +Input [1]: [wp_web_page_sk#76] (62) Filter [codegen id : 16] -Input [1]: [wp_web_page_sk#77] -Condition : isnotnull(wp_web_page_sk#77) +Input [1]: [wp_web_page_sk#76] +Condition : isnotnull(wp_web_page_sk#76) (63) BroadcastExchange -Input [1]: [wp_web_page_sk#77] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#78] +Input [1]: [wp_web_page_sk#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] (64) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_web_page_sk#72] -Right keys [1]: [wp_web_page_sk#77] +Left keys [1]: [ws_web_page_sk#71] +Right keys [1]: [wp_web_page_sk#76] Join condition: None (65) Project [codegen id : 17] -Output [3]: [ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] +Output [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] (66) HashAggregate [codegen id : 17] -Input [3]: [ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] -Keys [1]: [wp_web_page_sk#77] -Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#73)), partial_sum(UnscaledValue(ws_net_profit#74))] -Aggregate Attributes [2]: [sum#79, sum#80] -Results [3]: [wp_web_page_sk#77, sum#81, sum#82] +Input [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#72)), partial_sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum#78, sum#79] +Results [3]: [wp_web_page_sk#76, sum#80, sum#81] (67) Exchange -Input [3]: [wp_web_page_sk#77, sum#81, sum#82] -Arguments: hashpartitioning(wp_web_page_sk#77, 5), ENSURE_REQUIREMENTS, [id=#83] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Arguments: hashpartitioning(wp_web_page_sk#76, 5), ENSURE_REQUIREMENTS, [id=#82] (68) HashAggregate [codegen id : 22] -Input [3]: [wp_web_page_sk#77, sum#81, sum#82] -Keys [1]: [wp_web_page_sk#77] -Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#73)), sum(UnscaledValue(ws_net_profit#74))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#73))#84, sum(UnscaledValue(ws_net_profit#74))#85] -Results [3]: [wp_web_page_sk#77, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#73))#84,17,2) AS sales#86, MakeDecimal(sum(UnscaledValue(ws_net_profit#74))#85,17,2) AS profit#87] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#72)), sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#72))#83, sum(UnscaledValue(ws_net_profit#73))#84] +Results [3]: [wp_web_page_sk#76, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#72))#83,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(ws_net_profit#73))#84,17,2) AS profit#86] (69) Scan parquet default.web_returns -Output [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] +Output [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#91), dynamicpruningexpression(wr_returned_date_sk#91 IN dynamicpruning#24)] +PartitionFilters: [isnotnull(wr_returned_date_sk#90), dynamicpruningexpression(wr_returned_date_sk#90 IN dynamicpruning#5)] PushedFilters: [IsNotNull(wr_web_page_sk)] -ReadSchema: struct +ReadSchema: struct (70) ColumnarToRow [codegen id : 20] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] (71) Filter [codegen id : 20] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] -Condition : isnotnull(wr_web_page_sk#88) +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Condition : isnotnull(wr_web_page_sk#87) -(72) ReusedExchange [Reuses operator id: 63] -Output [1]: [wp_web_page_sk#92] +(72) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#91] (73) BroadcastHashJoin [codegen id : 20] -Left keys [1]: [wr_web_page_sk#88] -Right keys [1]: [cast(wp_web_page_sk#92 as bigint)] +Left keys [1]: [wr_returned_date_sk#90] +Right keys [1]: [d_date_sk#91] Join condition: None (74) Project [codegen id : 20] -Output [4]: [wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91, wp_web_page_sk#92] -Input [5]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91, wp_web_page_sk#92] +Output [3]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89] +Input [5]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90, d_date_sk#91] -(75) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#93] +(75) ReusedExchange [Reuses operator id: 63] +Output [1]: [wp_web_page_sk#92] (76) BroadcastHashJoin [codegen id : 20] -Left keys [1]: [wr_returned_date_sk#91] -Right keys [1]: [cast(d_date_sk#93 as bigint)] +Left keys [1]: [wr_web_page_sk#87] +Right keys [1]: [wp_web_page_sk#92] Join condition: None (77) Project [codegen id : 20] -Output [3]: [wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#92] -Input [5]: [wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91, wp_web_page_sk#92, d_date_sk#93] +Output [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] (78) HashAggregate [codegen id : 20] -Input [3]: [wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#92] +Input [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] Keys [1]: [wp_web_page_sk#92] -Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#89)), partial_sum(UnscaledValue(wr_net_loss#90))] -Aggregate Attributes [2]: [sum#94, sum#95] -Results [3]: [wp_web_page_sk#92, sum#96, sum#97] +Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#88)), partial_sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum#93, sum#94] +Results [3]: [wp_web_page_sk#92, sum#95, sum#96] (79) Exchange -Input [3]: [wp_web_page_sk#92, sum#96, sum#97] -Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#98] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#97] (80) HashAggregate [codegen id : 21] -Input [3]: [wp_web_page_sk#92, sum#96, sum#97] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] Keys [1]: [wp_web_page_sk#92] -Functions [2]: [sum(UnscaledValue(wr_return_amt#89)), sum(UnscaledValue(wr_net_loss#90))] -Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#89))#99, sum(UnscaledValue(wr_net_loss#90))#100] -Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#89))#99,17,2) AS returns#101, MakeDecimal(sum(UnscaledValue(wr_net_loss#90))#100,17,2) AS profit_loss#102] +Functions [2]: [sum(UnscaledValue(wr_return_amt#88)), sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#88))#98, sum(UnscaledValue(wr_net_loss#89))#99] +Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#88))#98,17,2) AS returns#100, MakeDecimal(sum(UnscaledValue(wr_net_loss#89))#99,17,2) AS profit_loss#101] (81) BroadcastExchange -Input [3]: [wp_web_page_sk#92, returns#101, profit_loss#102] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#103] +Input [3]: [wp_web_page_sk#92, returns#100, profit_loss#101] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] (82) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [wp_web_page_sk#77] +Left keys [1]: [wp_web_page_sk#76] Right keys [1]: [wp_web_page_sk#92] Join condition: None (83) Project [codegen id : 22] -Output [5]: [sales#86, coalesce(returns#101, 0.00) AS returns#104, CheckOverflow((promote_precision(cast(profit#87 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#102, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#105, web channel AS channel#106, wp_web_page_sk#77 AS id#107] -Input [6]: [wp_web_page_sk#77, sales#86, profit#87, wp_web_page_sk#92, returns#101, profit_loss#102] +Output [5]: [sales#85, coalesce(returns#100, 0.00) AS returns#103, CheckOverflow((promote_precision(cast(profit#86 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#101, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#104, web channel AS channel#105, wp_web_page_sk#76 AS id#106] +Input [6]: [wp_web_page_sk#76, sales#85, profit#86, wp_web_page_sk#92, returns#100, profit_loss#101] (84) Union (85) Expand [codegen id : 23] -Input [5]: [sales#18, returns#37, profit#38, channel#39, id#40] -Arguments: [ArrayBuffer(sales#18, returns#37, profit#38, channel#39, id#40, 0), ArrayBuffer(sales#18, returns#37, profit#38, channel#39, null, 1), ArrayBuffer(sales#18, returns#37, profit#38, null, null, 3)], [sales#18, returns#37, profit#38, channel#108, id#109, spark_grouping_id#110] +Input [5]: [sales#18, returns#36, profit#37, channel#38, id#39] +Arguments: [ArrayBuffer(sales#18, returns#36, profit#37, channel#38, id#39, 0), ArrayBuffer(sales#18, returns#36, profit#37, channel#38, null, 1), ArrayBuffer(sales#18, returns#36, profit#37, null, null, 3)], [sales#18, returns#36, profit#37, channel#107, id#108, spark_grouping_id#109] (86) HashAggregate [codegen id : 23] -Input [6]: [sales#18, returns#37, profit#38, channel#108, id#109, spark_grouping_id#110] -Keys [3]: [channel#108, id#109, spark_grouping_id#110] -Functions [3]: [partial_sum(sales#18), partial_sum(returns#37), partial_sum(profit#38)] -Aggregate Attributes [6]: [sum#111, isEmpty#112, sum#113, isEmpty#114, sum#115, isEmpty#116] -Results [9]: [channel#108, id#109, spark_grouping_id#110, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] +Input [6]: [sales#18, returns#36, profit#37, channel#107, id#108, spark_grouping_id#109] +Keys [3]: [channel#107, id#108, spark_grouping_id#109] +Functions [3]: [partial_sum(sales#18), partial_sum(returns#36), partial_sum(profit#37)] +Aggregate Attributes [6]: [sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Results [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] (87) Exchange -Input [9]: [channel#108, id#109, spark_grouping_id#110, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] -Arguments: hashpartitioning(channel#108, id#109, spark_grouping_id#110, 5), ENSURE_REQUIREMENTS, [id=#123] +Input [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] +Arguments: hashpartitioning(channel#107, id#108, spark_grouping_id#109, 5), ENSURE_REQUIREMENTS, [id=#122] (88) HashAggregate [codegen id : 24] -Input [9]: [channel#108, id#109, spark_grouping_id#110, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] -Keys [3]: [channel#108, id#109, spark_grouping_id#110] -Functions [3]: [sum(sales#18), sum(returns#37), sum(profit#38)] -Aggregate Attributes [3]: [sum(sales#18)#124, sum(returns#37)#125, sum(profit#38)#126] -Results [5]: [channel#108, id#109, sum(sales#18)#124 AS sales#127, sum(returns#37)#125 AS returns#128, sum(profit#38)#126 AS profit#129] +Input [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] +Keys [3]: [channel#107, id#108, spark_grouping_id#109] +Functions [3]: [sum(sales#18), sum(returns#36), sum(profit#37)] +Aggregate Attributes [3]: [sum(sales#18)#123, sum(returns#36)#124, sum(profit#37)#125] +Results [5]: [channel#107, id#108, sum(sales#18)#123 AS sales#126, sum(returns#36)#124 AS returns#127, sum(profit#37)#125 AS profit#128] (89) TakeOrderedAndProject -Input [5]: [channel#108, id#109, sales#127, returns#128, profit#129] -Arguments: 100, [channel#108 ASC NULLS FIRST, id#109 ASC NULLS FIRST], [channel#108, id#109, sales#127, returns#128, profit#129] +Input [5]: [channel#107, id#108, sales#126, returns#127, profit#128] +Arguments: 100, [channel#107 ASC NULLS FIRST, id#108 ASC NULLS FIRST], [channel#107, id#108, sales#126, returns#127, profit#128] ===== Subqueries ===== @@ -521,19 +521,14 @@ ReusedExchange (90) (90) ReusedExchange [Reuses operator id: 8] Output [1]: [d_date_sk#6] -Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#24 -ReusedExchange (91) - - -(91) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#26] +Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#5 -Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#44 IN dynamicpruning#5 +Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#43 IN dynamicpruning#5 -Subquery:4 Hosting operator id = 43 Hosting Expression = cr_returned_date_sk#57 IN dynamicpruning#5 +Subquery:4 Hosting operator id = 43 Hosting Expression = cr_returned_date_sk#56 IN dynamicpruning#5 -Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#75 IN dynamicpruning#5 +Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#74 IN dynamicpruning#5 -Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#91 IN dynamicpruning#24 +Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#90 IN dynamicpruning#5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt index 86b7f43ac074f..d2fc07d0112f0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt @@ -50,19 +50,18 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (6) HashAggregate [s_store_sk,sr_return_amt,sr_net_loss] [sum,sum,sum,sum] Project [sr_return_amt,sr_net_loss,s_store_sk] - BroadcastHashJoin [sr_returned_date_sk,d_date_sk] - Project [sr_return_amt,sr_net_loss,sr_returned_date_sk,s_store_sk] - BroadcastHashJoin [sr_store_sk,s_store_sk] + BroadcastHashJoin [sr_store_sk,s_store_sk] + Project [sr_store_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] Filter [sr_store_sk] ColumnarToRow InputAdapter Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] - SubqueryBroadcast [d_date_sk] #2 - ReusedExchange [d_date_sk] #3 + ReusedSubquery [d_date_sk] #1 InputAdapter - ReusedExchange [s_store_sk] #4 + ReusedExchange [d_date_sk] #3 InputAdapter - ReusedExchange [d_date_sk] #3 + ReusedExchange [s_store_sk] #4 WholeStageCodegen (14) Project [sales,returns,profit,profit_loss,cs_call_center_sk] BroadcastNestedLoopJoin @@ -130,15 +129,15 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (20) HashAggregate [wp_web_page_sk,wr_return_amt,wr_net_loss] [sum,sum,sum,sum] Project [wr_return_amt,wr_net_loss,wp_web_page_sk] - BroadcastHashJoin [wr_returned_date_sk,d_date_sk] - Project [wr_return_amt,wr_net_loss,wr_returned_date_sk,wp_web_page_sk] - BroadcastHashJoin [wr_web_page_sk,wp_web_page_sk] + BroadcastHashJoin [wr_web_page_sk,wp_web_page_sk] + Project [wr_web_page_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] Filter [wr_web_page_sk] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_web_page_sk,wr_return_amt,wr_net_loss,wr_returned_date_sk] - ReusedSubquery [d_date_sk] #2 + ReusedSubquery [d_date_sk] #1 InputAdapter - ReusedExchange [wp_web_page_sk] #11 + ReusedExchange [d_date_sk] #3 InputAdapter - ReusedExchange [d_date_sk] #3 + ReusedExchange [wp_web_page_sk] #11 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt index 62bd5aba36e53..7c9c3589c275e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt @@ -185,9 +185,9 @@ Results [3]: [s_store_sk#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2)) Output [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#24)] +PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (21) ColumnarToRow [codegen id : 6] Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] @@ -197,320 +197,320 @@ Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_s Condition : isnotnull(sr_store_sk#20) (23) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#25] +Output [1]: [d_date_sk#24] (24) BroadcastHashJoin [codegen id : 6] Left keys [1]: [sr_returned_date_sk#23] -Right keys [1]: [cast(d_date_sk#25 as bigint)] +Right keys [1]: [d_date_sk#24] Join condition: None (25) Project [codegen id : 6] Output [3]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] -Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#25] +Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#24] (26) ReusedExchange [Reuses operator id: 14] -Output [1]: [s_store_sk#26] +Output [1]: [s_store_sk#25] (27) BroadcastHashJoin [codegen id : 6] Left keys [1]: [sr_store_sk#20] -Right keys [1]: [cast(s_store_sk#26 as bigint)] +Right keys [1]: [s_store_sk#25] Join condition: None (28) Project [codegen id : 6] -Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#26] -Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#26] +Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#25] (29) HashAggregate [codegen id : 6] -Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#26] -Keys [1]: [s_store_sk#26] +Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Keys [1]: [s_store_sk#25] Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] -Aggregate Attributes [2]: [sum#27, sum#28] -Results [3]: [s_store_sk#26, sum#29, sum#30] +Aggregate Attributes [2]: [sum#26, sum#27] +Results [3]: [s_store_sk#25, sum#28, sum#29] (30) Exchange -Input [3]: [s_store_sk#26, sum#29, sum#30] -Arguments: hashpartitioning(s_store_sk#26, 5), ENSURE_REQUIREMENTS, [id=#31] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] (31) HashAggregate [codegen id : 7] -Input [3]: [s_store_sk#26, sum#29, sum#30] -Keys [1]: [s_store_sk#26] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Keys [1]: [s_store_sk#25] Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] -Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#32, sum(UnscaledValue(sr_net_loss#22))#33] -Results [3]: [s_store_sk#26, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#32,17,2) AS returns#34, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#33,17,2) AS profit_loss#35] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#31, sum(UnscaledValue(sr_net_loss#22))#32] +Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#31,17,2) AS returns#33, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#32,17,2) AS profit_loss#34] (32) BroadcastExchange -Input [3]: [s_store_sk#26, returns#34, profit_loss#35] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#36] +Input [3]: [s_store_sk#25, returns#33, profit_loss#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] (33) BroadcastHashJoin [codegen id : 8] Left keys [1]: [s_store_sk#9] -Right keys [1]: [s_store_sk#26] +Right keys [1]: [s_store_sk#25] Join condition: None (34) Project [codegen id : 8] -Output [5]: [sales#18, coalesce(returns#34, 0.00) AS returns#37, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#35, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#38, store channel AS channel#39, s_store_sk#9 AS id#40] -Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#26, returns#34, profit_loss#35] +Output [5]: [sales#18, coalesce(returns#33, 0.00) AS returns#36, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#34, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#37, store channel AS channel#38, s_store_sk#9 AS id#39] +Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#33, profit_loss#34] (35) Scan parquet default.catalog_sales -Output [4]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44] +Output [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#44), dynamicpruningexpression(cs_sold_date_sk#44 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(cs_sold_date_sk#43), dynamicpruningexpression(cs_sold_date_sk#43 IN dynamicpruning#5)] ReadSchema: struct (36) ColumnarToRow [codegen id : 10] -Input [4]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44] +Input [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] (37) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#45] +Output [1]: [d_date_sk#44] (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#44] -Right keys [1]: [d_date_sk#45] +Left keys [1]: [cs_sold_date_sk#43] +Right keys [1]: [d_date_sk#44] Join condition: None (39) Project [codegen id : 10] -Output [3]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43] -Input [5]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44, d_date_sk#45] +Output [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Input [5]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43, d_date_sk#44] (40) HashAggregate [codegen id : 10] -Input [3]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43] -Keys [1]: [cs_call_center_sk#41] -Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#42)), partial_sum(UnscaledValue(cs_net_profit#43))] -Aggregate Attributes [2]: [sum#46, sum#47] -Results [3]: [cs_call_center_sk#41, sum#48, sum#49] +Input [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#41)), partial_sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum#45, sum#46] +Results [3]: [cs_call_center_sk#40, sum#47, sum#48] (41) Exchange -Input [3]: [cs_call_center_sk#41, sum#48, sum#49] -Arguments: hashpartitioning(cs_call_center_sk#41, 5), ENSURE_REQUIREMENTS, [id=#50] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Arguments: hashpartitioning(cs_call_center_sk#40, 5), ENSURE_REQUIREMENTS, [id=#49] (42) HashAggregate [codegen id : 11] -Input [3]: [cs_call_center_sk#41, sum#48, sum#49] -Keys [1]: [cs_call_center_sk#41] -Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#42)), sum(UnscaledValue(cs_net_profit#43))] -Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#42))#51, sum(UnscaledValue(cs_net_profit#43))#52] -Results [3]: [cs_call_center_sk#41, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#42))#51,17,2) AS sales#53, MakeDecimal(sum(UnscaledValue(cs_net_profit#43))#52,17,2) AS profit#54] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#41)), sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#41))#50, sum(UnscaledValue(cs_net_profit#42))#51] +Results [3]: [cs_call_center_sk#40, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#41))#50,17,2) AS sales#52, MakeDecimal(sum(UnscaledValue(cs_net_profit#42))#51,17,2) AS profit#53] (43) BroadcastExchange -Input [3]: [cs_call_center_sk#41, sales#53, profit#54] -Arguments: IdentityBroadcastMode, [id=#55] +Input [3]: [cs_call_center_sk#40, sales#52, profit#53] +Arguments: IdentityBroadcastMode, [id=#54] (44) Scan parquet default.catalog_returns -Output [3]: [cr_return_amount#56, cr_net_loss#57, cr_returned_date_sk#58] +Output [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cr_returned_date_sk#58), dynamicpruningexpression(cr_returned_date_sk#58 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(cr_returned_date_sk#57), dynamicpruningexpression(cr_returned_date_sk#57 IN dynamicpruning#5)] ReadSchema: struct (45) ColumnarToRow [codegen id : 13] -Input [3]: [cr_return_amount#56, cr_net_loss#57, cr_returned_date_sk#58] +Input [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] (46) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#59] +Output [1]: [d_date_sk#58] (47) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [cr_returned_date_sk#58] -Right keys [1]: [d_date_sk#59] +Left keys [1]: [cr_returned_date_sk#57] +Right keys [1]: [d_date_sk#58] Join condition: None (48) Project [codegen id : 13] -Output [2]: [cr_return_amount#56, cr_net_loss#57] -Input [4]: [cr_return_amount#56, cr_net_loss#57, cr_returned_date_sk#58, d_date_sk#59] +Output [2]: [cr_return_amount#55, cr_net_loss#56] +Input [4]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57, d_date_sk#58] (49) HashAggregate [codegen id : 13] -Input [2]: [cr_return_amount#56, cr_net_loss#57] +Input [2]: [cr_return_amount#55, cr_net_loss#56] Keys: [] -Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#56)), partial_sum(UnscaledValue(cr_net_loss#57))] -Aggregate Attributes [2]: [sum#60, sum#61] -Results [2]: [sum#62, sum#63] +Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#55)), partial_sum(UnscaledValue(cr_net_loss#56))] +Aggregate Attributes [2]: [sum#59, sum#60] +Results [2]: [sum#61, sum#62] (50) Exchange -Input [2]: [sum#62, sum#63] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#64] +Input [2]: [sum#61, sum#62] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#63] (51) HashAggregate -Input [2]: [sum#62, sum#63] +Input [2]: [sum#61, sum#62] Keys: [] -Functions [2]: [sum(UnscaledValue(cr_return_amount#56)), sum(UnscaledValue(cr_net_loss#57))] -Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#56))#65, sum(UnscaledValue(cr_net_loss#57))#66] -Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#56))#65,17,2) AS returns#67, MakeDecimal(sum(UnscaledValue(cr_net_loss#57))#66,17,2) AS profit_loss#68] +Functions [2]: [sum(UnscaledValue(cr_return_amount#55)), sum(UnscaledValue(cr_net_loss#56))] +Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#55))#64, sum(UnscaledValue(cr_net_loss#56))#65] +Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#55))#64,17,2) AS returns#66, MakeDecimal(sum(UnscaledValue(cr_net_loss#56))#65,17,2) AS profit_loss#67] (52) BroadcastNestedLoopJoin [codegen id : 14] Join condition: None (53) Project [codegen id : 14] -Output [5]: [sales#53, returns#67, CheckOverflow((promote_precision(cast(profit#54 as decimal(18,2))) - promote_precision(cast(profit_loss#68 as decimal(18,2)))), DecimalType(18,2), true) AS profit#69, catalog channel AS channel#70, cs_call_center_sk#41 AS id#71] -Input [5]: [cs_call_center_sk#41, sales#53, profit#54, returns#67, profit_loss#68] +Output [5]: [sales#52, returns#66, CheckOverflow((promote_precision(cast(profit#53 as decimal(18,2))) - promote_precision(cast(profit_loss#67 as decimal(18,2)))), DecimalType(18,2), true) AS profit#68, catalog channel AS channel#69, cs_call_center_sk#40 AS id#70] +Input [5]: [cs_call_center_sk#40, sales#52, profit#53, returns#66, profit_loss#67] (54) Scan parquet default.web_sales -Output [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] +Output [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#75), dynamicpruningexpression(ws_sold_date_sk#75 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ws_sold_date_sk#74), dynamicpruningexpression(ws_sold_date_sk#74 IN dynamicpruning#5)] PushedFilters: [IsNotNull(ws_web_page_sk)] ReadSchema: struct (55) ColumnarToRow [codegen id : 17] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] (56) Filter [codegen id : 17] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] -Condition : isnotnull(ws_web_page_sk#72) +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Condition : isnotnull(ws_web_page_sk#71) (57) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#76] +Output [1]: [d_date_sk#75] (58) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_sold_date_sk#75] -Right keys [1]: [d_date_sk#76] +Left keys [1]: [ws_sold_date_sk#74] +Right keys [1]: [d_date_sk#75] Join condition: None (59) Project [codegen id : 17] -Output [3]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74] -Input [5]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75, d_date_sk#76] +Output [3]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73] +Input [5]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74, d_date_sk#75] (60) Scan parquet default.web_page -Output [1]: [wp_web_page_sk#77] +Output [1]: [wp_web_page_sk#76] Batched: true Location [not included in comparison]/{warehouse_dir}/web_page] PushedFilters: [IsNotNull(wp_web_page_sk)] ReadSchema: struct (61) ColumnarToRow [codegen id : 16] -Input [1]: [wp_web_page_sk#77] +Input [1]: [wp_web_page_sk#76] (62) Filter [codegen id : 16] -Input [1]: [wp_web_page_sk#77] -Condition : isnotnull(wp_web_page_sk#77) +Input [1]: [wp_web_page_sk#76] +Condition : isnotnull(wp_web_page_sk#76) (63) BroadcastExchange -Input [1]: [wp_web_page_sk#77] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#78] +Input [1]: [wp_web_page_sk#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] (64) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_web_page_sk#72] -Right keys [1]: [wp_web_page_sk#77] +Left keys [1]: [ws_web_page_sk#71] +Right keys [1]: [wp_web_page_sk#76] Join condition: None (65) Project [codegen id : 17] -Output [3]: [ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] +Output [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] (66) HashAggregate [codegen id : 17] -Input [3]: [ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] -Keys [1]: [wp_web_page_sk#77] -Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#73)), partial_sum(UnscaledValue(ws_net_profit#74))] -Aggregate Attributes [2]: [sum#79, sum#80] -Results [3]: [wp_web_page_sk#77, sum#81, sum#82] +Input [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#72)), partial_sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum#78, sum#79] +Results [3]: [wp_web_page_sk#76, sum#80, sum#81] (67) Exchange -Input [3]: [wp_web_page_sk#77, sum#81, sum#82] -Arguments: hashpartitioning(wp_web_page_sk#77, 5), ENSURE_REQUIREMENTS, [id=#83] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Arguments: hashpartitioning(wp_web_page_sk#76, 5), ENSURE_REQUIREMENTS, [id=#82] (68) HashAggregate [codegen id : 22] -Input [3]: [wp_web_page_sk#77, sum#81, sum#82] -Keys [1]: [wp_web_page_sk#77] -Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#73)), sum(UnscaledValue(ws_net_profit#74))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#73))#84, sum(UnscaledValue(ws_net_profit#74))#85] -Results [3]: [wp_web_page_sk#77, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#73))#84,17,2) AS sales#86, MakeDecimal(sum(UnscaledValue(ws_net_profit#74))#85,17,2) AS profit#87] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#72)), sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#72))#83, sum(UnscaledValue(ws_net_profit#73))#84] +Results [3]: [wp_web_page_sk#76, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#72))#83,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(ws_net_profit#73))#84,17,2) AS profit#86] (69) Scan parquet default.web_returns -Output [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] +Output [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#91), dynamicpruningexpression(wr_returned_date_sk#91 IN dynamicpruning#24)] +PartitionFilters: [isnotnull(wr_returned_date_sk#90), dynamicpruningexpression(wr_returned_date_sk#90 IN dynamicpruning#5)] PushedFilters: [IsNotNull(wr_web_page_sk)] -ReadSchema: struct +ReadSchema: struct (70) ColumnarToRow [codegen id : 20] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] (71) Filter [codegen id : 20] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] -Condition : isnotnull(wr_web_page_sk#88) +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Condition : isnotnull(wr_web_page_sk#87) (72) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#92] +Output [1]: [d_date_sk#91] (73) BroadcastHashJoin [codegen id : 20] -Left keys [1]: [wr_returned_date_sk#91] -Right keys [1]: [cast(d_date_sk#92 as bigint)] +Left keys [1]: [wr_returned_date_sk#90] +Right keys [1]: [d_date_sk#91] Join condition: None (74) Project [codegen id : 20] -Output [3]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90] -Input [5]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91, d_date_sk#92] +Output [3]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89] +Input [5]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90, d_date_sk#91] (75) ReusedExchange [Reuses operator id: 63] -Output [1]: [wp_web_page_sk#93] +Output [1]: [wp_web_page_sk#92] (76) BroadcastHashJoin [codegen id : 20] -Left keys [1]: [wr_web_page_sk#88] -Right keys [1]: [cast(wp_web_page_sk#93 as bigint)] +Left keys [1]: [wr_web_page_sk#87] +Right keys [1]: [wp_web_page_sk#92] Join condition: None (77) Project [codegen id : 20] -Output [3]: [wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#93] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#93] +Output [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] (78) HashAggregate [codegen id : 20] -Input [3]: [wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#93] -Keys [1]: [wp_web_page_sk#93] -Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#89)), partial_sum(UnscaledValue(wr_net_loss#90))] -Aggregate Attributes [2]: [sum#94, sum#95] -Results [3]: [wp_web_page_sk#93, sum#96, sum#97] +Input [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#88)), partial_sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum#93, sum#94] +Results [3]: [wp_web_page_sk#92, sum#95, sum#96] (79) Exchange -Input [3]: [wp_web_page_sk#93, sum#96, sum#97] -Arguments: hashpartitioning(wp_web_page_sk#93, 5), ENSURE_REQUIREMENTS, [id=#98] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#97] (80) HashAggregate [codegen id : 21] -Input [3]: [wp_web_page_sk#93, sum#96, sum#97] -Keys [1]: [wp_web_page_sk#93] -Functions [2]: [sum(UnscaledValue(wr_return_amt#89)), sum(UnscaledValue(wr_net_loss#90))] -Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#89))#99, sum(UnscaledValue(wr_net_loss#90))#100] -Results [3]: [wp_web_page_sk#93, MakeDecimal(sum(UnscaledValue(wr_return_amt#89))#99,17,2) AS returns#101, MakeDecimal(sum(UnscaledValue(wr_net_loss#90))#100,17,2) AS profit_loss#102] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [sum(UnscaledValue(wr_return_amt#88)), sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#88))#98, sum(UnscaledValue(wr_net_loss#89))#99] +Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#88))#98,17,2) AS returns#100, MakeDecimal(sum(UnscaledValue(wr_net_loss#89))#99,17,2) AS profit_loss#101] (81) BroadcastExchange -Input [3]: [wp_web_page_sk#93, returns#101, profit_loss#102] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#103] +Input [3]: [wp_web_page_sk#92, returns#100, profit_loss#101] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] (82) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [wp_web_page_sk#77] -Right keys [1]: [wp_web_page_sk#93] +Left keys [1]: [wp_web_page_sk#76] +Right keys [1]: [wp_web_page_sk#92] Join condition: None (83) Project [codegen id : 22] -Output [5]: [sales#86, coalesce(returns#101, 0.00) AS returns#104, CheckOverflow((promote_precision(cast(profit#87 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#102, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#105, web channel AS channel#106, wp_web_page_sk#77 AS id#107] -Input [6]: [wp_web_page_sk#77, sales#86, profit#87, wp_web_page_sk#93, returns#101, profit_loss#102] +Output [5]: [sales#85, coalesce(returns#100, 0.00) AS returns#103, CheckOverflow((promote_precision(cast(profit#86 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#101, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#104, web channel AS channel#105, wp_web_page_sk#76 AS id#106] +Input [6]: [wp_web_page_sk#76, sales#85, profit#86, wp_web_page_sk#92, returns#100, profit_loss#101] (84) Union (85) Expand [codegen id : 23] -Input [5]: [sales#18, returns#37, profit#38, channel#39, id#40] -Arguments: [ArrayBuffer(sales#18, returns#37, profit#38, channel#39, id#40, 0), ArrayBuffer(sales#18, returns#37, profit#38, channel#39, null, 1), ArrayBuffer(sales#18, returns#37, profit#38, null, null, 3)], [sales#18, returns#37, profit#38, channel#108, id#109, spark_grouping_id#110] +Input [5]: [sales#18, returns#36, profit#37, channel#38, id#39] +Arguments: [ArrayBuffer(sales#18, returns#36, profit#37, channel#38, id#39, 0), ArrayBuffer(sales#18, returns#36, profit#37, channel#38, null, 1), ArrayBuffer(sales#18, returns#36, profit#37, null, null, 3)], [sales#18, returns#36, profit#37, channel#107, id#108, spark_grouping_id#109] (86) HashAggregate [codegen id : 23] -Input [6]: [sales#18, returns#37, profit#38, channel#108, id#109, spark_grouping_id#110] -Keys [3]: [channel#108, id#109, spark_grouping_id#110] -Functions [3]: [partial_sum(sales#18), partial_sum(returns#37), partial_sum(profit#38)] -Aggregate Attributes [6]: [sum#111, isEmpty#112, sum#113, isEmpty#114, sum#115, isEmpty#116] -Results [9]: [channel#108, id#109, spark_grouping_id#110, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] +Input [6]: [sales#18, returns#36, profit#37, channel#107, id#108, spark_grouping_id#109] +Keys [3]: [channel#107, id#108, spark_grouping_id#109] +Functions [3]: [partial_sum(sales#18), partial_sum(returns#36), partial_sum(profit#37)] +Aggregate Attributes [6]: [sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Results [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] (87) Exchange -Input [9]: [channel#108, id#109, spark_grouping_id#110, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] -Arguments: hashpartitioning(channel#108, id#109, spark_grouping_id#110, 5), ENSURE_REQUIREMENTS, [id=#123] +Input [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] +Arguments: hashpartitioning(channel#107, id#108, spark_grouping_id#109, 5), ENSURE_REQUIREMENTS, [id=#122] (88) HashAggregate [codegen id : 24] -Input [9]: [channel#108, id#109, spark_grouping_id#110, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] -Keys [3]: [channel#108, id#109, spark_grouping_id#110] -Functions [3]: [sum(sales#18), sum(returns#37), sum(profit#38)] -Aggregate Attributes [3]: [sum(sales#18)#124, sum(returns#37)#125, sum(profit#38)#126] -Results [5]: [channel#108, id#109, sum(sales#18)#124 AS sales#127, sum(returns#37)#125 AS returns#128, sum(profit#38)#126 AS profit#129] +Input [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] +Keys [3]: [channel#107, id#108, spark_grouping_id#109] +Functions [3]: [sum(sales#18), sum(returns#36), sum(profit#37)] +Aggregate Attributes [3]: [sum(sales#18)#123, sum(returns#36)#124, sum(profit#37)#125] +Results [5]: [channel#107, id#108, sum(sales#18)#123 AS sales#126, sum(returns#36)#124 AS returns#127, sum(profit#37)#125 AS profit#128] (89) TakeOrderedAndProject -Input [5]: [channel#108, id#109, sales#127, returns#128, profit#129] -Arguments: 100, [channel#108 ASC NULLS FIRST, id#109 ASC NULLS FIRST], [channel#108, id#109, sales#127, returns#128, profit#129] +Input [5]: [channel#107, id#108, sales#126, returns#127, profit#128] +Arguments: 100, [channel#107 ASC NULLS FIRST, id#108 ASC NULLS FIRST], [channel#107, id#108, sales#126, returns#127, profit#128] ===== Subqueries ===== @@ -521,19 +521,14 @@ ReusedExchange (90) (90) ReusedExchange [Reuses operator id: 8] Output [1]: [d_date_sk#6] -Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#24 -ReusedExchange (91) +Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#5 +Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#43 IN dynamicpruning#5 -(91) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#25] +Subquery:4 Hosting operator id = 44 Hosting Expression = cr_returned_date_sk#57 IN dynamicpruning#5 -Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#44 IN dynamicpruning#5 +Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#74 IN dynamicpruning#5 -Subquery:4 Hosting operator id = 44 Hosting Expression = cr_returned_date_sk#58 IN dynamicpruning#5 - -Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#75 IN dynamicpruning#5 - -Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#91 IN dynamicpruning#24 +Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#90 IN dynamicpruning#5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt index cf2be9145a20a..7c20631f0086a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt @@ -57,8 +57,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] - SubqueryBroadcast [d_date_sk] #2 - ReusedExchange [d_date_sk] #3 + ReusedSubquery [d_date_sk] #1 InputAdapter ReusedExchange [d_date_sk] #3 InputAdapter @@ -137,7 +136,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_web_page_sk,wr_return_amt,wr_net_loss,wr_returned_date_sk] - ReusedSubquery [d_date_sk] #2 + ReusedSubquery [d_date_sk] #1 InputAdapter ReusedExchange [d_date_sk] #3 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt index b74247d7aef3f..8195049644816 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt @@ -42,13 +42,13 @@ TakeOrderedAndProject (73) : : : +- Exchange (28) : : : +- * Filter (27) : : : +- * ColumnarToRow (26) - : : : +- Scan parquet default.catalog_sales (25) + : : : +- Scan parquet default.web_sales (25) : : +- * Sort (35) : : +- Exchange (34) : : +- * Project (33) : : +- * Filter (32) : : +- * ColumnarToRow (31) - : : +- Scan parquet default.catalog_returns (30) + : : +- Scan parquet default.web_returns (30) : +- ReusedExchange (39) +- * Sort (70) +- * Filter (69) @@ -64,13 +64,13 @@ TakeOrderedAndProject (73) : : +- Exchange (52) : : +- * Filter (51) : : +- * ColumnarToRow (50) - : : +- Scan parquet default.web_sales (49) + : : +- Scan parquet default.catalog_sales (49) : +- * Sort (59) : +- Exchange (58) : +- * Project (57) : +- * Filter (56) : +- * ColumnarToRow (55) - : +- Scan parquet default.web_returns (54) + : +- Scan parquet default.catalog_returns (54) +- ReusedExchange (63) @@ -91,18 +91,18 @@ Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) (4) Exchange Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] -Arguments: hashpartitioning(cast(ss_ticket_number#3 as bigint), cast(ss_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#9] +Arguments: hashpartitioning(ss_ticket_number#3, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] (5) Sort [codegen id : 2] Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] -Arguments: [cast(ss_ticket_number#3 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#3 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] @@ -124,7 +124,7 @@ Input [2]: [sr_item_sk#10, sr_ticket_number#11] Arguments: [sr_ticket_number#11 ASC NULLS FIRST, sr_item_sk#10 ASC NULLS FIRST], false, 0 (12) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#3 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [ss_ticket_number#3, ss_item_sk#1] Right keys [2]: [sr_ticket_number#11, sr_item_sk#10] Join condition: None @@ -185,227 +185,227 @@ Results [6]: [d_year#15 AS ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, sum( Input [6]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] Arguments: [ss_sold_year#27 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.catalog_sales -Output [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] +(25) Scan parquet default.web_sales +Output [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#37), dynamicpruningexpression(cs_sold_date_sk#37 IN dynamicpruning#8)] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] -ReadSchema: struct +PartitionFilters: [isnotnull(ws_sold_date_sk#37), dynamicpruningexpression(ws_sold_date_sk#37 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct (26) ColumnarToRow [codegen id : 8] -Input [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] (27) Filter [codegen id : 8] -Input [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] -Condition : (isnotnull(cs_item_sk#32) AND isnotnull(cs_bill_customer_sk#31)) +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Condition : (isnotnull(ws_item_sk#31) AND isnotnull(ws_bill_customer_sk#32)) (28) Exchange -Input [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] -Arguments: hashpartitioning(cs_order_number#33, cs_item_sk#32, 5), ENSURE_REQUIREMENTS, [id=#38] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: hashpartitioning(ws_order_number#33, ws_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#38] (29) Sort [codegen id : 9] -Input [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] -Arguments: [cs_order_number#33 ASC NULLS FIRST, cs_item_sk#32 ASC NULLS FIRST], false, 0 +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: [ws_order_number#33 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST], false, 0 -(30) Scan parquet default.catalog_returns -Output [3]: [cr_item_sk#39, cr_order_number#40, cr_returned_date_sk#41] +(30) Scan parquet default.web_returns +Output [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct (31) ColumnarToRow [codegen id : 10] -Input [3]: [cr_item_sk#39, cr_order_number#40, cr_returned_date_sk#41] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] (32) Filter [codegen id : 10] -Input [3]: [cr_item_sk#39, cr_order_number#40, cr_returned_date_sk#41] -Condition : (isnotnull(cr_order_number#40) AND isnotnull(cr_item_sk#39)) +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Condition : (isnotnull(wr_order_number#40) AND isnotnull(wr_item_sk#39)) (33) Project [codegen id : 10] -Output [2]: [cr_item_sk#39, cr_order_number#40] -Input [3]: [cr_item_sk#39, cr_order_number#40, cr_returned_date_sk#41] +Output [2]: [wr_item_sk#39, wr_order_number#40] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] (34) Exchange -Input [2]: [cr_item_sk#39, cr_order_number#40] -Arguments: hashpartitioning(cr_order_number#40, cr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#42] +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: hashpartitioning(wr_order_number#40, wr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#42] (35) Sort [codegen id : 11] -Input [2]: [cr_item_sk#39, cr_order_number#40] -Arguments: [cr_order_number#40 ASC NULLS FIRST, cr_item_sk#39 ASC NULLS FIRST], false, 0 +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: [wr_order_number#40 ASC NULLS FIRST, wr_item_sk#39 ASC NULLS FIRST], false, 0 (36) SortMergeJoin -Left keys [2]: [cs_order_number#33, cs_item_sk#32] -Right keys [2]: [cr_order_number#40, cr_item_sk#39] +Left keys [2]: [ws_order_number#33, ws_item_sk#31] +Right keys [2]: [wr_order_number#40, wr_item_sk#39] Join condition: None (37) Filter [codegen id : 13] -Input [9]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37, cr_item_sk#39, cr_order_number#40] -Condition : isnull(cr_order_number#40) +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] +Condition : isnull(wr_order_number#40) (38) Project [codegen id : 13] -Output [6]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] -Input [9]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37, cr_item_sk#39, cr_order_number#40] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] (39) ReusedExchange [Reuses operator id: 18] Output [2]: [d_date_sk#43, d_year#44] (40) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [cs_sold_date_sk#37] +Left keys [1]: [ws_sold_date_sk#37] Right keys [1]: [d_date_sk#43] Join condition: None (41) Project [codegen id : 13] -Output [6]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, d_year#44] -Input [8]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37, d_date_sk#43, d_year#44] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Input [8]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, d_date_sk#43, d_year#44] (42) HashAggregate [codegen id : 13] -Input [6]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, d_year#44] -Keys [3]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31] -Functions [3]: [partial_sum(cs_quantity#34), partial_sum(UnscaledValue(cs_wholesale_cost#35)), partial_sum(UnscaledValue(cs_sales_price#36))] +Input [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [partial_sum(ws_quantity#34), partial_sum(UnscaledValue(ws_wholesale_cost#35)), partial_sum(UnscaledValue(ws_sales_price#36))] Aggregate Attributes [3]: [sum#45, sum#46, sum#47] -Results [6]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31, sum#48, sum#49, sum#50] +Results [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] (43) Exchange -Input [6]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31, sum#48, sum#49, sum#50] -Arguments: hashpartitioning(d_year#44, cs_item_sk#32, cs_bill_customer_sk#31, 5), ENSURE_REQUIREMENTS, [id=#51] +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Arguments: hashpartitioning(d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, 5), ENSURE_REQUIREMENTS, [id=#51] (44) HashAggregate [codegen id : 14] -Input [6]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31, sum#48, sum#49, sum#50] -Keys [3]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31] -Functions [3]: [sum(cs_quantity#34), sum(UnscaledValue(cs_wholesale_cost#35)), sum(UnscaledValue(cs_sales_price#36))] -Aggregate Attributes [3]: [sum(cs_quantity#34)#52, sum(UnscaledValue(cs_wholesale_cost#35))#53, sum(UnscaledValue(cs_sales_price#36))#54] -Results [6]: [d_year#44 AS cs_sold_year#55, cs_item_sk#32, cs_bill_customer_sk#31 AS cs_customer_sk#56, sum(cs_quantity#34)#52 AS cs_qty#57, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#35))#53,17,2) AS cs_wc#58, MakeDecimal(sum(UnscaledValue(cs_sales_price#36))#54,17,2) AS cs_sp#59] +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [sum(ws_quantity#34), sum(UnscaledValue(ws_wholesale_cost#35)), sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum(ws_quantity#34)#52, sum(UnscaledValue(ws_wholesale_cost#35))#53, sum(UnscaledValue(ws_sales_price#36))#54] +Results [6]: [d_year#44 AS ws_sold_year#55, ws_item_sk#31, ws_bill_customer_sk#32 AS ws_customer_sk#56, sum(ws_quantity#34)#52 AS ws_qty#57, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#35))#53,17,2) AS ws_wc#58, MakeDecimal(sum(UnscaledValue(ws_sales_price#36))#54,17,2) AS ws_sp#59] (45) Filter [codegen id : 14] -Input [6]: [cs_sold_year#55, cs_item_sk#32, cs_customer_sk#56, cs_qty#57, cs_wc#58, cs_sp#59] -Condition : (coalesce(cs_qty#57, 0) > 0) +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Condition : (coalesce(ws_qty#57, 0) > 0) (46) Sort [codegen id : 14] -Input [6]: [cs_sold_year#55, cs_item_sk#32, cs_customer_sk#56, cs_qty#57, cs_wc#58, cs_sp#59] -Arguments: [cs_sold_year#55 ASC NULLS FIRST, cs_item_sk#32 ASC NULLS FIRST, cs_customer_sk#56 ASC NULLS FIRST], false, 0 +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Arguments: [ws_sold_year#55 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST, ws_customer_sk#56 ASC NULLS FIRST], false, 0 (47) SortMergeJoin [codegen id : 15] Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] -Right keys [3]: [cs_sold_year#55, cs_item_sk#32, cs_customer_sk#56] +Right keys [3]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56] Join condition: None (48) Project [codegen id : 15] -Output [9]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, cs_qty#57, cs_wc#58, cs_sp#59] -Input [12]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, cs_sold_year#55, cs_item_sk#32, cs_customer_sk#56, cs_qty#57, cs_wc#58, cs_sp#59] +Output [9]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59] +Input [12]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] -(49) Scan parquet default.web_sales -Output [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] +(49) Scan parquet default.catalog_sales +Output [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#66), dynamicpruningexpression(ws_sold_date_sk#66 IN dynamicpruning#8)] -PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] -ReadSchema: struct +PartitionFilters: [isnotnull(cs_sold_date_sk#66), dynamicpruningexpression(cs_sold_date_sk#66 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct (50) ColumnarToRow [codegen id : 16] -Input [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] (51) Filter [codegen id : 16] -Input [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] -Condition : (isnotnull(ws_item_sk#60) AND isnotnull(ws_bill_customer_sk#61)) +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Condition : (isnotnull(cs_item_sk#61) AND isnotnull(cs_bill_customer_sk#60)) (52) Exchange -Input [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] -Arguments: hashpartitioning(cast(ws_order_number#62 as bigint), cast(ws_item_sk#60 as bigint), 5), ENSURE_REQUIREMENTS, [id=#67] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: hashpartitioning(cs_order_number#62, cs_item_sk#61, 5), ENSURE_REQUIREMENTS, [id=#67] (53) Sort [codegen id : 17] -Input [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] -Arguments: [cast(ws_order_number#62 as bigint) ASC NULLS FIRST, cast(ws_item_sk#60 as bigint) ASC NULLS FIRST], false, 0 +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: [cs_order_number#62 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST], false, 0 -(54) Scan parquet default.web_returns -Output [3]: [wr_item_sk#68, wr_order_number#69, wr_returned_date_sk#70] +(54) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_returns] -PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct (55) ColumnarToRow [codegen id : 18] -Input [3]: [wr_item_sk#68, wr_order_number#69, wr_returned_date_sk#70] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] (56) Filter [codegen id : 18] -Input [3]: [wr_item_sk#68, wr_order_number#69, wr_returned_date_sk#70] -Condition : (isnotnull(wr_order_number#69) AND isnotnull(wr_item_sk#68)) +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Condition : (isnotnull(cr_order_number#69) AND isnotnull(cr_item_sk#68)) (57) Project [codegen id : 18] -Output [2]: [wr_item_sk#68, wr_order_number#69] -Input [3]: [wr_item_sk#68, wr_order_number#69, wr_returned_date_sk#70] +Output [2]: [cr_item_sk#68, cr_order_number#69] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] (58) Exchange -Input [2]: [wr_item_sk#68, wr_order_number#69] -Arguments: hashpartitioning(wr_order_number#69, wr_item_sk#68, 5), ENSURE_REQUIREMENTS, [id=#71] +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: hashpartitioning(cr_order_number#69, cr_item_sk#68, 5), ENSURE_REQUIREMENTS, [id=#71] (59) Sort [codegen id : 19] -Input [2]: [wr_item_sk#68, wr_order_number#69] -Arguments: [wr_order_number#69 ASC NULLS FIRST, wr_item_sk#68 ASC NULLS FIRST], false, 0 +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: [cr_order_number#69 ASC NULLS FIRST, cr_item_sk#68 ASC NULLS FIRST], false, 0 (60) SortMergeJoin -Left keys [2]: [cast(ws_order_number#62 as bigint), cast(ws_item_sk#60 as bigint)] -Right keys [2]: [wr_order_number#69, wr_item_sk#68] +Left keys [2]: [cs_order_number#62, cs_item_sk#61] +Right keys [2]: [cr_order_number#69, cr_item_sk#68] Join condition: None (61) Filter [codegen id : 21] -Input [9]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66, wr_item_sk#68, wr_order_number#69] -Condition : isnull(wr_order_number#69) +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] +Condition : isnull(cr_order_number#69) (62) Project [codegen id : 21] -Output [6]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] -Input [9]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66, wr_item_sk#68, wr_order_number#69] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] (63) ReusedExchange [Reuses operator id: 18] Output [2]: [d_date_sk#72, d_year#73] (64) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [ws_sold_date_sk#66] +Left keys [1]: [cs_sold_date_sk#66] Right keys [1]: [d_date_sk#72] Join condition: None (65) Project [codegen id : 21] -Output [6]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, d_year#73] -Input [8]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66, d_date_sk#72, d_year#73] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Input [8]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, d_date_sk#72, d_year#73] (66) HashAggregate [codegen id : 21] -Input [6]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, d_year#73] -Keys [3]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61] -Functions [3]: [partial_sum(ws_quantity#63), partial_sum(UnscaledValue(ws_wholesale_cost#64)), partial_sum(UnscaledValue(ws_sales_price#65))] +Input [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [partial_sum(cs_quantity#63), partial_sum(UnscaledValue(cs_wholesale_cost#64)), partial_sum(UnscaledValue(cs_sales_price#65))] Aggregate Attributes [3]: [sum#74, sum#75, sum#76] -Results [6]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61, sum#77, sum#78, sum#79] +Results [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] (67) Exchange -Input [6]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61, sum#77, sum#78, sum#79] -Arguments: hashpartitioning(d_year#73, ws_item_sk#60, ws_bill_customer_sk#61, 5), ENSURE_REQUIREMENTS, [id=#80] +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Arguments: hashpartitioning(d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, 5), ENSURE_REQUIREMENTS, [id=#80] (68) HashAggregate [codegen id : 22] -Input [6]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61, sum#77, sum#78, sum#79] -Keys [3]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61] -Functions [3]: [sum(ws_quantity#63), sum(UnscaledValue(ws_wholesale_cost#64)), sum(UnscaledValue(ws_sales_price#65))] -Aggregate Attributes [3]: [sum(ws_quantity#63)#81, sum(UnscaledValue(ws_wholesale_cost#64))#82, sum(UnscaledValue(ws_sales_price#65))#83] -Results [6]: [d_year#73 AS ws_sold_year#84, ws_item_sk#60, ws_bill_customer_sk#61 AS ws_customer_sk#85, sum(ws_quantity#63)#81 AS ws_qty#86, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#64))#82,17,2) AS ws_wc#87, MakeDecimal(sum(UnscaledValue(ws_sales_price#65))#83,17,2) AS ws_sp#88] +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [sum(cs_quantity#63), sum(UnscaledValue(cs_wholesale_cost#64)), sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum(cs_quantity#63)#81, sum(UnscaledValue(cs_wholesale_cost#64))#82, sum(UnscaledValue(cs_sales_price#65))#83] +Results [6]: [d_year#73 AS cs_sold_year#84, cs_item_sk#61, cs_bill_customer_sk#60 AS cs_customer_sk#85, sum(cs_quantity#63)#81 AS cs_qty#86, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#64))#82,17,2) AS cs_wc#87, MakeDecimal(sum(UnscaledValue(cs_sales_price#65))#83,17,2) AS cs_sp#88] (69) Filter [codegen id : 22] -Input [6]: [ws_sold_year#84, ws_item_sk#60, ws_customer_sk#85, ws_qty#86, ws_wc#87, ws_sp#88] -Condition : (coalesce(ws_qty#86, 0) > 0) +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Condition : (coalesce(cs_qty#86, 0) > 0) (70) Sort [codegen id : 22] -Input [6]: [ws_sold_year#84, ws_item_sk#60, ws_customer_sk#85, ws_qty#86, ws_wc#87, ws_sp#88] -Arguments: [ws_sold_year#84 ASC NULLS FIRST, ws_item_sk#60 ASC NULLS FIRST, ws_customer_sk#85 ASC NULLS FIRST], false, 0 +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Arguments: [cs_sold_year#84 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST, cs_customer_sk#85 ASC NULLS FIRST], false, 0 (71) SortMergeJoin [codegen id : 23] Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] -Right keys [3]: [ws_sold_year#84, ws_item_sk#60, ws_customer_sk#85] +Right keys [3]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85] Join condition: None (72) Project [codegen id : 23] -Output [12]: [round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#86 + cs_qty#57), 1) as double)), 2) AS ratio#89, ss_qty#28 AS store_qty#90, ss_wc#29 AS store_wholesale_cost#91, ss_sp#30 AS store_sales_price#92, (coalesce(ws_qty#86, 0) + coalesce(cs_qty#57, 0)) AS other_chan_qty#93, CheckOverflow((promote_precision(cast(coalesce(ws_wc#87, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#58, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#94, CheckOverflow((promote_precision(cast(coalesce(ws_sp#88, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#59, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#95, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#86, cs_qty#57] -Input [15]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, cs_qty#57, cs_wc#58, cs_sp#59, ws_sold_year#84, ws_item_sk#60, ws_customer_sk#85, ws_qty#86, ws_wc#87, ws_sp#88] +Output [12]: [round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#57 + cs_qty#86), 1) as double)), 2) AS ratio#89, ss_qty#28 AS store_qty#90, ss_wc#29 AS store_wholesale_cost#91, ss_sp#30 AS store_sales_price#92, (coalesce(ws_qty#57, 0) + coalesce(cs_qty#86, 0)) AS other_chan_qty#93, CheckOverflow((promote_precision(cast(coalesce(ws_wc#58, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#87, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#94, CheckOverflow((promote_precision(cast(coalesce(ws_sp#59, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#88, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#95, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, cs_qty#86] +Input [15]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59, cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] (73) TakeOrderedAndProject -Input [12]: [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#86, cs_qty#57] -Arguments: 100, [ratio#89 ASC NULLS FIRST, ss_qty#28 DESC NULLS LAST, ss_wc#29 DESC NULLS LAST, ss_sp#30 DESC NULLS LAST, other_chan_qty#93 ASC NULLS FIRST, other_chan_wholesale_cost#94 ASC NULLS FIRST, other_chan_sales_price#95 ASC NULLS FIRST, round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#86 + cs_qty#57), 1) as double)), 2) ASC NULLS FIRST], [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95] +Input [12]: [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, cs_qty#86] +Arguments: 100, [ratio#89 ASC NULLS FIRST, ss_qty#28 DESC NULLS LAST, ss_wc#29 DESC NULLS LAST, ss_sp#30 DESC NULLS LAST, other_chan_qty#93 ASC NULLS FIRST, other_chan_wholesale_cost#94 ASC NULLS FIRST, other_chan_sales_price#95 ASC NULLS FIRST, round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#57 + cs_qty#86), 1) as double)), 2) ASC NULLS FIRST], [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95] ===== Subqueries ===== @@ -416,8 +416,8 @@ ReusedExchange (74) (74) ReusedExchange [Reuses operator id: 18] Output [2]: [d_date_sk#14, d_year#15] -Subquery:2 Hosting operator id = 25 Hosting Expression = cs_sold_date_sk#37 IN dynamicpruning#8 +Subquery:2 Hosting operator id = 25 Hosting Expression = ws_sold_date_sk#37 IN dynamicpruning#8 -Subquery:3 Hosting operator id = 49 Hosting Expression = ws_sold_date_sk#66 IN dynamicpruning#8 +Subquery:3 Hosting operator id = 49 Hosting Expression = cs_sold_date_sk#66 IN dynamicpruning#8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt index f5abdfd8a1699..39b0eb295e1ea 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt @@ -1,11 +1,11 @@ TakeOrderedAndProject [ratio,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholesale_cost,other_chan_sales_price,ws_qty,cs_qty,store_qty,store_wholesale_cost,store_sales_price] WholeStageCodegen (23) Project [ss_qty,ws_qty,cs_qty,ss_wc,ss_sp,ws_wc,cs_wc,ws_sp,cs_sp] - SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] InputAdapter WholeStageCodegen (15) - Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,cs_qty,cs_wc,cs_sp] - SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] + Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,ws_qty,ws_wc,ws_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] InputAdapter WholeStageCodegen (7) Sort [ss_sold_year,ss_item_sk,ss_customer_sk] @@ -50,75 +50,75 @@ TakeOrderedAndProject [ratio,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholes Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter WholeStageCodegen (14) - Sort [cs_sold_year,cs_item_sk,cs_customer_sk] - Filter [cs_qty] - HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cs_quantity),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] + Sort [ws_sold_year,ws_item_sk,ws_customer_sk] + Filter [ws_qty] + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,sum,sum,sum] [sum(ws_quantity),sum(UnscaledValue(ws_wholesale_cost)),sum(UnscaledValue(ws_sales_price)),ws_sold_year,ws_customer_sk,ws_qty,ws_wc,ws_sp,sum,sum,sum] InputAdapter - Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #5 + Exchange [d_year,ws_item_sk,ws_bill_customer_sk] #5 WholeStageCodegen (13) - HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] - Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] - Filter [cr_order_number] + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + Filter [wr_order_number] InputAdapter - SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] WholeStageCodegen (9) - Sort [cs_order_number,cs_item_sk] + Sort [ws_order_number,ws_item_sk] InputAdapter - Exchange [cs_order_number,cs_item_sk] #6 + Exchange [ws_order_number,ws_item_sk] #6 WholeStageCodegen (8) - Filter [cs_item_sk,cs_bill_customer_sk] + Filter [ws_item_sk,ws_bill_customer_sk] ColumnarToRow InputAdapter - Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] ReusedSubquery [d_date_sk] #1 WholeStageCodegen (11) - Sort [cr_order_number,cr_item_sk] + Sort [wr_order_number,wr_item_sk] InputAdapter - Exchange [cr_order_number,cr_item_sk] #7 + Exchange [wr_order_number,wr_item_sk] #7 WholeStageCodegen (10) - Project [cr_item_sk,cr_order_number] - Filter [cr_order_number,cr_item_sk] + Project [wr_item_sk,wr_order_number] + Filter [wr_order_number,wr_item_sk] ColumnarToRow InputAdapter - Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_returned_date_sk] InputAdapter ReusedExchange [d_date_sk,d_year] #3 InputAdapter WholeStageCodegen (22) - Sort [ws_sold_year,ws_item_sk,ws_customer_sk] - Filter [ws_qty] - HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,sum,sum,sum] [sum(ws_quantity),sum(UnscaledValue(ws_wholesale_cost)),sum(UnscaledValue(ws_sales_price)),ws_sold_year,ws_customer_sk,ws_qty,ws_wc,ws_sp,sum,sum,sum] + Sort [cs_sold_year,cs_item_sk,cs_customer_sk] + Filter [cs_qty] + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cs_quantity),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] InputAdapter - Exchange [d_year,ws_item_sk,ws_bill_customer_sk] #8 + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #8 WholeStageCodegen (21) - HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price] [sum,sum,sum,sum,sum,sum] - Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,d_year] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] - Filter [wr_order_number] + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + Filter [cr_order_number] InputAdapter - SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] WholeStageCodegen (17) - Sort [ws_order_number,ws_item_sk] + Sort [cs_order_number,cs_item_sk] InputAdapter - Exchange [ws_order_number,ws_item_sk] #9 + Exchange [cs_order_number,cs_item_sk] #9 WholeStageCodegen (16) - Filter [ws_item_sk,ws_bill_customer_sk] + Filter [cs_item_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter - Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] ReusedSubquery [d_date_sk] #1 WholeStageCodegen (19) - Sort [wr_order_number,wr_item_sk] + Sort [cr_order_number,cr_item_sk] InputAdapter - Exchange [wr_order_number,wr_item_sk] #10 + Exchange [cr_order_number,cr_item_sk] #10 WholeStageCodegen (18) - Project [wr_item_sk,wr_order_number] - Filter [wr_order_number,wr_item_sk] + Project [cr_item_sk,cr_order_number] + Filter [cr_order_number,cr_item_sk] ColumnarToRow InputAdapter - Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_returned_date_sk] + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] InputAdapter ReusedExchange [d_date_sk,d_year] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/explain.txt index c7da3a1e23c62..8195049644816 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/explain.txt @@ -91,18 +91,18 @@ Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) (4) Exchange Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] -Arguments: hashpartitioning(cast(ss_ticket_number#3 as bigint), cast(ss_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#9] +Arguments: hashpartitioning(ss_ticket_number#3, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] (5) Sort [codegen id : 2] Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] -Arguments: [cast(ss_ticket_number#3 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#3 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] @@ -124,7 +124,7 @@ Input [2]: [sr_item_sk#10, sr_ticket_number#11] Arguments: [sr_ticket_number#11 ASC NULLS FIRST, sr_item_sk#10 ASC NULLS FIRST], false, 0 (12) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#3 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [ss_ticket_number#3, ss_item_sk#1] Right keys [2]: [sr_ticket_number#11, sr_item_sk#10] Join condition: None @@ -202,18 +202,18 @@ Condition : (isnotnull(ws_item_sk#31) AND isnotnull(ws_bill_customer_sk#32)) (28) Exchange Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] -Arguments: hashpartitioning(cast(ws_order_number#33 as bigint), cast(ws_item_sk#31 as bigint), 5), ENSURE_REQUIREMENTS, [id=#38] +Arguments: hashpartitioning(ws_order_number#33, ws_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#38] (29) Sort [codegen id : 9] Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] -Arguments: [cast(ws_order_number#33 as bigint) ASC NULLS FIRST, cast(ws_item_sk#31 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_order_number#33 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST], false, 0 (30) Scan parquet default.web_returns Output [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (31) ColumnarToRow [codegen id : 10] Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] @@ -235,7 +235,7 @@ Input [2]: [wr_item_sk#39, wr_order_number#40] Arguments: [wr_order_number#40 ASC NULLS FIRST, wr_item_sk#39 ASC NULLS FIRST], false, 0 (36) SortMergeJoin -Left keys [2]: [cast(ws_order_number#33 as bigint), cast(ws_item_sk#31 as bigint)] +Left keys [2]: [ws_order_number#33, ws_item_sk#31] Right keys [2]: [wr_order_number#40, wr_item_sk#39] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt index 040407d99e48d..2c625a8f4fd41 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt @@ -129,18 +129,18 @@ Condition : ((isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnul (4) Exchange Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] -Arguments: hashpartitioning(cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint), 5), ENSURE_REQUIREMENTS, [id=#9] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#9] (5) Sort [codegen id : 2] Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] -Arguments: [cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] @@ -162,7 +162,7 @@ Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13 Arguments: [sr_item_sk#10 ASC NULLS FIRST, sr_ticket_number#11 ASC NULLS FIRST], false, 0 (12) SortMergeJoin -Left keys [2]: [cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#4] Right keys [2]: [sr_item_sk#10, sr_ticket_number#11] Join condition: None @@ -464,18 +464,18 @@ Condition : ((isnotnull(ws_web_site_sk#87) AND isnotnull(ws_item_sk#86)) AND isn (78) Exchange Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Arguments: hashpartitioning(cast(ws_item_sk#86 as bigint), cast(ws_order_number#89 as bigint), 5), ENSURE_REQUIREMENTS, [id=#93] +Arguments: hashpartitioning(ws_item_sk#86, ws_order_number#89, 5), ENSURE_REQUIREMENTS, [id=#93] (79) Sort [codegen id : 22] Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Arguments: [cast(ws_item_sk#86 as bigint) ASC NULLS FIRST, cast(ws_order_number#89 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_item_sk#86 ASC NULLS FIRST, ws_order_number#89 ASC NULLS FIRST], false, 0 (80) Scan parquet default.web_returns Output [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] -ReadSchema: struct +ReadSchema: struct (81) ColumnarToRow [codegen id : 23] Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] @@ -497,7 +497,7 @@ Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] Arguments: [wr_item_sk#94 ASC NULLS FIRST, wr_order_number#95 ASC NULLS FIRST], false, 0 (86) SortMergeJoin -Left keys [2]: [cast(ws_item_sk#86 as bigint), cast(ws_order_number#89 as bigint)] +Left keys [2]: [ws_item_sk#86, ws_order_number#89] Right keys [2]: [wr_item_sk#94, wr_order_number#95] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt index 467127aa2e493..8a413745875c9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt @@ -129,18 +129,18 @@ Condition : ((isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnul (4) Exchange Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] -Arguments: hashpartitioning(cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint), 5), ENSURE_REQUIREMENTS, [id=#9] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#9] (5) Sort [codegen id : 2] Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] -Arguments: [cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] @@ -162,7 +162,7 @@ Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13 Arguments: [sr_item_sk#10 ASC NULLS FIRST, sr_ticket_number#11 ASC NULLS FIRST], false, 0 (12) SortMergeJoin -Left keys [2]: [cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#4] Right keys [2]: [sr_item_sk#10, sr_ticket_number#11] Join condition: None @@ -464,18 +464,18 @@ Condition : ((isnotnull(ws_web_site_sk#87) AND isnotnull(ws_item_sk#86)) AND isn (78) Exchange Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Arguments: hashpartitioning(cast(ws_item_sk#86 as bigint), cast(ws_order_number#89 as bigint), 5), ENSURE_REQUIREMENTS, [id=#93] +Arguments: hashpartitioning(ws_item_sk#86, ws_order_number#89, 5), ENSURE_REQUIREMENTS, [id=#93] (79) Sort [codegen id : 22] Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Arguments: [cast(ws_item_sk#86 as bigint) ASC NULLS FIRST, cast(ws_order_number#89 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_item_sk#86 ASC NULLS FIRST, ws_order_number#89 ASC NULLS FIRST], false, 0 (80) Scan parquet default.web_returns Output [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] -ReadSchema: struct +ReadSchema: struct (81) ColumnarToRow [codegen id : 23] Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] @@ -497,7 +497,7 @@ Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] Arguments: [wr_item_sk#94 ASC NULLS FIRST, wr_order_number#95 ASC NULLS FIRST], false, 0 (86) SortMergeJoin -Left keys [2]: [cast(ws_item_sk#86 as bigint), cast(ws_order_number#89 as bigint)] +Left keys [2]: [ws_item_sk#86, ws_order_number#89] Right keys [2]: [wr_item_sk#94, wr_order_number#95] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt index a7c71a0668676..7f0868b3b4db2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt @@ -68,7 +68,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#3), dynamicpruningexpression(true)] PushedFilters: [IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (2) ColumnarToRow [codegen id : 5] Input [3]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3] @@ -149,7 +149,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (20) BroadcastHashJoin [codegen id : 5] Left keys [1]: [sr_returned_date_sk#3] -Right keys [1]: [cast(d_date_sk#4 as bigint)] +Right keys [1]: [d_date_sk#4] Join condition: None (21) Project [codegen id : 5] @@ -176,7 +176,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (26) BroadcastHashJoin [codegen id : 5] Left keys [1]: [sr_item_sk#1] -Right keys [1]: [cast(i_item_sk#13 as bigint)] +Right keys [1]: [i_item_sk#13] Join condition: None (27) Project [codegen id : 5] @@ -277,7 +277,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(wr_returned_date_sk#37), dynamicpruningexpression(true)] PushedFilters: [IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (47) ColumnarToRow [codegen id : 16] Input [3]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37] @@ -291,7 +291,7 @@ Output [1]: [d_date_sk#38] (50) BroadcastHashJoin [codegen id : 16] Left keys [1]: [wr_returned_date_sk#37] -Right keys [1]: [cast(d_date_sk#38 as bigint)] +Right keys [1]: [d_date_sk#38] Join condition: None (51) Project [codegen id : 16] @@ -303,7 +303,7 @@ Output [2]: [i_item_sk#39, i_item_id#40] (53) BroadcastHashJoin [codegen id : 16] Left keys [1]: [wr_item_sk#35] -Right keys [1]: [cast(i_item_sk#39 as bigint)] +Right keys [1]: [i_item_sk#39] Join condition: None (54) Project [codegen id : 16] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/explain.txt index fd73cee998f71..0764824706376 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/explain.txt @@ -68,7 +68,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#3), dynamicpruningexpression(true)] PushedFilters: [IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (2) ColumnarToRow [codegen id : 5] Input [3]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3] @@ -97,7 +97,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (8) BroadcastHashJoin [codegen id : 5] Left keys [1]: [sr_item_sk#1] -Right keys [1]: [cast(i_item_sk#4 as bigint)] +Right keys [1]: [i_item_sk#4] Join condition: None (9) Project [codegen id : 5] @@ -176,7 +176,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (26) BroadcastHashJoin [codegen id : 5] Left keys [1]: [sr_returned_date_sk#3] -Right keys [1]: [cast(d_date_sk#7 as bigint)] +Right keys [1]: [d_date_sk#7] Join condition: None (27) Project [codegen id : 5] @@ -277,7 +277,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(wr_returned_date_sk#37), dynamicpruningexpression(true)] PushedFilters: [IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (47) ColumnarToRow [codegen id : 16] Input [3]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37] @@ -291,7 +291,7 @@ Output [2]: [i_item_sk#38, i_item_id#39] (50) BroadcastHashJoin [codegen id : 16] Left keys [1]: [wr_item_sk#35] -Right keys [1]: [cast(i_item_sk#38 as bigint)] +Right keys [1]: [i_item_sk#38] Join condition: None (51) Project [codegen id : 16] @@ -303,7 +303,7 @@ Output [1]: [d_date_sk#40] (53) BroadcastHashJoin [codegen id : 16] Left keys [1]: [wr_returned_date_sk#37] -Right keys [1]: [cast(d_date_sk#40 as bigint)] +Right keys [1]: [d_date_sk#40] Join condition: None (54) Project [codegen id : 16] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt index a9fbd15abbb7e..9762d51e943e8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt @@ -177,7 +177,7 @@ Output [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_cdemo_sk)] -ReadSchema: struct +ReadSchema: struct (32) ColumnarToRow Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] @@ -191,7 +191,7 @@ Output [1]: [sr_cdemo_sk#20] Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] (35) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cast(cd_demo_sk#18 as bigint)] +Left keys [1]: [cd_demo_sk#18] Right keys [1]: [sr_cdemo_sk#20] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/explain.txt index 42e0aa41ca840..d5b84f52f4b00 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/explain.txt @@ -177,7 +177,7 @@ Output [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_cdemo_sk)] -ReadSchema: struct +ReadSchema: struct (32) ColumnarToRow Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] @@ -191,7 +191,7 @@ Output [1]: [sr_cdemo_sk#20] Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] (35) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cast(cd_demo_sk#10 as bigint)] +Left keys [1]: [cd_demo_sk#10] Right keys [1]: [sr_cdemo_sk#20] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt index 7f7c9ac72707e..d002f987ff3fd 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt @@ -4,59 +4,59 @@ TakeOrderedAndProject (58) +- Exchange (56) +- * HashAggregate (55) +- * Project (54) - +- * SortMergeJoin Inner (53) - :- * Sort (41) - : +- Exchange (40) - : +- * Project (39) - : +- * BroadcastHashJoin Inner BuildRight (38) - : :- * Project (32) - : : +- * BroadcastHashJoin Inner BuildRight (31) - : : :- * Project (26) - : : : +- * BroadcastHashJoin Inner BuildRight (25) - : : : :- * Project (19) - : : : : +- * SortMergeJoin Inner (18) - : : : : :- * Sort (11) - : : : : : +- Exchange (10) - : : : : : +- * Project (9) - : : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : : :- * Filter (3) - : : : : : : +- * ColumnarToRow (2) - : : : : : : +- Scan parquet default.web_sales (1) - : : : : : +- BroadcastExchange (7) - : : : : : +- * Filter (6) - : : : : : +- * ColumnarToRow (5) - : : : : : +- Scan parquet default.web_page (4) - : : : : +- * Sort (17) - : : : : +- Exchange (16) - : : : : +- * Project (15) - : : : : +- * Filter (14) - : : : : +- * ColumnarToRow (13) - : : : : +- Scan parquet default.web_returns (12) - : : : +- BroadcastExchange (24) - : : : +- * Project (23) - : : : +- * Filter (22) - : : : +- * ColumnarToRow (21) - : : : +- Scan parquet default.date_dim (20) - : : +- BroadcastExchange (30) - : : +- * Filter (29) - : : +- * ColumnarToRow (28) - : : +- Scan parquet default.reason (27) - : +- BroadcastExchange (37) - : +- * Project (36) - : +- * Filter (35) - : +- * ColumnarToRow (34) - : +- Scan parquet default.customer_address (33) - +- * Sort (52) - +- Exchange (51) - +- * Project (50) - +- * BroadcastHashJoin Inner BuildLeft (49) - :- BroadcastExchange (45) - : +- * Filter (44) - : +- * ColumnarToRow (43) - : +- Scan parquet default.customer_demographics (42) - +- * Filter (48) - +- * ColumnarToRow (47) - +- Scan parquet default.customer_demographics (46) + +- * BroadcastHashJoin Inner BuildRight (53) + :- * Project (48) + : +- * BroadcastHashJoin Inner BuildRight (47) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (34) + : : : +- * SortMergeJoin Inner (33) + : : : :- * Sort (27) + : : : : +- Exchange (26) + : : : : +- * Project (25) + : : : : +- * BroadcastHashJoin Inner BuildRight (24) + : : : : :- * Project (19) + : : : : : +- * SortMergeJoin Inner (18) + : : : : : :- * Sort (11) + : : : : : : +- Exchange (10) + : : : : : : +- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.web_sales (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.web_page (4) + : : : : : +- * Sort (17) + : : : : : +- Exchange (16) + : : : : : +- * Project (15) + : : : : : +- * Filter (14) + : : : : : +- * ColumnarToRow (13) + : : : : : +- Scan parquet default.web_returns (12) + : : : : +- BroadcastExchange (23) + : : : : +- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer_demographics (20) + : : : +- * Sort (32) + : : : +- Exchange (31) + : : : +- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.customer_demographics (28) + : : +- BroadcastExchange (39) + : : +- * Project (38) + : : +- * Filter (37) + : : +- * ColumnarToRow (36) + : : +- Scan parquet default.customer_address (35) + : +- BroadcastExchange (46) + : +- * Project (45) + : +- * Filter (44) + : +- * ColumnarToRow (43) + : +- Scan parquet default.date_dim (42) + +- BroadcastExchange (52) + +- * Filter (51) + +- * ColumnarToRow (50) + +- Scan parquet default.reason (49) (1) Scan parquet default.web_sales @@ -103,18 +103,18 @@ Input [8]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws (10) Exchange Input [6]: [ws_item_sk#1, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] -Arguments: hashpartitioning(cast(ws_item_sk#1 as bigint), cast(ws_order_number#3 as bigint), 5), ENSURE_REQUIREMENTS, [id=#11] +Arguments: hashpartitioning(ws_item_sk#1, ws_order_number#3, 5), ENSURE_REQUIREMENTS, [id=#11] (11) Sort [codegen id : 3] Input [6]: [ws_item_sk#1, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] -Arguments: [cast(ws_item_sk#1 as bigint) ASC NULLS FIRST, cast(ws_order_number#3 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_item_sk#1 ASC NULLS FIRST, ws_order_number#3 ASC NULLS FIRST], false, 0 (12) Scan parquet default.web_returns Output [9]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19, wr_returned_date_sk#20] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number), IsNotNull(wr_refunded_cdemo_sk), IsNotNull(wr_returning_cdemo_sk), IsNotNull(wr_refunded_addr_sk), IsNotNull(wr_reason_sk)] -ReadSchema: struct +ReadSchema: struct (13) ColumnarToRow [codegen id : 4] Input [9]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19, wr_returned_date_sk#20] @@ -135,187 +135,187 @@ Arguments: hashpartitioning(wr_item_sk#12, wr_order_number#17, 5), ENSURE_REQUIR Input [8]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19] Arguments: [wr_item_sk#12 ASC NULLS FIRST, wr_order_number#17 ASC NULLS FIRST], false, 0 -(18) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ws_item_sk#1 as bigint), cast(ws_order_number#3 as bigint)] +(18) SortMergeJoin [codegen id : 7] +Left keys [2]: [ws_item_sk#1, ws_order_number#3] Right keys [2]: [wr_item_sk#12, wr_order_number#17] Join condition: None -(19) Project [codegen id : 9] +(19) Project [codegen id : 7] Output [10]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19] Input [14]: [ws_item_sk#1, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19] -(20) Scan parquet default.date_dim -Output [2]: [d_date_sk#22, d_year#23] +(20) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), Or(Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Advanced Degree )),And(EqualTo(cd_marital_status,S),EqualTo(cd_education_status,College ))),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,2 yr Degree )))] +ReadSchema: struct (21) ColumnarToRow [codegen id : 6] -Input [2]: [d_date_sk#22, d_year#23] +Input [3]: [cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] (22) Filter [codegen id : 6] -Input [2]: [d_date_sk#22, d_year#23] -Condition : ((isnotnull(d_year#23) AND (d_year#23 = 2000)) AND isnotnull(d_date_sk#22)) +Input [3]: [cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] +Condition : (((isnotnull(cd_demo_sk#22) AND isnotnull(cd_marital_status#23)) AND isnotnull(cd_education_status#24)) AND ((((cd_marital_status#23 = M) AND (cd_education_status#24 = Advanced Degree )) OR ((cd_marital_status#23 = S) AND (cd_education_status#24 = College ))) OR ((cd_marital_status#23 = W) AND (cd_education_status#24 = 2 yr Degree )))) -(23) Project [codegen id : 6] -Output [1]: [d_date_sk#22] -Input [2]: [d_date_sk#22, d_year#23] +(23) BroadcastExchange +Input [3]: [cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] -(24) BroadcastExchange -Input [1]: [d_date_sk#22] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] +(24) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [wr_refunded_cdemo_sk#13] +Right keys [1]: [cd_demo_sk#22] +Join condition: ((((((cd_marital_status#23 = M) AND (cd_education_status#24 = Advanced Degree )) AND (ws_sales_price#5 >= 100.00)) AND (ws_sales_price#5 <= 150.00)) OR ((((cd_marital_status#23 = S) AND (cd_education_status#24 = College )) AND (ws_sales_price#5 >= 50.00)) AND (ws_sales_price#5 <= 100.00))) OR ((((cd_marital_status#23 = W) AND (cd_education_status#24 = 2 yr Degree )) AND (ws_sales_price#5 >= 150.00)) AND (ws_sales_price#5 <= 200.00))) -(25) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ws_sold_date_sk#7] -Right keys [1]: [d_date_sk#22] -Join condition: None +(25) Project [codegen id : 7] +Output [10]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_marital_status#23, cd_education_status#24] +Input [13]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] -(26) Project [codegen id : 9] -Output [9]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19] -Input [11]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, d_date_sk#22] +(26) Exchange +Input [10]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_marital_status#23, cd_education_status#24] +Arguments: hashpartitioning(wr_returning_cdemo_sk#15, cd_marital_status#23, cd_education_status#24, 5), ENSURE_REQUIREMENTS, [id=#26] -(27) Scan parquet default.reason -Output [2]: [r_reason_sk#25, r_reason_desc#26] +(27) Sort [codegen id : 8] +Input [10]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_marital_status#23, cd_education_status#24] +Arguments: [wr_returning_cdemo_sk#15 ASC NULLS FIRST, cd_marital_status#23 ASC NULLS FIRST, cd_education_status#24 ASC NULLS FIRST], false, 0 + +(28) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] Batched: true -Location [not included in comparison]/{warehouse_dir}/reason] -PushedFilters: [IsNotNull(r_reason_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status), IsNotNull(cd_education_status)] +ReadSchema: struct -(28) ColumnarToRow [codegen id : 7] -Input [2]: [r_reason_sk#25, r_reason_desc#26] +(29) ColumnarToRow [codegen id : 9] +Input [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] -(29) Filter [codegen id : 7] -Input [2]: [r_reason_sk#25, r_reason_desc#26] -Condition : isnotnull(r_reason_sk#25) +(30) Filter [codegen id : 9] +Input [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] +Condition : ((isnotnull(cd_demo_sk#27) AND isnotnull(cd_marital_status#28)) AND isnotnull(cd_education_status#29)) -(30) BroadcastExchange -Input [2]: [r_reason_sk#25, r_reason_desc#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] +(31) Exchange +Input [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] +Arguments: hashpartitioning(cd_demo_sk#27, cd_marital_status#28, cd_education_status#29, 5), ENSURE_REQUIREMENTS, [id=#30] -(31) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [wr_reason_sk#16] -Right keys [1]: [cast(r_reason_sk#25 as bigint)] +(32) Sort [codegen id : 10] +Input [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] +Arguments: [cd_demo_sk#27 ASC NULLS FIRST, cd_marital_status#28 ASC NULLS FIRST, cd_education_status#29 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin [codegen id : 14] +Left keys [3]: [wr_returning_cdemo_sk#15, cd_marital_status#23, cd_education_status#24] +Right keys [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] Join condition: None -(32) Project [codegen id : 9] -Output [9]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_fee#18, wr_refunded_cash#19, r_reason_desc#26] -Input [11]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, r_reason_sk#25, r_reason_desc#26] +(34) Project [codegen id : 14] +Output [7]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19] +Input [13]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_marital_status#23, cd_education_status#24, cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] -(33) Scan parquet default.customer_address -Output [3]: [ca_address_sk#28, ca_state#29, ca_country#30] +(35) Scan parquet default.customer_address +Output [3]: [ca_address_sk#31, ca_state#32, ca_country#33] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_country), EqualTo(ca_country,United States), IsNotNull(ca_address_sk), Or(Or(In(ca_state, [IN,OH,NJ]),In(ca_state, [WI,CT,KY])),In(ca_state, [LA,IA,AR]))] ReadSchema: struct -(34) ColumnarToRow [codegen id : 8] -Input [3]: [ca_address_sk#28, ca_state#29, ca_country#30] +(36) ColumnarToRow [codegen id : 11] +Input [3]: [ca_address_sk#31, ca_state#32, ca_country#33] -(35) Filter [codegen id : 8] -Input [3]: [ca_address_sk#28, ca_state#29, ca_country#30] -Condition : (((isnotnull(ca_country#30) AND (ca_country#30 = United States)) AND isnotnull(ca_address_sk#28)) AND ((ca_state#29 IN (IN,OH,NJ) OR ca_state#29 IN (WI,CT,KY)) OR ca_state#29 IN (LA,IA,AR))) +(37) Filter [codegen id : 11] +Input [3]: [ca_address_sk#31, ca_state#32, ca_country#33] +Condition : (((isnotnull(ca_country#33) AND (ca_country#33 = United States)) AND isnotnull(ca_address_sk#31)) AND ((ca_state#32 IN (IN,OH,NJ) OR ca_state#32 IN (WI,CT,KY)) OR ca_state#32 IN (LA,IA,AR))) -(36) Project [codegen id : 8] -Output [2]: [ca_address_sk#28, ca_state#29] -Input [3]: [ca_address_sk#28, ca_state#29, ca_country#30] +(38) Project [codegen id : 11] +Output [2]: [ca_address_sk#31, ca_state#32] +Input [3]: [ca_address_sk#31, ca_state#32, ca_country#33] -(37) BroadcastExchange -Input [2]: [ca_address_sk#28, ca_state#29] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] +(39) BroadcastExchange +Input [2]: [ca_address_sk#31, ca_state#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] -(38) BroadcastHashJoin [codegen id : 9] +(40) BroadcastHashJoin [codegen id : 14] Left keys [1]: [wr_refunded_addr_sk#14] -Right keys [1]: [cast(ca_address_sk#28 as bigint)] -Join condition: ((((ca_state#29 IN (IN,OH,NJ) AND (ws_net_profit#6 >= 100.00)) AND (ws_net_profit#6 <= 200.00)) OR ((ca_state#29 IN (WI,CT,KY) AND (ws_net_profit#6 >= 150.00)) AND (ws_net_profit#6 <= 300.00))) OR ((ca_state#29 IN (LA,IA,AR) AND (ws_net_profit#6 >= 50.00)) AND (ws_net_profit#6 <= 250.00))) - -(39) Project [codegen id : 9] -Output [7]: [ws_quantity#4, ws_sales_price#5, wr_refunded_cdemo_sk#13, wr_returning_cdemo_sk#15, wr_fee#18, wr_refunded_cash#19, r_reason_desc#26] -Input [11]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_fee#18, wr_refunded_cash#19, r_reason_desc#26, ca_address_sk#28, ca_state#29] - -(40) Exchange -Input [7]: [ws_quantity#4, ws_sales_price#5, wr_refunded_cdemo_sk#13, wr_returning_cdemo_sk#15, wr_fee#18, wr_refunded_cash#19, r_reason_desc#26] -Arguments: hashpartitioning(wr_refunded_cdemo_sk#13, wr_returning_cdemo_sk#15, 5), ENSURE_REQUIREMENTS, [id=#32] +Right keys [1]: [ca_address_sk#31] +Join condition: ((((ca_state#32 IN (IN,OH,NJ) AND (ws_net_profit#6 >= 100.00)) AND (ws_net_profit#6 <= 200.00)) OR ((ca_state#32 IN (WI,CT,KY) AND (ws_net_profit#6 >= 150.00)) AND (ws_net_profit#6 <= 300.00))) OR ((ca_state#32 IN (LA,IA,AR) AND (ws_net_profit#6 >= 50.00)) AND (ws_net_profit#6 <= 250.00))) -(41) Sort [codegen id : 10] -Input [7]: [ws_quantity#4, ws_sales_price#5, wr_refunded_cdemo_sk#13, wr_returning_cdemo_sk#15, wr_fee#18, wr_refunded_cash#19, r_reason_desc#26] -Arguments: [wr_refunded_cdemo_sk#13 ASC NULLS FIRST, wr_returning_cdemo_sk#15 ASC NULLS FIRST], false, 0 +(41) Project [codegen id : 14] +Output [5]: [ws_quantity#4, ws_sold_date_sk#7, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19] +Input [9]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, ca_address_sk#31, ca_state#32] -(42) Scan parquet default.customer_demographics -Output [3]: [cd_demo_sk#33, cd_marital_status#34, cd_education_status#35] +(42) Scan parquet default.date_dim +Output [2]: [d_date_sk#35, d_year#36] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), Or(Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Advanced Degree )),And(EqualTo(cd_marital_status,S),EqualTo(cd_education_status,College ))),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,2 yr Degree )))] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct -(43) ColumnarToRow [codegen id : 11] -Input [3]: [cd_demo_sk#33, cd_marital_status#34, cd_education_status#35] +(43) ColumnarToRow [codegen id : 12] +Input [2]: [d_date_sk#35, d_year#36] -(44) Filter [codegen id : 11] -Input [3]: [cd_demo_sk#33, cd_marital_status#34, cd_education_status#35] -Condition : (((isnotnull(cd_demo_sk#33) AND isnotnull(cd_marital_status#34)) AND isnotnull(cd_education_status#35)) AND ((((cd_marital_status#34 = M) AND (cd_education_status#35 = Advanced Degree )) OR ((cd_marital_status#34 = S) AND (cd_education_status#35 = College ))) OR ((cd_marital_status#34 = W) AND (cd_education_status#35 = 2 yr Degree )))) +(44) Filter [codegen id : 12] +Input [2]: [d_date_sk#35, d_year#36] +Condition : ((isnotnull(d_year#36) AND (d_year#36 = 2000)) AND isnotnull(d_date_sk#35)) -(45) BroadcastExchange -Input [3]: [cd_demo_sk#33, cd_marital_status#34, cd_education_status#35] -Arguments: HashedRelationBroadcastMode(List(input[1, string, false], input[2, string, false]),false), [id=#36] +(45) Project [codegen id : 12] +Output [1]: [d_date_sk#35] +Input [2]: [d_date_sk#35, d_year#36] -(46) Scan parquet default.customer_demographics -Output [3]: [cd_demo_sk#37, cd_marital_status#38, cd_education_status#39] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status), IsNotNull(cd_education_status)] -ReadSchema: struct +(46) BroadcastExchange +Input [1]: [d_date_sk#35] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#37] -(47) ColumnarToRow -Input [3]: [cd_demo_sk#37, cd_marital_status#38, cd_education_status#39] +(47) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#7] +Right keys [1]: [d_date_sk#35] +Join condition: None -(48) Filter -Input [3]: [cd_demo_sk#37, cd_marital_status#38, cd_education_status#39] -Condition : ((isnotnull(cd_demo_sk#37) AND isnotnull(cd_marital_status#38)) AND isnotnull(cd_education_status#39)) +(48) Project [codegen id : 14] +Output [4]: [ws_quantity#4, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19] +Input [6]: [ws_quantity#4, ws_sold_date_sk#7, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, d_date_sk#35] -(49) BroadcastHashJoin [codegen id : 12] -Left keys [2]: [cd_marital_status#34, cd_education_status#35] -Right keys [2]: [cd_marital_status#38, cd_education_status#39] -Join condition: None +(49) Scan parquet default.reason +Output [2]: [r_reason_sk#38, r_reason_desc#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/reason] +PushedFilters: [IsNotNull(r_reason_sk)] +ReadSchema: struct -(50) Project [codegen id : 12] -Output [4]: [cd_demo_sk#33, cd_marital_status#34, cd_education_status#35, cd_demo_sk#37] -Input [6]: [cd_demo_sk#33, cd_marital_status#34, cd_education_status#35, cd_demo_sk#37, cd_marital_status#38, cd_education_status#39] +(50) ColumnarToRow [codegen id : 13] +Input [2]: [r_reason_sk#38, r_reason_desc#39] -(51) Exchange -Input [4]: [cd_demo_sk#33, cd_marital_status#34, cd_education_status#35, cd_demo_sk#37] -Arguments: hashpartitioning(cast(cd_demo_sk#33 as bigint), cast(cd_demo_sk#37 as bigint), 5), ENSURE_REQUIREMENTS, [id=#40] +(51) Filter [codegen id : 13] +Input [2]: [r_reason_sk#38, r_reason_desc#39] +Condition : isnotnull(r_reason_sk#38) -(52) Sort [codegen id : 13] -Input [4]: [cd_demo_sk#33, cd_marital_status#34, cd_education_status#35, cd_demo_sk#37] -Arguments: [cast(cd_demo_sk#33 as bigint) ASC NULLS FIRST, cast(cd_demo_sk#37 as bigint) ASC NULLS FIRST], false, 0 +(52) BroadcastExchange +Input [2]: [r_reason_sk#38, r_reason_desc#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] -(53) SortMergeJoin [codegen id : 14] -Left keys [2]: [wr_refunded_cdemo_sk#13, wr_returning_cdemo_sk#15] -Right keys [2]: [cast(cd_demo_sk#33 as bigint), cast(cd_demo_sk#37 as bigint)] -Join condition: ((((((cd_marital_status#34 = M) AND (cd_education_status#35 = Advanced Degree )) AND (ws_sales_price#5 >= 100.00)) AND (ws_sales_price#5 <= 150.00)) OR ((((cd_marital_status#34 = S) AND (cd_education_status#35 = College )) AND (ws_sales_price#5 >= 50.00)) AND (ws_sales_price#5 <= 100.00))) OR ((((cd_marital_status#34 = W) AND (cd_education_status#35 = 2 yr Degree )) AND (ws_sales_price#5 >= 150.00)) AND (ws_sales_price#5 <= 200.00))) +(53) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [wr_reason_sk#16] +Right keys [1]: [r_reason_sk#38] +Join condition: None (54) Project [codegen id : 14] -Output [4]: [ws_quantity#4, wr_fee#18, wr_refunded_cash#19, r_reason_desc#26] -Input [11]: [ws_quantity#4, ws_sales_price#5, wr_refunded_cdemo_sk#13, wr_returning_cdemo_sk#15, wr_fee#18, wr_refunded_cash#19, r_reason_desc#26, cd_demo_sk#33, cd_marital_status#34, cd_education_status#35, cd_demo_sk#37] +Output [4]: [ws_quantity#4, wr_fee#18, wr_refunded_cash#19, r_reason_desc#39] +Input [6]: [ws_quantity#4, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, r_reason_sk#38, r_reason_desc#39] (55) HashAggregate [codegen id : 14] -Input [4]: [ws_quantity#4, wr_fee#18, wr_refunded_cash#19, r_reason_desc#26] -Keys [1]: [r_reason_desc#26] +Input [4]: [ws_quantity#4, wr_fee#18, wr_refunded_cash#19, r_reason_desc#39] +Keys [1]: [r_reason_desc#39] Functions [3]: [partial_avg(ws_quantity#4), partial_avg(UnscaledValue(wr_refunded_cash#19)), partial_avg(UnscaledValue(wr_fee#18))] Aggregate Attributes [6]: [sum#41, count#42, sum#43, count#44, sum#45, count#46] -Results [7]: [r_reason_desc#26, sum#47, count#48, sum#49, count#50, sum#51, count#52] +Results [7]: [r_reason_desc#39, sum#47, count#48, sum#49, count#50, sum#51, count#52] (56) Exchange -Input [7]: [r_reason_desc#26, sum#47, count#48, sum#49, count#50, sum#51, count#52] -Arguments: hashpartitioning(r_reason_desc#26, 5), ENSURE_REQUIREMENTS, [id=#53] +Input [7]: [r_reason_desc#39, sum#47, count#48, sum#49, count#50, sum#51, count#52] +Arguments: hashpartitioning(r_reason_desc#39, 5), ENSURE_REQUIREMENTS, [id=#53] (57) HashAggregate [codegen id : 15] -Input [7]: [r_reason_desc#26, sum#47, count#48, sum#49, count#50, sum#51, count#52] -Keys [1]: [r_reason_desc#26] +Input [7]: [r_reason_desc#39, sum#47, count#48, sum#49, count#50, sum#51, count#52] +Keys [1]: [r_reason_desc#39] Functions [3]: [avg(ws_quantity#4), avg(UnscaledValue(wr_refunded_cash#19)), avg(UnscaledValue(wr_fee#18))] Aggregate Attributes [3]: [avg(ws_quantity#4)#54, avg(UnscaledValue(wr_refunded_cash#19))#55, avg(UnscaledValue(wr_fee#18))#56] -Results [4]: [substr(r_reason_desc#26, 1, 20) AS substr(r_reason_desc, 1, 20)#57, avg(ws_quantity#4)#54 AS avg(ws_quantity)#58, cast((avg(UnscaledValue(wr_refunded_cash#19))#55 / 100.0) as decimal(11,6)) AS avg(wr_refunded_cash)#59, cast((avg(UnscaledValue(wr_fee#18))#56 / 100.0) as decimal(11,6)) AS avg(wr_fee)#60] +Results [4]: [substr(r_reason_desc#39, 1, 20) AS substr(r_reason_desc, 1, 20)#57, avg(ws_quantity#4)#54 AS avg(ws_quantity)#58, cast((avg(UnscaledValue(wr_refunded_cash#19))#55 / 100.0) as decimal(11,6)) AS avg(wr_refunded_cash)#59, cast((avg(UnscaledValue(wr_fee#18))#56 / 100.0) as decimal(11,6)) AS avg(wr_fee)#60] (58) TakeOrderedAndProject Input [4]: [substr(r_reason_desc, 1, 20)#57, avg(ws_quantity)#58, avg(wr_refunded_cash)#59, avg(wr_fee)#60] @@ -327,7 +327,7 @@ Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#7 IN dyn ReusedExchange (59) -(59) ReusedExchange [Reuses operator id: 24] -Output [1]: [d_date_sk#22] +(59) ReusedExchange [Reuses operator id: 46] +Output [1]: [d_date_sk#35] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt index 2d27d525986b3..135c097574bd2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt @@ -6,92 +6,92 @@ TakeOrderedAndProject [substr(r_reason_desc, 1, 20),avg(ws_quantity),avg(wr_refu WholeStageCodegen (14) HashAggregate [r_reason_desc,ws_quantity,wr_refunded_cash,wr_fee] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] Project [ws_quantity,wr_fee,wr_refunded_cash,r_reason_desc] - SortMergeJoin [wr_refunded_cdemo_sk,wr_returning_cdemo_sk,cd_demo_sk,cd_demo_sk,cd_marital_status,cd_education_status,ws_sales_price] - InputAdapter - WholeStageCodegen (10) - Sort [wr_refunded_cdemo_sk,wr_returning_cdemo_sk] - InputAdapter - Exchange [wr_refunded_cdemo_sk,wr_returning_cdemo_sk] #2 - WholeStageCodegen (9) - Project [ws_quantity,ws_sales_price,wr_refunded_cdemo_sk,wr_returning_cdemo_sk,wr_fee,wr_refunded_cash,r_reason_desc] - BroadcastHashJoin [wr_refunded_addr_sk,ca_address_sk,ca_state,ws_net_profit] - Project [ws_quantity,ws_sales_price,ws_net_profit,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_fee,wr_refunded_cash,r_reason_desc] - BroadcastHashJoin [wr_reason_sk,r_reason_sk] - Project [ws_quantity,ws_sales_price,ws_net_profit,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_fee,wr_refunded_cash] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_fee,wr_refunded_cash] - SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] - InputAdapter - WholeStageCodegen (3) - Sort [ws_item_sk,ws_order_number] - InputAdapter - Exchange [ws_item_sk,ws_order_number] #3 - WholeStageCodegen (2) - Project [ws_item_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk] - BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] - Filter [ws_item_sk,ws_order_number,ws_web_page_sk,ws_sales_price,ws_net_profit] - ColumnarToRow + BroadcastHashJoin [wr_reason_sk,r_reason_sk] + Project [ws_quantity,wr_reason_sk,wr_fee,wr_refunded_cash] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_quantity,ws_sold_date_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + BroadcastHashJoin [wr_refunded_addr_sk,ca_address_sk,ca_state,ws_net_profit] + Project [ws_quantity,ws_net_profit,ws_sold_date_sk,wr_refunded_addr_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + SortMergeJoin [wr_returning_cdemo_sk,cd_marital_status,cd_education_status,cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + WholeStageCodegen (8) + Sort [wr_returning_cdemo_sk,cd_marital_status,cd_education_status] + InputAdapter + Exchange [wr_returning_cdemo_sk,cd_marital_status,cd_education_status] #2 + WholeStageCodegen (7) + Project [ws_quantity,ws_net_profit,ws_sold_date_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_fee,wr_refunded_cash,cd_marital_status,cd_education_status] + BroadcastHashJoin [wr_refunded_cdemo_sk,cd_demo_sk,cd_marital_status,cd_education_status,ws_sales_price] + Project [ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] + InputAdapter + WholeStageCodegen (3) + Sort [ws_item_sk,ws_order_number] + InputAdapter + Exchange [ws_item_sk,ws_order_number] #3 + WholeStageCodegen (2) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Filter [ws_item_sk,ws_order_number,ws_web_page_sk,ws_sales_price,ws_net_profit] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_page_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 InputAdapter - Scan parquet default.web_sales [ws_item_sk,ws_web_page_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk] - SubqueryBroadcast [d_date_sk] #1 - ReusedExchange [d_date_sk] #4 - InputAdapter - BroadcastExchange #5 - WholeStageCodegen (1) - Filter [wp_web_page_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_page [wp_web_page_sk] + BroadcastExchange #5 + WholeStageCodegen (1) + Filter [wp_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_page [wp_web_page_sk] + InputAdapter + WholeStageCodegen (5) + Sort [wr_item_sk,wr_order_number] + InputAdapter + Exchange [wr_item_sk,wr_order_number] #6 + WholeStageCodegen (4) + Project [wr_item_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_order_number,wr_fee,wr_refunded_cash] + Filter [wr_item_sk,wr_order_number,wr_refunded_cdemo_sk,wr_returning_cdemo_sk,wr_refunded_addr_sk,wr_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_order_number,wr_fee,wr_refunded_cash,wr_returned_date_sk] InputAdapter - WholeStageCodegen (5) - Sort [wr_item_sk,wr_order_number] - InputAdapter - Exchange [wr_item_sk,wr_order_number] #6 - WholeStageCodegen (4) - Project [wr_item_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_order_number,wr_fee,wr_refunded_cash] - Filter [wr_item_sk,wr_order_number,wr_refunded_cdemo_sk,wr_returning_cdemo_sk,wr_refunded_addr_sk,wr_reason_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_returns [wr_item_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_order_number,wr_fee,wr_refunded_cash,wr_returned_date_sk] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (6) - Project [d_date_sk] - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - BroadcastExchange #7 - WholeStageCodegen (7) - Filter [r_reason_sk] - ColumnarToRow - InputAdapter - Scan parquet default.reason [r_reason_sk,r_reason_desc] - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (8) - Project [ca_address_sk,ca_state] - Filter [ca_country,ca_address_sk,ca_state] + BroadcastExchange #7 + WholeStageCodegen (6) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + WholeStageCodegen (10) + Sort [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + Exchange [cd_demo_sk,cd_marital_status,cd_education_status] #8 + WholeStageCodegen (9) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] - InputAdapter - WholeStageCodegen (13) - Sort [cd_demo_sk,cd_demo_sk] - InputAdapter - Exchange [cd_demo_sk,cd_demo_sk] #9 - WholeStageCodegen (12) - Project [cd_demo_sk,cd_marital_status,cd_education_status,cd_demo_sk] - BroadcastHashJoin [cd_marital_status,cd_education_status,cd_marital_status,cd_education_status] - InputAdapter - BroadcastExchange #10 - WholeStageCodegen (11) - Filter [cd_demo_sk,cd_marital_status,cd_education_status] - ColumnarToRow - InputAdapter - Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] - Filter [cd_demo_sk,cd_marital_status,cd_education_status] + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (11) + Project [ca_address_sk,ca_state] + Filter [ca_country,ca_address_sk,ca_state] ColumnarToRow InputAdapter - Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (12) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (13) + Filter [r_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.reason [r_reason_sk,r_reason_desc] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/explain.txt index 74a9aa3dec985..b244c6f3810c6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/explain.txt @@ -70,14 +70,14 @@ Condition : ((((isnotnull(ws_item_sk#1) AND isnotnull(ws_order_number#3)) AND is (4) BroadcastExchange Input [7]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[2, int, false] as bigint)),false), [id=#9] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[2, int, false] as bigint) & 4294967295))),false), [id=#9] (5) Scan parquet default.web_returns Output [9]: [wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_order_number#15, wr_fee#16, wr_refunded_cash#17, wr_returned_date_sk#18] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number), IsNotNull(wr_refunded_cdemo_sk), IsNotNull(wr_returning_cdemo_sk), IsNotNull(wr_refunded_addr_sk), IsNotNull(wr_reason_sk)] -ReadSchema: struct +ReadSchema: struct (6) ColumnarToRow Input [9]: [wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_order_number#15, wr_fee#16, wr_refunded_cash#17, wr_returned_date_sk#18] @@ -91,7 +91,7 @@ Output [8]: [wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_ Input [9]: [wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_order_number#15, wr_fee#16, wr_refunded_cash#17, wr_returned_date_sk#18] (9) BroadcastHashJoin [codegen id : 8] -Left keys [2]: [cast(ws_item_sk#1 as bigint), cast(ws_order_number#3 as bigint)] +Left keys [2]: [ws_item_sk#1, ws_order_number#3] Right keys [2]: [wr_item_sk#10, wr_order_number#15] Join condition: None @@ -146,7 +146,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (21) BroadcastHashJoin [codegen id : 8] Left keys [1]: [wr_refunded_cdemo_sk#11] -Right keys [1]: [cast(cd_demo_sk#21 as bigint)] +Right keys [1]: [cd_demo_sk#21] Join condition: ((((((cd_marital_status#22 = M) AND (cd_education_status#23 = Advanced Degree )) AND (ws_sales_price#5 >= 100.00)) AND (ws_sales_price#5 <= 150.00)) OR ((((cd_marital_status#22 = S) AND (cd_education_status#23 = College )) AND (ws_sales_price#5 >= 50.00)) AND (ws_sales_price#5 <= 100.00))) OR ((((cd_marital_status#22 = W) AND (cd_education_status#23 = 2 yr Degree )) AND (ws_sales_price#5 >= 150.00)) AND (ws_sales_price#5 <= 200.00))) (22) Project [codegen id : 8] @@ -169,11 +169,11 @@ Condition : ((isnotnull(cd_demo_sk#25) AND isnotnull(cd_marital_status#26)) AND (26) BroadcastExchange Input [3]: [cd_demo_sk#25, cd_marital_status#26, cd_education_status#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), input[1, string, false], input[2, string, false]),false), [id=#28] +Arguments: HashedRelationBroadcastMode(List(input[0, int, false], input[1, string, false], input[2, string, false]),false), [id=#28] (27) BroadcastHashJoin [codegen id : 8] Left keys [3]: [wr_returning_cdemo_sk#13, cd_marital_status#22, cd_education_status#23] -Right keys [3]: [cast(cd_demo_sk#25 as bigint), cd_marital_status#26, cd_education_status#27] +Right keys [3]: [cd_demo_sk#25, cd_marital_status#26, cd_education_status#27] Join condition: None (28) Project [codegen id : 8] @@ -204,7 +204,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (34) BroadcastHashJoin [codegen id : 8] Left keys [1]: [wr_refunded_addr_sk#12] -Right keys [1]: [cast(ca_address_sk#29 as bigint)] +Right keys [1]: [ca_address_sk#29] Join condition: ((((ca_state#30 IN (IN,OH,NJ) AND (ws_net_profit#6 >= 100.00)) AND (ws_net_profit#6 <= 200.00)) OR ((ca_state#30 IN (WI,CT,KY) AND (ws_net_profit#6 >= 150.00)) AND (ws_net_profit#6 <= 300.00))) OR ((ca_state#30 IN (LA,IA,AR) AND (ws_net_profit#6 >= 50.00)) AND (ws_net_profit#6 <= 250.00))) (35) Project [codegen id : 8] @@ -262,7 +262,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (47) BroadcastHashJoin [codegen id : 8] Left keys [1]: [wr_reason_sk#14] -Right keys [1]: [cast(r_reason_sk#36 as bigint)] +Right keys [1]: [r_reason_sk#36] Join condition: None (48) Project [codegen id : 8] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/explain.txt index 2466a4d38f21e..01b7b7f5e20c8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/explain.txt @@ -30,7 +30,7 @@ Output [5]: [sr_item_sk#1, sr_reason_sk#2, sr_ticket_number#3, sr_return_quantit Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number), IsNotNull(sr_reason_sk)] -ReadSchema: struct +ReadSchema: struct (2) ColumnarToRow [codegen id : 2] Input [5]: [sr_item_sk#1, sr_reason_sk#2, sr_ticket_number#3, sr_return_quantity#4, sr_returned_date_sk#5] @@ -67,7 +67,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (10) BroadcastHashJoin [codegen id : 2] Left keys [1]: [sr_reason_sk#2] -Right keys [1]: [cast(r_reason_sk#6 as bigint)] +Right keys [1]: [r_reason_sk#6] Join condition: None (11) Project [codegen id : 2] @@ -97,15 +97,15 @@ Input [6]: [ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#1 (17) Exchange Input [5]: [ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#13, ss_sales_price#14] -Arguments: hashpartitioning(cast(ss_item_sk#10 as bigint), cast(ss_ticket_number#12 as bigint), 5), ENSURE_REQUIREMENTS, [id=#16] +Arguments: hashpartitioning(ss_item_sk#10, ss_ticket_number#12, 5), ENSURE_REQUIREMENTS, [id=#16] (18) Sort [codegen id : 5] Input [5]: [ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#13, ss_sales_price#14] -Arguments: [cast(ss_item_sk#10 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#12 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#10 ASC NULLS FIRST, ss_ticket_number#12 ASC NULLS FIRST], false, 0 (19) SortMergeJoin [codegen id : 6] Left keys [2]: [sr_item_sk#1, sr_ticket_number#3] -Right keys [2]: [cast(ss_item_sk#10 as bigint), cast(ss_ticket_number#12 as bigint)] +Right keys [2]: [ss_item_sk#10, ss_ticket_number#12] Join condition: None (20) Project [codegen id : 6] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/explain.txt index 1f3470198cd20..54b9ae752c7a0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/explain.txt @@ -40,18 +40,18 @@ Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, s (4) Exchange Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_sales_price#5] -Arguments: hashpartitioning(cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#3 as bigint), 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#3, 5), ENSURE_REQUIREMENTS, [id=#7] (5) Sort [codegen id : 2] Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_sales_price#5] -Arguments: [cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#3 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#3 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [5]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number), IsNotNull(sr_reason_sk)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [5]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] @@ -73,7 +73,7 @@ Input [4]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantit Arguments: [sr_item_sk#8 ASC NULLS FIRST, sr_ticket_number#10 ASC NULLS FIRST], false, 0 (12) SortMergeJoin [codegen id : 6] -Left keys [2]: [cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#3 as bigint)] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#3] Right keys [2]: [sr_item_sk#8, sr_ticket_number#10] Join condition: None @@ -105,7 +105,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (19) BroadcastHashJoin [codegen id : 6] Left keys [1]: [sr_reason_sk#9] -Right keys [1]: [cast(r_reason_sk#14 as bigint)] +Right keys [1]: [r_reason_sk#14] Join condition: None (20) Project [codegen id : 6] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt index 8a5b567285939..840f300eadff4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt @@ -1,53 +1,50 @@ == Physical Plan == -* Sort (49) -+- * HashAggregate (48) - +- Exchange (47) - +- * HashAggregate (46) - +- * HashAggregate (45) - +- Exchange (44) - +- * HashAggregate (43) - +- * Project (42) - +- * BroadcastHashJoin Inner BuildRight (41) - :- * Project (35) - : +- * BroadcastHashJoin Inner BuildRight (34) - : :- * Project (28) - : : +- * BroadcastHashJoin Inner BuildRight (27) - : : :- SortMergeJoin LeftAnti (21) - : : : :- * Sort (15) - : : : : +- Exchange (14) - : : : : +- * Project (13) - : : : : +- SortMergeJoin LeftSemi (12) - : : : : :- * Sort (6) - : : : : : +- Exchange (5) - : : : : : +- * Project (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.web_sales (1) - : : : : +- * Sort (11) - : : : : +- Exchange (10) - : : : : +- * Project (9) - : : : : +- * ColumnarToRow (8) - : : : : +- Scan parquet default.web_sales (7) - : : : +- * Sort (20) - : : : +- Exchange (19) - : : : +- * Project (18) - : : : +- * ColumnarToRow (17) - : : : +- Scan parquet default.web_returns (16) - : : +- BroadcastExchange (26) - : : +- * Project (25) - : : +- * Filter (24) - : : +- * ColumnarToRow (23) - : : +- Scan parquet default.customer_address (22) - : +- BroadcastExchange (33) - : +- * Project (32) - : +- * Filter (31) - : +- * ColumnarToRow (30) - : +- Scan parquet default.web_site (29) - +- BroadcastExchange (40) - +- * Project (39) - +- * Filter (38) - +- * ColumnarToRow (37) - +- Scan parquet default.date_dim (36) +* Sort (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- * HashAggregate (41) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- SortMergeJoin LeftAnti (19) + : : : :- * Project (13) + : : : : +- SortMergeJoin LeftSemi (12) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.web_sales (7) + : : : +- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.web_returns (14) + : : +- BroadcastExchange (24) + : : +- * Project (23) + : : +- * Filter (22) + : : +- * ColumnarToRow (21) + : : +- Scan parquet default.customer_address (20) + : +- BroadcastExchange (31) + : +- * Project (30) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.web_site (27) + +- BroadcastExchange (38) + +- * Project (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.date_dim (34) (1) Scan parquet default.web_sales @@ -106,170 +103,158 @@ Join condition: NOT (ws_warehouse_sk#4 = ws_warehouse_sk#10) Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -(14) Exchange -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: hashpartitioning(cast(ws_order_number#5 as bigint), 5), ENSURE_REQUIREMENTS, [id=#14] - -(15) Sort [codegen id : 6] -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: [cast(ws_order_number#5 as bigint) ASC NULLS FIRST], false, 0 - -(16) Scan parquet default.web_returns -Output [2]: [wr_order_number#15, wr_returned_date_sk#16] +(14) Scan parquet default.web_returns +Output [2]: [wr_order_number#14, wr_returned_date_sk#15] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] -ReadSchema: struct +ReadSchema: struct -(17) ColumnarToRow [codegen id : 7] -Input [2]: [wr_order_number#15, wr_returned_date_sk#16] +(15) ColumnarToRow [codegen id : 6] +Input [2]: [wr_order_number#14, wr_returned_date_sk#15] -(18) Project [codegen id : 7] -Output [1]: [wr_order_number#15] -Input [2]: [wr_order_number#15, wr_returned_date_sk#16] +(16) Project [codegen id : 6] +Output [1]: [wr_order_number#14] +Input [2]: [wr_order_number#14, wr_returned_date_sk#15] -(19) Exchange -Input [1]: [wr_order_number#15] -Arguments: hashpartitioning(wr_order_number#15, 5), ENSURE_REQUIREMENTS, [id=#17] +(17) Exchange +Input [1]: [wr_order_number#14] +Arguments: hashpartitioning(wr_order_number#14, 5), ENSURE_REQUIREMENTS, [id=#16] -(20) Sort [codegen id : 8] -Input [1]: [wr_order_number#15] -Arguments: [wr_order_number#15 ASC NULLS FIRST], false, 0 +(18) Sort [codegen id : 7] +Input [1]: [wr_order_number#14] +Arguments: [wr_order_number#14 ASC NULLS FIRST], false, 0 -(21) SortMergeJoin -Left keys [1]: [cast(ws_order_number#5 as bigint)] -Right keys [1]: [wr_order_number#15] +(19) SortMergeJoin +Left keys [1]: [ws_order_number#5] +Right keys [1]: [wr_order_number#14] Join condition: None -(22) Scan parquet default.customer_address -Output [2]: [ca_address_sk#18, ca_state#19] +(20) Scan parquet default.customer_address +Output [2]: [ca_address_sk#17, ca_state#18] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] ReadSchema: struct -(23) ColumnarToRow [codegen id : 9] -Input [2]: [ca_address_sk#18, ca_state#19] +(21) ColumnarToRow [codegen id : 8] +Input [2]: [ca_address_sk#17, ca_state#18] -(24) Filter [codegen id : 9] -Input [2]: [ca_address_sk#18, ca_state#19] -Condition : ((isnotnull(ca_state#19) AND (ca_state#19 = IL)) AND isnotnull(ca_address_sk#18)) +(22) Filter [codegen id : 8] +Input [2]: [ca_address_sk#17, ca_state#18] +Condition : ((isnotnull(ca_state#18) AND (ca_state#18 = IL)) AND isnotnull(ca_address_sk#17)) -(25) Project [codegen id : 9] -Output [1]: [ca_address_sk#18] -Input [2]: [ca_address_sk#18, ca_state#19] +(23) Project [codegen id : 8] +Output [1]: [ca_address_sk#17] +Input [2]: [ca_address_sk#17, ca_state#18] -(26) BroadcastExchange -Input [1]: [ca_address_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +(24) BroadcastExchange +Input [1]: [ca_address_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] -(27) BroadcastHashJoin [codegen id : 12] +(25) BroadcastHashJoin [codegen id : 11] Left keys [1]: [ws_ship_addr_sk#2] -Right keys [1]: [ca_address_sk#18] +Right keys [1]: [ca_address_sk#17] Join condition: None -(28) Project [codegen id : 12] +(26) Project [codegen id : 11] Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#18] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#17] -(29) Scan parquet default.web_site -Output [2]: [web_site_sk#21, web_company_name#22] +(27) Scan parquet default.web_site +Output [2]: [web_site_sk#20, web_company_name#21] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri ), IsNotNull(web_site_sk)] ReadSchema: struct -(30) ColumnarToRow [codegen id : 10] -Input [2]: [web_site_sk#21, web_company_name#22] +(28) ColumnarToRow [codegen id : 9] +Input [2]: [web_site_sk#20, web_company_name#21] -(31) Filter [codegen id : 10] -Input [2]: [web_site_sk#21, web_company_name#22] -Condition : ((isnotnull(web_company_name#22) AND (web_company_name#22 = pri )) AND isnotnull(web_site_sk#21)) +(29) Filter [codegen id : 9] +Input [2]: [web_site_sk#20, web_company_name#21] +Condition : ((isnotnull(web_company_name#21) AND (web_company_name#21 = pri )) AND isnotnull(web_site_sk#20)) -(32) Project [codegen id : 10] -Output [1]: [web_site_sk#21] -Input [2]: [web_site_sk#21, web_company_name#22] +(30) Project [codegen id : 9] +Output [1]: [web_site_sk#20] +Input [2]: [web_site_sk#20, web_company_name#21] -(33) BroadcastExchange -Input [1]: [web_site_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +(31) BroadcastExchange +Input [1]: [web_site_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] -(34) BroadcastHashJoin [codegen id : 12] +(32) BroadcastHashJoin [codegen id : 11] Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#21] +Right keys [1]: [web_site_sk#20] Join condition: None -(35) Project [codegen id : 12] +(33) Project [codegen id : 11] Output [4]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#21] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#20] -(36) Scan parquet default.date_dim -Output [2]: [d_date_sk#24, d_date#25] +(34) Scan parquet default.date_dim +Output [2]: [d_date_sk#23, d_date#24] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] ReadSchema: struct -(37) ColumnarToRow [codegen id : 11] -Input [2]: [d_date_sk#24, d_date#25] +(35) ColumnarToRow [codegen id : 10] +Input [2]: [d_date_sk#23, d_date#24] -(38) Filter [codegen id : 11] -Input [2]: [d_date_sk#24, d_date#25] -Condition : (((isnotnull(d_date#25) AND (d_date#25 >= 1999-02-01)) AND (d_date#25 <= 1999-04-02)) AND isnotnull(d_date_sk#24)) +(36) Filter [codegen id : 10] +Input [2]: [d_date_sk#23, d_date#24] +Condition : (((isnotnull(d_date#24) AND (d_date#24 >= 1999-02-01)) AND (d_date#24 <= 1999-04-02)) AND isnotnull(d_date_sk#23)) -(39) Project [codegen id : 11] -Output [1]: [d_date_sk#24] -Input [2]: [d_date_sk#24, d_date#25] +(37) Project [codegen id : 10] +Output [1]: [d_date_sk#23] +Input [2]: [d_date_sk#23, d_date#24] -(40) BroadcastExchange -Input [1]: [d_date_sk#24] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] +(38) BroadcastExchange +Input [1]: [d_date_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] -(41) BroadcastHashJoin [codegen id : 12] +(39) BroadcastHashJoin [codegen id : 11] Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#24] +Right keys [1]: [d_date_sk#23] Join condition: None -(42) Project [codegen id : 12] +(40) Project [codegen id : 11] Output [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [5]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#24] +Input [5]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#23] -(43) HashAggregate [codegen id : 12] +(41) HashAggregate [codegen id : 11] Input [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] Keys [1]: [ws_order_number#5] Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#6)), partial_sum(UnscaledValue(ws_net_profit#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#27, sum(UnscaledValue(ws_net_profit#7))#28] -Results [3]: [ws_order_number#5, sum#29, sum#30] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27] +Results [3]: [ws_order_number#5, sum#28, sum#29] -(44) Exchange -Input [3]: [ws_order_number#5, sum#29, sum#30] -Arguments: hashpartitioning(ws_order_number#5, 5), ENSURE_REQUIREMENTS, [id=#31] - -(45) HashAggregate [codegen id : 13] -Input [3]: [ws_order_number#5, sum#29, sum#30] +(42) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, sum#28, sum#29] Keys [1]: [ws_order_number#5] Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#27, sum(UnscaledValue(ws_net_profit#7))#28] -Results [3]: [ws_order_number#5, sum#29, sum#30] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27] +Results [3]: [ws_order_number#5, sum#28, sum#29] -(46) HashAggregate [codegen id : 13] -Input [3]: [ws_order_number#5, sum#29, sum#30] +(43) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, sum#28, sum#29] Keys: [] Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7)), partial_count(distinct ws_order_number#5)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#27, sum(UnscaledValue(ws_net_profit#7))#28, count(ws_order_number#5)#32] -Results [3]: [sum#29, sum#30, count#33] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27, count(ws_order_number#5)#30] +Results [3]: [sum#28, sum#29, count#31] -(47) Exchange -Input [3]: [sum#29, sum#30, count#33] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#34] +(44) Exchange +Input [3]: [sum#28, sum#29, count#31] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#32] -(48) HashAggregate [codegen id : 14] -Input [3]: [sum#29, sum#30, count#33] +(45) HashAggregate [codegen id : 12] +Input [3]: [sum#28, sum#29, count#31] Keys: [] Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#6)), sum(UnscaledValue(ws_net_profit#7)), count(distinct ws_order_number#5)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#27, sum(UnscaledValue(ws_net_profit#7))#28, count(ws_order_number#5)#32] -Results [3]: [count(ws_order_number#5)#32 AS order count #35, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#6))#27,17,2) AS total shipping cost #36, MakeDecimal(sum(UnscaledValue(ws_net_profit#7))#28,17,2) AS total net profit #37] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27, count(ws_order_number#5)#30] +Results [3]: [count(ws_order_number#5)#30 AS order count #33, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#6))#26,17,2) AS total shipping cost #34, MakeDecimal(sum(UnscaledValue(ws_net_profit#7))#27,17,2) AS total net profit #35] -(49) Sort [codegen id : 14] -Input [3]: [order count #35, total shipping cost #36, total net profit #37] -Arguments: [order count #35 ASC NULLS FIRST], true, 0 +(46) Sort [codegen id : 12] +Input [3]: [order count #33, total shipping cost #34, total net profit #35] +Arguments: [order count #33 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt index 3ef7977c4bc64..4a60f03335730 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt @@ -1,80 +1,73 @@ -WholeStageCodegen (14) +WholeStageCodegen (12) Sort [order count ] HashAggregate [sum,sum,count] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] InputAdapter Exchange #1 - WholeStageCodegen (13) + WholeStageCodegen (11) HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),sum,sum,count,sum,sum,count] HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] - InputAdapter - Exchange [ws_order_number] #2 - WholeStageCodegen (12) - HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] - Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] - Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] - Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] - InputAdapter - SortMergeJoin [ws_order_number,wr_order_number] - WholeStageCodegen (6) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #3 - WholeStageCodegen (5) - Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - InputAdapter - SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] - WholeStageCodegen (2) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #4 - WholeStageCodegen (1) - Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] - WholeStageCodegen (4) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #5 - WholeStageCodegen (3) - Project [ws_warehouse_sk,ws_order_number] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] - WholeStageCodegen (8) - Sort [wr_order_number] - InputAdapter - Exchange [wr_order_number] #6 - WholeStageCodegen (7) - Project [wr_order_number] - ColumnarToRow - InputAdapter - Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] - InputAdapter - BroadcastExchange #7 - WholeStageCodegen (9) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] + HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + InputAdapter + SortMergeJoin [ws_order_number,wr_order_number] + WholeStageCodegen (5) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + InputAdapter + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + WholeStageCodegen (2) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #2 + WholeStageCodegen (1) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] + WholeStageCodegen (4) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #3 + WholeStageCodegen (3) + Project [ws_warehouse_sk,ws_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] + WholeStageCodegen (7) + Sort [wr_order_number] + InputAdapter + Exchange [wr_order_number] #4 + WholeStageCodegen (6) + Project [wr_order_number] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (10) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] - InputAdapter - BroadcastExchange #9 - WholeStageCodegen (11) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (9) + Project [web_site_sk] + Filter [web_company_name,web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_company_name] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (10) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/explain.txt index 042d4a3e347a2..607f12f77e4c1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/explain.txt @@ -1,53 +1,50 @@ == Physical Plan == -* Sort (49) -+- * HashAggregate (48) - +- Exchange (47) - +- * HashAggregate (46) - +- * HashAggregate (45) - +- Exchange (44) - +- * HashAggregate (43) - +- * Project (42) - +- * BroadcastHashJoin Inner BuildRight (41) - :- * Project (35) - : +- * BroadcastHashJoin Inner BuildRight (34) - : :- * Project (28) - : : +- * BroadcastHashJoin Inner BuildRight (27) - : : :- SortMergeJoin LeftAnti (21) - : : : :- * Sort (15) - : : : : +- Exchange (14) - : : : : +- * Project (13) - : : : : +- SortMergeJoin LeftSemi (12) - : : : : :- * Sort (6) - : : : : : +- Exchange (5) - : : : : : +- * Project (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.web_sales (1) - : : : : +- * Sort (11) - : : : : +- Exchange (10) - : : : : +- * Project (9) - : : : : +- * ColumnarToRow (8) - : : : : +- Scan parquet default.web_sales (7) - : : : +- * Sort (20) - : : : +- Exchange (19) - : : : +- * Project (18) - : : : +- * ColumnarToRow (17) - : : : +- Scan parquet default.web_returns (16) - : : +- BroadcastExchange (26) - : : +- * Project (25) - : : +- * Filter (24) - : : +- * ColumnarToRow (23) - : : +- Scan parquet default.date_dim (22) - : +- BroadcastExchange (33) - : +- * Project (32) - : +- * Filter (31) - : +- * ColumnarToRow (30) - : +- Scan parquet default.customer_address (29) - +- BroadcastExchange (40) - +- * Project (39) - +- * Filter (38) - +- * ColumnarToRow (37) - +- Scan parquet default.web_site (36) +* Sort (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- * HashAggregate (41) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- SortMergeJoin LeftAnti (19) + : : : :- * Project (13) + : : : : +- SortMergeJoin LeftSemi (12) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.web_sales (7) + : : : +- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.web_returns (14) + : : +- BroadcastExchange (24) + : : +- * Project (23) + : : +- * Filter (22) + : : +- * ColumnarToRow (21) + : : +- Scan parquet default.date_dim (20) + : +- BroadcastExchange (31) + : +- * Project (30) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.customer_address (27) + +- BroadcastExchange (38) + +- * Project (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.web_site (34) (1) Scan parquet default.web_sales @@ -106,170 +103,158 @@ Join condition: NOT (ws_warehouse_sk#4 = ws_warehouse_sk#10) Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -(14) Exchange -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: hashpartitioning(cast(ws_order_number#5 as bigint), 5), ENSURE_REQUIREMENTS, [id=#14] - -(15) Sort [codegen id : 6] -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: [cast(ws_order_number#5 as bigint) ASC NULLS FIRST], false, 0 - -(16) Scan parquet default.web_returns -Output [2]: [wr_order_number#15, wr_returned_date_sk#16] +(14) Scan parquet default.web_returns +Output [2]: [wr_order_number#14, wr_returned_date_sk#15] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] -ReadSchema: struct +ReadSchema: struct -(17) ColumnarToRow [codegen id : 7] -Input [2]: [wr_order_number#15, wr_returned_date_sk#16] +(15) ColumnarToRow [codegen id : 6] +Input [2]: [wr_order_number#14, wr_returned_date_sk#15] -(18) Project [codegen id : 7] -Output [1]: [wr_order_number#15] -Input [2]: [wr_order_number#15, wr_returned_date_sk#16] +(16) Project [codegen id : 6] +Output [1]: [wr_order_number#14] +Input [2]: [wr_order_number#14, wr_returned_date_sk#15] -(19) Exchange -Input [1]: [wr_order_number#15] -Arguments: hashpartitioning(wr_order_number#15, 5), ENSURE_REQUIREMENTS, [id=#17] +(17) Exchange +Input [1]: [wr_order_number#14] +Arguments: hashpartitioning(wr_order_number#14, 5), ENSURE_REQUIREMENTS, [id=#16] -(20) Sort [codegen id : 8] -Input [1]: [wr_order_number#15] -Arguments: [wr_order_number#15 ASC NULLS FIRST], false, 0 +(18) Sort [codegen id : 7] +Input [1]: [wr_order_number#14] +Arguments: [wr_order_number#14 ASC NULLS FIRST], false, 0 -(21) SortMergeJoin -Left keys [1]: [cast(ws_order_number#5 as bigint)] -Right keys [1]: [wr_order_number#15] +(19) SortMergeJoin +Left keys [1]: [ws_order_number#5] +Right keys [1]: [wr_order_number#14] Join condition: None -(22) Scan parquet default.date_dim -Output [2]: [d_date_sk#18, d_date#19] +(20) Scan parquet default.date_dim +Output [2]: [d_date_sk#17, d_date#18] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] ReadSchema: struct -(23) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#18, d_date#19] +(21) ColumnarToRow [codegen id : 8] +Input [2]: [d_date_sk#17, d_date#18] -(24) Filter [codegen id : 9] -Input [2]: [d_date_sk#18, d_date#19] -Condition : (((isnotnull(d_date#19) AND (d_date#19 >= 1999-02-01)) AND (d_date#19 <= 1999-04-02)) AND isnotnull(d_date_sk#18)) +(22) Filter [codegen id : 8] +Input [2]: [d_date_sk#17, d_date#18] +Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 1999-02-01)) AND (d_date#18 <= 1999-04-02)) AND isnotnull(d_date_sk#17)) -(25) Project [codegen id : 9] -Output [1]: [d_date_sk#18] -Input [2]: [d_date_sk#18, d_date#19] +(23) Project [codegen id : 8] +Output [1]: [d_date_sk#17] +Input [2]: [d_date_sk#17, d_date#18] -(26) BroadcastExchange -Input [1]: [d_date_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +(24) BroadcastExchange +Input [1]: [d_date_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] -(27) BroadcastHashJoin [codegen id : 12] +(25) BroadcastHashJoin [codegen id : 11] Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#18] +Right keys [1]: [d_date_sk#17] Join condition: None -(28) Project [codegen id : 12] +(26) Project [codegen id : 11] Output [5]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#18] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#17] -(29) Scan parquet default.customer_address -Output [2]: [ca_address_sk#21, ca_state#22] +(27) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_state#21] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] ReadSchema: struct -(30) ColumnarToRow [codegen id : 10] -Input [2]: [ca_address_sk#21, ca_state#22] +(28) ColumnarToRow [codegen id : 9] +Input [2]: [ca_address_sk#20, ca_state#21] -(31) Filter [codegen id : 10] -Input [2]: [ca_address_sk#21, ca_state#22] -Condition : ((isnotnull(ca_state#22) AND (ca_state#22 = IL)) AND isnotnull(ca_address_sk#21)) +(29) Filter [codegen id : 9] +Input [2]: [ca_address_sk#20, ca_state#21] +Condition : ((isnotnull(ca_state#21) AND (ca_state#21 = IL)) AND isnotnull(ca_address_sk#20)) -(32) Project [codegen id : 10] -Output [1]: [ca_address_sk#21] -Input [2]: [ca_address_sk#21, ca_state#22] +(30) Project [codegen id : 9] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_state#21] -(33) BroadcastExchange -Input [1]: [ca_address_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +(31) BroadcastExchange +Input [1]: [ca_address_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] -(34) BroadcastHashJoin [codegen id : 12] +(32) BroadcastHashJoin [codegen id : 11] Left keys [1]: [ws_ship_addr_sk#2] -Right keys [1]: [ca_address_sk#21] +Right keys [1]: [ca_address_sk#20] Join condition: None -(35) Project [codegen id : 12] +(33) Project [codegen id : 11] Output [4]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [6]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#21] +Input [6]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#20] -(36) Scan parquet default.web_site -Output [2]: [web_site_sk#24, web_company_name#25] +(34) Scan parquet default.web_site +Output [2]: [web_site_sk#23, web_company_name#24] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri ), IsNotNull(web_site_sk)] ReadSchema: struct -(37) ColumnarToRow [codegen id : 11] -Input [2]: [web_site_sk#24, web_company_name#25] +(35) ColumnarToRow [codegen id : 10] +Input [2]: [web_site_sk#23, web_company_name#24] -(38) Filter [codegen id : 11] -Input [2]: [web_site_sk#24, web_company_name#25] -Condition : ((isnotnull(web_company_name#25) AND (web_company_name#25 = pri )) AND isnotnull(web_site_sk#24)) +(36) Filter [codegen id : 10] +Input [2]: [web_site_sk#23, web_company_name#24] +Condition : ((isnotnull(web_company_name#24) AND (web_company_name#24 = pri )) AND isnotnull(web_site_sk#23)) -(39) Project [codegen id : 11] -Output [1]: [web_site_sk#24] -Input [2]: [web_site_sk#24, web_company_name#25] +(37) Project [codegen id : 10] +Output [1]: [web_site_sk#23] +Input [2]: [web_site_sk#23, web_company_name#24] -(40) BroadcastExchange -Input [1]: [web_site_sk#24] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] +(38) BroadcastExchange +Input [1]: [web_site_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] -(41) BroadcastHashJoin [codegen id : 12] +(39) BroadcastHashJoin [codegen id : 11] Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#24] +Right keys [1]: [web_site_sk#23] Join condition: None -(42) Project [codegen id : 12] +(40) Project [codegen id : 11] Output [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [5]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#24] +Input [5]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#23] -(43) HashAggregate [codegen id : 12] +(41) HashAggregate [codegen id : 11] Input [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] Keys [1]: [ws_order_number#5] Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#6)), partial_sum(UnscaledValue(ws_net_profit#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#27, sum(UnscaledValue(ws_net_profit#7))#28] -Results [3]: [ws_order_number#5, sum#29, sum#30] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27] +Results [3]: [ws_order_number#5, sum#28, sum#29] -(44) Exchange -Input [3]: [ws_order_number#5, sum#29, sum#30] -Arguments: hashpartitioning(ws_order_number#5, 5), ENSURE_REQUIREMENTS, [id=#31] - -(45) HashAggregate [codegen id : 13] -Input [3]: [ws_order_number#5, sum#29, sum#30] +(42) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, sum#28, sum#29] Keys [1]: [ws_order_number#5] Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#27, sum(UnscaledValue(ws_net_profit#7))#28] -Results [3]: [ws_order_number#5, sum#29, sum#30] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27] +Results [3]: [ws_order_number#5, sum#28, sum#29] -(46) HashAggregate [codegen id : 13] -Input [3]: [ws_order_number#5, sum#29, sum#30] +(43) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, sum#28, sum#29] Keys: [] Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7)), partial_count(distinct ws_order_number#5)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#27, sum(UnscaledValue(ws_net_profit#7))#28, count(ws_order_number#5)#32] -Results [3]: [sum#29, sum#30, count#33] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27, count(ws_order_number#5)#30] +Results [3]: [sum#28, sum#29, count#31] -(47) Exchange -Input [3]: [sum#29, sum#30, count#33] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#34] +(44) Exchange +Input [3]: [sum#28, sum#29, count#31] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#32] -(48) HashAggregate [codegen id : 14] -Input [3]: [sum#29, sum#30, count#33] +(45) HashAggregate [codegen id : 12] +Input [3]: [sum#28, sum#29, count#31] Keys: [] Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#6)), sum(UnscaledValue(ws_net_profit#7)), count(distinct ws_order_number#5)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#27, sum(UnscaledValue(ws_net_profit#7))#28, count(ws_order_number#5)#32] -Results [3]: [count(ws_order_number#5)#32 AS order count #35, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#6))#27,17,2) AS total shipping cost #36, MakeDecimal(sum(UnscaledValue(ws_net_profit#7))#28,17,2) AS total net profit #37] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27, count(ws_order_number#5)#30] +Results [3]: [count(ws_order_number#5)#30 AS order count #33, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#6))#26,17,2) AS total shipping cost #34, MakeDecimal(sum(UnscaledValue(ws_net_profit#7))#27,17,2) AS total net profit #35] -(49) Sort [codegen id : 14] -Input [3]: [order count #35, total shipping cost #36, total net profit #37] -Arguments: [order count #35 ASC NULLS FIRST], true, 0 +(46) Sort [codegen id : 12] +Input [3]: [order count #33, total shipping cost #34, total net profit #35] +Arguments: [order count #33 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/simplified.txt index 6bcd2aa24ccbb..672601d740a87 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/simplified.txt @@ -1,80 +1,73 @@ -WholeStageCodegen (14) +WholeStageCodegen (12) Sort [order count ] HashAggregate [sum,sum,count] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] InputAdapter Exchange #1 - WholeStageCodegen (13) + WholeStageCodegen (11) HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),sum,sum,count,sum,sum,count] HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] - InputAdapter - Exchange [ws_order_number] #2 - WholeStageCodegen (12) - HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] - Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] - Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] - Project [ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] - InputAdapter - SortMergeJoin [ws_order_number,wr_order_number] - WholeStageCodegen (6) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #3 - WholeStageCodegen (5) - Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - InputAdapter - SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] - WholeStageCodegen (2) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #4 - WholeStageCodegen (1) - Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] - WholeStageCodegen (4) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #5 - WholeStageCodegen (3) - Project [ws_warehouse_sk,ws_order_number] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] - WholeStageCodegen (8) - Sort [wr_order_number] - InputAdapter - Exchange [wr_order_number] #6 - WholeStageCodegen (7) - Project [wr_order_number] - ColumnarToRow - InputAdapter - Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] - InputAdapter - BroadcastExchange #7 - WholeStageCodegen (9) - Project [d_date_sk] - Filter [d_date,d_date_sk] + HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + Project [ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + InputAdapter + SortMergeJoin [ws_order_number,wr_order_number] + WholeStageCodegen (5) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + InputAdapter + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + WholeStageCodegen (2) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #2 + WholeStageCodegen (1) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] + WholeStageCodegen (4) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #3 + WholeStageCodegen (3) + Project [ws_warehouse_sk,ws_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] + WholeStageCodegen (7) + Sort [wr_order_number] + InputAdapter + Exchange [wr_order_number] #4 + WholeStageCodegen (6) + Project [wr_order_number] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (10) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter - BroadcastExchange #9 - WholeStageCodegen (11) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] + Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (9) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (10) + Project [web_site_sk] + Filter [web_company_name,web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt index ee82855f8c010..82e4651d09edf 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt @@ -1,68 +1,62 @@ == Physical Plan == -* Sort (64) -+- * HashAggregate (63) - +- Exchange (62) - +- * HashAggregate (61) - +- * HashAggregate (60) - +- Exchange (59) - +- * HashAggregate (58) - +- * Project (57) - +- * BroadcastHashJoin Inner BuildRight (56) - :- * Project (50) - : +- * BroadcastHashJoin Inner BuildRight (49) - : :- * Project (43) - : : +- * BroadcastHashJoin Inner BuildRight (42) - : : :- SortMergeJoin LeftSemi (36) - : : : :- * Sort (19) - : : : : +- Exchange (18) - : : : : +- SortMergeJoin LeftSemi (17) - : : : : :- * Sort (6) - : : : : : +- Exchange (5) - : : : : : +- * Project (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.web_sales (1) - : : : : +- * Project (16) - : : : : +- * SortMergeJoin Inner (15) - : : : : :- * Sort (12) - : : : : : +- Exchange (11) - : : : : : +- * Project (10) - : : : : : +- * Filter (9) - : : : : : +- * ColumnarToRow (8) - : : : : : +- Scan parquet default.web_sales (7) - : : : : +- * Sort (14) - : : : : +- ReusedExchange (13) - : : : +- * Project (35) - : : : +- * SortMergeJoin Inner (34) - : : : :- * Sort (27) - : : : : +- Exchange (26) - : : : : +- * Project (25) - : : : : +- * SortMergeJoin Inner (24) - : : : : :- * Sort (21) - : : : : : +- ReusedExchange (20) - : : : : +- * Sort (23) - : : : : +- ReusedExchange (22) - : : : +- * Sort (33) - : : : +- Exchange (32) - : : : +- * Project (31) - : : : +- * Filter (30) - : : : +- * ColumnarToRow (29) - : : : +- Scan parquet default.web_returns (28) - : : +- BroadcastExchange (41) - : : +- * Project (40) - : : +- * Filter (39) - : : +- * ColumnarToRow (38) - : : +- Scan parquet default.customer_address (37) - : +- BroadcastExchange (48) - : +- * Project (47) - : +- * Filter (46) - : +- * ColumnarToRow (45) - : +- Scan parquet default.web_site (44) - +- BroadcastExchange (55) - +- * Project (54) - +- * Filter (53) - +- * ColumnarToRow (52) - +- Scan parquet default.date_dim (51) +* Sort (58) ++- * HashAggregate (57) + +- Exchange (56) + +- * HashAggregate (55) + +- * HashAggregate (54) + +- * HashAggregate (53) + +- * Project (52) + +- * BroadcastHashJoin Inner BuildRight (51) + :- * Project (45) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Project (38) + : : +- * BroadcastHashJoin Inner BuildRight (37) + : : :- SortMergeJoin LeftSemi (31) + : : : :- SortMergeJoin LeftSemi (17) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Project (16) + : : : : +- * SortMergeJoin Inner (15) + : : : : :- * Sort (12) + : : : : : +- Exchange (11) + : : : : : +- * Project (10) + : : : : : +- * Filter (9) + : : : : : +- * ColumnarToRow (8) + : : : : : +- Scan parquet default.web_sales (7) + : : : : +- * Sort (14) + : : : : +- ReusedExchange (13) + : : : +- * Project (30) + : : : +- * SortMergeJoin Inner (29) + : : : :- * SortMergeJoin Inner (26) + : : : : :- * Sort (23) + : : : : : +- Exchange (22) + : : : : : +- * Project (21) + : : : : : +- * Filter (20) + : : : : : +- * ColumnarToRow (19) + : : : : : +- Scan parquet default.web_returns (18) + : : : : +- * Sort (25) + : : : : +- ReusedExchange (24) + : : : +- * Sort (28) + : : : +- ReusedExchange (27) + : : +- BroadcastExchange (36) + : : +- * Project (35) + : : +- * Filter (34) + : : +- * ColumnarToRow (33) + : : +- Scan parquet default.customer_address (32) + : +- BroadcastExchange (43) + : +- * Project (42) + : +- * Filter (41) + : +- * ColumnarToRow (40) + : +- Scan parquet default.web_site (39) + +- BroadcastExchange (50) + +- * Project (49) + +- * Filter (48) + +- * ColumnarToRow (47) + +- Scan parquet default.date_dim (46) (1) Scan parquet default.web_sales @@ -138,215 +132,191 @@ Left keys [1]: [ws_order_number#4] Right keys [1]: [ws_order_number#10] Join condition: None -(18) Exchange -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Arguments: hashpartitioning(cast(ws_order_number#4 as bigint), 5), ENSURE_REQUIREMENTS, [id=#15] +(18) Scan parquet default.web_returns +Output [2]: [wr_order_number#15, wr_returned_date_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number)] +ReadSchema: struct -(19) Sort [codegen id : 8] -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Arguments: [cast(ws_order_number#4 as bigint) ASC NULLS FIRST], false, 0 +(19) ColumnarToRow [codegen id : 8] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] + +(20) Filter [codegen id : 8] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] +Condition : isnotnull(wr_order_number#15) -(20) ReusedExchange [Reuses operator id: 11] -Output [2]: [ws_warehouse_sk#16, ws_order_number#17] +(21) Project [codegen id : 8] +Output [1]: [wr_order_number#15] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] -(21) Sort [codegen id : 10] -Input [2]: [ws_warehouse_sk#16, ws_order_number#17] -Arguments: [ws_order_number#17 ASC NULLS FIRST], false, 0 +(22) Exchange +Input [1]: [wr_order_number#15] +Arguments: hashpartitioning(wr_order_number#15, 5), ENSURE_REQUIREMENTS, [id=#17] -(22) ReusedExchange [Reuses operator id: 11] +(23) Sort [codegen id : 9] +Input [1]: [wr_order_number#15] +Arguments: [wr_order_number#15 ASC NULLS FIRST], false, 0 + +(24) ReusedExchange [Reuses operator id: 11] Output [2]: [ws_warehouse_sk#18, ws_order_number#19] -(23) Sort [codegen id : 12] +(25) Sort [codegen id : 11] Input [2]: [ws_warehouse_sk#18, ws_order_number#19] Arguments: [ws_order_number#19 ASC NULLS FIRST], false, 0 -(24) SortMergeJoin [codegen id : 13] -Left keys [1]: [ws_order_number#17] +(26) SortMergeJoin [codegen id : 12] +Left keys [1]: [wr_order_number#15] Right keys [1]: [ws_order_number#19] -Join condition: NOT (ws_warehouse_sk#16 = ws_warehouse_sk#18) - -(25) Project [codegen id : 13] -Output [1]: [ws_order_number#17] -Input [4]: [ws_warehouse_sk#16, ws_order_number#17, ws_warehouse_sk#18, ws_order_number#19] - -(26) Exchange -Input [1]: [ws_order_number#17] -Arguments: hashpartitioning(cast(ws_order_number#17 as bigint), 5), ENSURE_REQUIREMENTS, [id=#20] - -(27) Sort [codegen id : 14] -Input [1]: [ws_order_number#17] -Arguments: [cast(ws_order_number#17 as bigint) ASC NULLS FIRST], false, 0 - -(28) Scan parquet default.web_returns -Output [2]: [wr_order_number#21, wr_returned_date_sk#22] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_returns] -PushedFilters: [IsNotNull(wr_order_number)] -ReadSchema: struct - -(29) ColumnarToRow [codegen id : 15] -Input [2]: [wr_order_number#21, wr_returned_date_sk#22] - -(30) Filter [codegen id : 15] -Input [2]: [wr_order_number#21, wr_returned_date_sk#22] -Condition : isnotnull(wr_order_number#21) - -(31) Project [codegen id : 15] -Output [1]: [wr_order_number#21] -Input [2]: [wr_order_number#21, wr_returned_date_sk#22] +Join condition: None -(32) Exchange -Input [1]: [wr_order_number#21] -Arguments: hashpartitioning(wr_order_number#21, 5), ENSURE_REQUIREMENTS, [id=#23] +(27) ReusedExchange [Reuses operator id: 11] +Output [2]: [ws_warehouse_sk#20, ws_order_number#21] -(33) Sort [codegen id : 16] -Input [1]: [wr_order_number#21] -Arguments: [wr_order_number#21 ASC NULLS FIRST], false, 0 +(28) Sort [codegen id : 14] +Input [2]: [ws_warehouse_sk#20, ws_order_number#21] +Arguments: [ws_order_number#21 ASC NULLS FIRST], false, 0 -(34) SortMergeJoin [codegen id : 17] -Left keys [1]: [cast(ws_order_number#17 as bigint)] -Right keys [1]: [wr_order_number#21] -Join condition: None +(29) SortMergeJoin [codegen id : 15] +Left keys [1]: [ws_order_number#19] +Right keys [1]: [ws_order_number#21] +Join condition: NOT (ws_warehouse_sk#18 = ws_warehouse_sk#20) -(35) Project [codegen id : 17] -Output [1]: [wr_order_number#21] -Input [2]: [ws_order_number#17, wr_order_number#21] +(30) Project [codegen id : 15] +Output [1]: [wr_order_number#15] +Input [5]: [wr_order_number#15, ws_warehouse_sk#18, ws_order_number#19, ws_warehouse_sk#20, ws_order_number#21] -(36) SortMergeJoin -Left keys [1]: [cast(ws_order_number#4 as bigint)] -Right keys [1]: [wr_order_number#21] +(31) SortMergeJoin +Left keys [1]: [ws_order_number#4] +Right keys [1]: [wr_order_number#15] Join condition: None -(37) Scan parquet default.customer_address -Output [2]: [ca_address_sk#24, ca_state#25] +(32) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_state#23] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] ReadSchema: struct -(38) ColumnarToRow [codegen id : 18] -Input [2]: [ca_address_sk#24, ca_state#25] +(33) ColumnarToRow [codegen id : 16] +Input [2]: [ca_address_sk#22, ca_state#23] -(39) Filter [codegen id : 18] -Input [2]: [ca_address_sk#24, ca_state#25] -Condition : ((isnotnull(ca_state#25) AND (ca_state#25 = IL)) AND isnotnull(ca_address_sk#24)) +(34) Filter [codegen id : 16] +Input [2]: [ca_address_sk#22, ca_state#23] +Condition : ((isnotnull(ca_state#23) AND (ca_state#23 = IL)) AND isnotnull(ca_address_sk#22)) -(40) Project [codegen id : 18] -Output [1]: [ca_address_sk#24] -Input [2]: [ca_address_sk#24, ca_state#25] +(35) Project [codegen id : 16] +Output [1]: [ca_address_sk#22] +Input [2]: [ca_address_sk#22, ca_state#23] -(41) BroadcastExchange -Input [1]: [ca_address_sk#24] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] +(36) BroadcastExchange +Input [1]: [ca_address_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] -(42) BroadcastHashJoin [codegen id : 21] +(37) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_ship_addr_sk#2] -Right keys [1]: [ca_address_sk#24] +Right keys [1]: [ca_address_sk#22] Join condition: None -(43) Project [codegen id : 21] +(38) Project [codegen id : 19] Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#24] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#22] -(44) Scan parquet default.web_site -Output [2]: [web_site_sk#27, web_company_name#28] +(39) Scan parquet default.web_site +Output [2]: [web_site_sk#25, web_company_name#26] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri ), IsNotNull(web_site_sk)] ReadSchema: struct -(45) ColumnarToRow [codegen id : 19] -Input [2]: [web_site_sk#27, web_company_name#28] +(40) ColumnarToRow [codegen id : 17] +Input [2]: [web_site_sk#25, web_company_name#26] -(46) Filter [codegen id : 19] -Input [2]: [web_site_sk#27, web_company_name#28] -Condition : ((isnotnull(web_company_name#28) AND (web_company_name#28 = pri )) AND isnotnull(web_site_sk#27)) +(41) Filter [codegen id : 17] +Input [2]: [web_site_sk#25, web_company_name#26] +Condition : ((isnotnull(web_company_name#26) AND (web_company_name#26 = pri )) AND isnotnull(web_site_sk#25)) -(47) Project [codegen id : 19] -Output [1]: [web_site_sk#27] -Input [2]: [web_site_sk#27, web_company_name#28] +(42) Project [codegen id : 17] +Output [1]: [web_site_sk#25] +Input [2]: [web_site_sk#25, web_company_name#26] -(48) BroadcastExchange -Input [1]: [web_site_sk#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +(43) BroadcastExchange +Input [1]: [web_site_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] -(49) BroadcastHashJoin [codegen id : 21] +(44) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#27] +Right keys [1]: [web_site_sk#25] Join condition: None -(50) Project [codegen id : 21] +(45) Project [codegen id : 19] Output [4]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#27] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#25] -(51) Scan parquet default.date_dim -Output [2]: [d_date_sk#30, d_date#31] +(46) Scan parquet default.date_dim +Output [2]: [d_date_sk#28, d_date#29] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] ReadSchema: struct -(52) ColumnarToRow [codegen id : 20] -Input [2]: [d_date_sk#30, d_date#31] +(47) ColumnarToRow [codegen id : 18] +Input [2]: [d_date_sk#28, d_date#29] -(53) Filter [codegen id : 20] -Input [2]: [d_date_sk#30, d_date#31] -Condition : (((isnotnull(d_date#31) AND (d_date#31 >= 1999-02-01)) AND (d_date#31 <= 1999-04-02)) AND isnotnull(d_date_sk#30)) +(48) Filter [codegen id : 18] +Input [2]: [d_date_sk#28, d_date#29] +Condition : (((isnotnull(d_date#29) AND (d_date#29 >= 1999-02-01)) AND (d_date#29 <= 1999-04-02)) AND isnotnull(d_date_sk#28)) -(54) Project [codegen id : 20] -Output [1]: [d_date_sk#30] -Input [2]: [d_date_sk#30, d_date#31] +(49) Project [codegen id : 18] +Output [1]: [d_date_sk#28] +Input [2]: [d_date_sk#28, d_date#29] -(55) BroadcastExchange -Input [1]: [d_date_sk#30] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#32] +(50) BroadcastExchange +Input [1]: [d_date_sk#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] -(56) BroadcastHashJoin [codegen id : 21] +(51) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#30] +Right keys [1]: [d_date_sk#28] Join condition: None -(57) Project [codegen id : 21] +(52) Project [codegen id : 19] Output [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [5]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#30] +Input [5]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#28] -(58) HashAggregate [codegen id : 21] +(53) HashAggregate [codegen id : 19] Input [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] Keys [1]: [ws_order_number#4] Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#5)), partial_sum(UnscaledValue(ws_net_profit#6))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#33, sum(UnscaledValue(ws_net_profit#6))#34] -Results [3]: [ws_order_number#4, sum#35, sum#36] - -(59) Exchange -Input [3]: [ws_order_number#4, sum#35, sum#36] -Arguments: hashpartitioning(ws_order_number#4, 5), ENSURE_REQUIREMENTS, [id=#37] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32] +Results [3]: [ws_order_number#4, sum#33, sum#34] -(60) HashAggregate [codegen id : 22] -Input [3]: [ws_order_number#4, sum#35, sum#36] +(54) HashAggregate [codegen id : 19] +Input [3]: [ws_order_number#4, sum#33, sum#34] Keys [1]: [ws_order_number#4] Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#33, sum(UnscaledValue(ws_net_profit#6))#34] -Results [3]: [ws_order_number#4, sum#35, sum#36] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32] +Results [3]: [ws_order_number#4, sum#33, sum#34] -(61) HashAggregate [codegen id : 22] -Input [3]: [ws_order_number#4, sum#35, sum#36] +(55) HashAggregate [codegen id : 19] +Input [3]: [ws_order_number#4, sum#33, sum#34] Keys: [] Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6)), partial_count(distinct ws_order_number#4)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#33, sum(UnscaledValue(ws_net_profit#6))#34, count(ws_order_number#4)#38] -Results [3]: [sum#35, sum#36, count#39] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32, count(ws_order_number#4)#35] +Results [3]: [sum#33, sum#34, count#36] -(62) Exchange -Input [3]: [sum#35, sum#36, count#39] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#40] +(56) Exchange +Input [3]: [sum#33, sum#34, count#36] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#37] -(63) HashAggregate [codegen id : 23] -Input [3]: [sum#35, sum#36, count#39] +(57) HashAggregate [codegen id : 20] +Input [3]: [sum#33, sum#34, count#36] Keys: [] Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#5)), sum(UnscaledValue(ws_net_profit#6)), count(distinct ws_order_number#4)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#33, sum(UnscaledValue(ws_net_profit#6))#34, count(ws_order_number#4)#38] -Results [3]: [count(ws_order_number#4)#38 AS order count #41, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#5))#33,17,2) AS total shipping cost #42, MakeDecimal(sum(UnscaledValue(ws_net_profit#6))#34,17,2) AS total net profit #43] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32, count(ws_order_number#4)#35] +Results [3]: [count(ws_order_number#4)#35 AS order count #38, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#5))#31,17,2) AS total shipping cost #39, MakeDecimal(sum(UnscaledValue(ws_net_profit#6))#32,17,2) AS total net profit #40] -(64) Sort [codegen id : 23] -Input [3]: [order count #41, total shipping cost #42, total net profit #43] -Arguments: [order count #41 ASC NULLS FIRST], true, 0 +(58) Sort [codegen id : 20] +Input [3]: [order count #38, total shipping cost #39, total net profit #40] +Arguments: [order count #38 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt index 439f3935c65a3..83b9eed3cd2af 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt @@ -1,110 +1,98 @@ -WholeStageCodegen (23) +WholeStageCodegen (20) Sort [order count ] HashAggregate [sum,sum,count] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] InputAdapter Exchange #1 - WholeStageCodegen (22) + WholeStageCodegen (19) HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),sum,sum,count,sum,sum,count] HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] - InputAdapter - Exchange [ws_order_number] #2 - WholeStageCodegen (21) - HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] - Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] - Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] - Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] - InputAdapter - SortMergeJoin [ws_order_number,wr_order_number] - WholeStageCodegen (8) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #3 - SortMergeJoin [ws_order_number,ws_order_number] - WholeStageCodegen (2) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #4 - WholeStageCodegen (1) - Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] - WholeStageCodegen (7) - Project [ws_order_number] - SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] - InputAdapter - WholeStageCodegen (4) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #5 - WholeStageCodegen (3) - Project [ws_warehouse_sk,ws_order_number] - Filter [ws_order_number,ws_warehouse_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] - InputAdapter - WholeStageCodegen (6) - Sort [ws_order_number] - InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #5 - WholeStageCodegen (17) - Project [wr_order_number] - SortMergeJoin [ws_order_number,wr_order_number] - InputAdapter - WholeStageCodegen (14) - Sort [ws_order_number] + HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + InputAdapter + SortMergeJoin [ws_order_number,wr_order_number] + SortMergeJoin [ws_order_number,ws_order_number] + WholeStageCodegen (2) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #2 + WholeStageCodegen (1) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] + ColumnarToRow InputAdapter - Exchange [ws_order_number] #6 - WholeStageCodegen (13) - Project [ws_order_number] - SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] - InputAdapter - WholeStageCodegen (10) - Sort [ws_order_number] - InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #5 - InputAdapter - WholeStageCodegen (12) - Sort [ws_order_number] - InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #5 + Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] + WholeStageCodegen (7) + Project [ws_order_number] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #3 + WholeStageCodegen (3) + Project [ws_warehouse_sk,ws_order_number] + Filter [ws_order_number,ws_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + WholeStageCodegen (15) + Project [wr_order_number] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (12) + SortMergeJoin [wr_order_number,ws_order_number] InputAdapter - WholeStageCodegen (16) + WholeStageCodegen (9) Sort [wr_order_number] InputAdapter - Exchange [wr_order_number] #7 - WholeStageCodegen (15) + Exchange [wr_order_number] #4 + WholeStageCodegen (8) Project [wr_order_number] Filter [wr_order_number] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (18) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter - BroadcastExchange #9 - WholeStageCodegen (19) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] - InputAdapter - BroadcastExchange #10 - WholeStageCodegen (20) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow + InputAdapter + WholeStageCodegen (11) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (14) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (16) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (17) + Project [web_site_sk] + Filter [web_company_name,web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_company_name] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (18) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/explain.txt index 73f7f88aeb68d..687e050b44090 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/explain.txt @@ -1,68 +1,63 @@ == Physical Plan == -* Sort (64) -+- * HashAggregate (63) - +- Exchange (62) - +- * HashAggregate (61) - +- * HashAggregate (60) - +- Exchange (59) - +- * HashAggregate (58) - +- * Project (57) - +- * BroadcastHashJoin Inner BuildRight (56) - :- * Project (50) - : +- * BroadcastHashJoin Inner BuildRight (49) - : :- * Project (43) - : : +- * BroadcastHashJoin Inner BuildRight (42) - : : :- SortMergeJoin LeftSemi (36) - : : : :- * Sort (19) - : : : : +- Exchange (18) - : : : : +- SortMergeJoin LeftSemi (17) - : : : : :- * Sort (6) - : : : : : +- Exchange (5) - : : : : : +- * Project (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.web_sales (1) - : : : : +- * Project (16) - : : : : +- * SortMergeJoin Inner (15) - : : : : :- * Sort (12) - : : : : : +- Exchange (11) - : : : : : +- * Project (10) - : : : : : +- * Filter (9) - : : : : : +- * ColumnarToRow (8) - : : : : : +- Scan parquet default.web_sales (7) - : : : : +- * Sort (14) - : : : : +- ReusedExchange (13) - : : : +- * Project (35) - : : : +- * SortMergeJoin Inner (34) - : : : :- * Sort (25) - : : : : +- Exchange (24) - : : : : +- * Project (23) - : : : : +- * Filter (22) - : : : : +- * ColumnarToRow (21) - : : : : +- Scan parquet default.web_returns (20) - : : : +- * Sort (33) - : : : +- Exchange (32) - : : : +- * Project (31) - : : : +- * SortMergeJoin Inner (30) - : : : :- * Sort (27) - : : : : +- ReusedExchange (26) - : : : +- * Sort (29) - : : : +- ReusedExchange (28) - : : +- BroadcastExchange (41) - : : +- * Project (40) - : : +- * Filter (39) - : : +- * ColumnarToRow (38) - : : +- Scan parquet default.date_dim (37) - : +- BroadcastExchange (48) - : +- * Project (47) - : +- * Filter (46) - : +- * ColumnarToRow (45) - : +- Scan parquet default.customer_address (44) - +- BroadcastExchange (55) - +- * Project (54) - +- * Filter (53) - +- * ColumnarToRow (52) - +- Scan parquet default.web_site (51) +* Sort (59) ++- * HashAggregate (58) + +- Exchange (57) + +- * HashAggregate (56) + +- * HashAggregate (55) + +- * HashAggregate (54) + +- * Project (53) + +- * BroadcastHashJoin Inner BuildRight (52) + :- * Project (46) + : +- * BroadcastHashJoin Inner BuildRight (45) + : :- * Project (39) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- SortMergeJoin LeftSemi (32) + : : : :- SortMergeJoin LeftSemi (17) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Project (16) + : : : : +- * SortMergeJoin Inner (15) + : : : : :- * Sort (12) + : : : : : +- Exchange (11) + : : : : : +- * Project (10) + : : : : : +- * Filter (9) + : : : : : +- * ColumnarToRow (8) + : : : : : +- Scan parquet default.web_sales (7) + : : : : +- * Sort (14) + : : : : +- ReusedExchange (13) + : : : +- * Project (31) + : : : +- * SortMergeJoin Inner (30) + : : : :- * Sort (23) + : : : : +- Exchange (22) + : : : : +- * Project (21) + : : : : +- * Filter (20) + : : : : +- * ColumnarToRow (19) + : : : : +- Scan parquet default.web_returns (18) + : : : +- * Project (29) + : : : +- * SortMergeJoin Inner (28) + : : : :- * Sort (25) + : : : : +- ReusedExchange (24) + : : : +- * Sort (27) + : : : +- ReusedExchange (26) + : : +- BroadcastExchange (37) + : : +- * Project (36) + : : +- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.date_dim (33) + : +- BroadcastExchange (44) + : +- * Project (43) + : +- * Filter (42) + : +- * ColumnarToRow (41) + : +- Scan parquet default.customer_address (40) + +- BroadcastExchange (51) + +- * Project (50) + +- * Filter (49) + +- * ColumnarToRow (48) + +- Scan parquet default.web_site (47) (1) Scan parquet default.web_sales @@ -138,215 +133,195 @@ Left keys [1]: [ws_order_number#4] Right keys [1]: [ws_order_number#10] Join condition: None -(18) Exchange -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Arguments: hashpartitioning(cast(ws_order_number#4 as bigint), 5), ENSURE_REQUIREMENTS, [id=#15] - -(19) Sort [codegen id : 8] -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Arguments: [cast(ws_order_number#4 as bigint) ASC NULLS FIRST], false, 0 - -(20) Scan parquet default.web_returns -Output [2]: [wr_order_number#16, wr_returned_date_sk#17] +(18) Scan parquet default.web_returns +Output [2]: [wr_order_number#15, wr_returned_date_sk#16] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number)] -ReadSchema: struct +ReadSchema: struct -(21) ColumnarToRow [codegen id : 9] -Input [2]: [wr_order_number#16, wr_returned_date_sk#17] +(19) ColumnarToRow [codegen id : 8] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] -(22) Filter [codegen id : 9] -Input [2]: [wr_order_number#16, wr_returned_date_sk#17] -Condition : isnotnull(wr_order_number#16) +(20) Filter [codegen id : 8] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] +Condition : isnotnull(wr_order_number#15) -(23) Project [codegen id : 9] -Output [1]: [wr_order_number#16] -Input [2]: [wr_order_number#16, wr_returned_date_sk#17] +(21) Project [codegen id : 8] +Output [1]: [wr_order_number#15] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] -(24) Exchange -Input [1]: [wr_order_number#16] -Arguments: hashpartitioning(wr_order_number#16, 5), ENSURE_REQUIREMENTS, [id=#18] - -(25) Sort [codegen id : 10] -Input [1]: [wr_order_number#16] -Arguments: [wr_order_number#16 ASC NULLS FIRST], false, 0 - -(26) ReusedExchange [Reuses operator id: 11] -Output [2]: [ws_warehouse_sk#19, ws_order_number#20] +(22) Exchange +Input [1]: [wr_order_number#15] +Arguments: hashpartitioning(wr_order_number#15, 5), ENSURE_REQUIREMENTS, [id=#17] -(27) Sort [codegen id : 12] -Input [2]: [ws_warehouse_sk#19, ws_order_number#20] -Arguments: [ws_order_number#20 ASC NULLS FIRST], false, 0 +(23) Sort [codegen id : 9] +Input [1]: [wr_order_number#15] +Arguments: [wr_order_number#15 ASC NULLS FIRST], false, 0 -(28) ReusedExchange [Reuses operator id: 11] -Output [2]: [ws_warehouse_sk#21, ws_order_number#22] +(24) ReusedExchange [Reuses operator id: 11] +Output [2]: [ws_warehouse_sk#18, ws_order_number#19] -(29) Sort [codegen id : 14] -Input [2]: [ws_warehouse_sk#21, ws_order_number#22] -Arguments: [ws_order_number#22 ASC NULLS FIRST], false, 0 +(25) Sort [codegen id : 11] +Input [2]: [ws_warehouse_sk#18, ws_order_number#19] +Arguments: [ws_order_number#19 ASC NULLS FIRST], false, 0 -(30) SortMergeJoin [codegen id : 15] -Left keys [1]: [ws_order_number#20] -Right keys [1]: [ws_order_number#22] -Join condition: NOT (ws_warehouse_sk#19 = ws_warehouse_sk#21) +(26) ReusedExchange [Reuses operator id: 11] +Output [2]: [ws_warehouse_sk#20, ws_order_number#21] -(31) Project [codegen id : 15] -Output [1]: [ws_order_number#20] -Input [4]: [ws_warehouse_sk#19, ws_order_number#20, ws_warehouse_sk#21, ws_order_number#22] +(27) Sort [codegen id : 13] +Input [2]: [ws_warehouse_sk#20, ws_order_number#21] +Arguments: [ws_order_number#21 ASC NULLS FIRST], false, 0 -(32) Exchange -Input [1]: [ws_order_number#20] -Arguments: hashpartitioning(cast(ws_order_number#20 as bigint), 5), ENSURE_REQUIREMENTS, [id=#23] +(28) SortMergeJoin [codegen id : 14] +Left keys [1]: [ws_order_number#19] +Right keys [1]: [ws_order_number#21] +Join condition: NOT (ws_warehouse_sk#18 = ws_warehouse_sk#20) -(33) Sort [codegen id : 16] -Input [1]: [ws_order_number#20] -Arguments: [cast(ws_order_number#20 as bigint) ASC NULLS FIRST], false, 0 +(29) Project [codegen id : 14] +Output [1]: [ws_order_number#19] +Input [4]: [ws_warehouse_sk#18, ws_order_number#19, ws_warehouse_sk#20, ws_order_number#21] -(34) SortMergeJoin [codegen id : 17] -Left keys [1]: [wr_order_number#16] -Right keys [1]: [cast(ws_order_number#20 as bigint)] +(30) SortMergeJoin [codegen id : 15] +Left keys [1]: [wr_order_number#15] +Right keys [1]: [ws_order_number#19] Join condition: None -(35) Project [codegen id : 17] -Output [1]: [wr_order_number#16] -Input [2]: [wr_order_number#16, ws_order_number#20] +(31) Project [codegen id : 15] +Output [1]: [wr_order_number#15] +Input [2]: [wr_order_number#15, ws_order_number#19] -(36) SortMergeJoin -Left keys [1]: [cast(ws_order_number#4 as bigint)] -Right keys [1]: [wr_order_number#16] +(32) SortMergeJoin +Left keys [1]: [ws_order_number#4] +Right keys [1]: [wr_order_number#15] Join condition: None -(37) Scan parquet default.date_dim -Output [2]: [d_date_sk#24, d_date#25] +(33) Scan parquet default.date_dim +Output [2]: [d_date_sk#22, d_date#23] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] ReadSchema: struct -(38) ColumnarToRow [codegen id : 18] -Input [2]: [d_date_sk#24, d_date#25] +(34) ColumnarToRow [codegen id : 16] +Input [2]: [d_date_sk#22, d_date#23] -(39) Filter [codegen id : 18] -Input [2]: [d_date_sk#24, d_date#25] -Condition : (((isnotnull(d_date#25) AND (d_date#25 >= 1999-02-01)) AND (d_date#25 <= 1999-04-02)) AND isnotnull(d_date_sk#24)) +(35) Filter [codegen id : 16] +Input [2]: [d_date_sk#22, d_date#23] +Condition : (((isnotnull(d_date#23) AND (d_date#23 >= 1999-02-01)) AND (d_date#23 <= 1999-04-02)) AND isnotnull(d_date_sk#22)) -(40) Project [codegen id : 18] -Output [1]: [d_date_sk#24] -Input [2]: [d_date_sk#24, d_date#25] +(36) Project [codegen id : 16] +Output [1]: [d_date_sk#22] +Input [2]: [d_date_sk#22, d_date#23] -(41) BroadcastExchange -Input [1]: [d_date_sk#24] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] +(37) BroadcastExchange +Input [1]: [d_date_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] -(42) BroadcastHashJoin [codegen id : 21] +(38) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#24] +Right keys [1]: [d_date_sk#22] Join condition: None -(43) Project [codegen id : 21] +(39) Project [codegen id : 19] Output [5]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#24] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#22] -(44) Scan parquet default.customer_address -Output [2]: [ca_address_sk#27, ca_state#28] +(40) Scan parquet default.customer_address +Output [2]: [ca_address_sk#25, ca_state#26] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] ReadSchema: struct -(45) ColumnarToRow [codegen id : 19] -Input [2]: [ca_address_sk#27, ca_state#28] +(41) ColumnarToRow [codegen id : 17] +Input [2]: [ca_address_sk#25, ca_state#26] -(46) Filter [codegen id : 19] -Input [2]: [ca_address_sk#27, ca_state#28] -Condition : ((isnotnull(ca_state#28) AND (ca_state#28 = IL)) AND isnotnull(ca_address_sk#27)) +(42) Filter [codegen id : 17] +Input [2]: [ca_address_sk#25, ca_state#26] +Condition : ((isnotnull(ca_state#26) AND (ca_state#26 = IL)) AND isnotnull(ca_address_sk#25)) -(47) Project [codegen id : 19] -Output [1]: [ca_address_sk#27] -Input [2]: [ca_address_sk#27, ca_state#28] +(43) Project [codegen id : 17] +Output [1]: [ca_address_sk#25] +Input [2]: [ca_address_sk#25, ca_state#26] -(48) BroadcastExchange -Input [1]: [ca_address_sk#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +(44) BroadcastExchange +Input [1]: [ca_address_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] -(49) BroadcastHashJoin [codegen id : 21] +(45) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_ship_addr_sk#2] -Right keys [1]: [ca_address_sk#27] +Right keys [1]: [ca_address_sk#25] Join condition: None -(50) Project [codegen id : 21] +(46) Project [codegen id : 19] Output [4]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [6]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#27] +Input [6]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#25] -(51) Scan parquet default.web_site -Output [2]: [web_site_sk#30, web_company_name#31] +(47) Scan parquet default.web_site +Output [2]: [web_site_sk#28, web_company_name#29] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri ), IsNotNull(web_site_sk)] ReadSchema: struct -(52) ColumnarToRow [codegen id : 20] -Input [2]: [web_site_sk#30, web_company_name#31] +(48) ColumnarToRow [codegen id : 18] +Input [2]: [web_site_sk#28, web_company_name#29] -(53) Filter [codegen id : 20] -Input [2]: [web_site_sk#30, web_company_name#31] -Condition : ((isnotnull(web_company_name#31) AND (web_company_name#31 = pri )) AND isnotnull(web_site_sk#30)) +(49) Filter [codegen id : 18] +Input [2]: [web_site_sk#28, web_company_name#29] +Condition : ((isnotnull(web_company_name#29) AND (web_company_name#29 = pri )) AND isnotnull(web_site_sk#28)) -(54) Project [codegen id : 20] -Output [1]: [web_site_sk#30] -Input [2]: [web_site_sk#30, web_company_name#31] +(50) Project [codegen id : 18] +Output [1]: [web_site_sk#28] +Input [2]: [web_site_sk#28, web_company_name#29] -(55) BroadcastExchange -Input [1]: [web_site_sk#30] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#32] +(51) BroadcastExchange +Input [1]: [web_site_sk#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] -(56) BroadcastHashJoin [codegen id : 21] +(52) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#30] +Right keys [1]: [web_site_sk#28] Join condition: None -(57) Project [codegen id : 21] +(53) Project [codegen id : 19] Output [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [5]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#30] +Input [5]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#28] -(58) HashAggregate [codegen id : 21] +(54) HashAggregate [codegen id : 19] Input [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] Keys [1]: [ws_order_number#4] Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#5)), partial_sum(UnscaledValue(ws_net_profit#6))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#33, sum(UnscaledValue(ws_net_profit#6))#34] -Results [3]: [ws_order_number#4, sum#35, sum#36] - -(59) Exchange -Input [3]: [ws_order_number#4, sum#35, sum#36] -Arguments: hashpartitioning(ws_order_number#4, 5), ENSURE_REQUIREMENTS, [id=#37] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32] +Results [3]: [ws_order_number#4, sum#33, sum#34] -(60) HashAggregate [codegen id : 22] -Input [3]: [ws_order_number#4, sum#35, sum#36] +(55) HashAggregate [codegen id : 19] +Input [3]: [ws_order_number#4, sum#33, sum#34] Keys [1]: [ws_order_number#4] Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#33, sum(UnscaledValue(ws_net_profit#6))#34] -Results [3]: [ws_order_number#4, sum#35, sum#36] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32] +Results [3]: [ws_order_number#4, sum#33, sum#34] -(61) HashAggregate [codegen id : 22] -Input [3]: [ws_order_number#4, sum#35, sum#36] +(56) HashAggregate [codegen id : 19] +Input [3]: [ws_order_number#4, sum#33, sum#34] Keys: [] Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6)), partial_count(distinct ws_order_number#4)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#33, sum(UnscaledValue(ws_net_profit#6))#34, count(ws_order_number#4)#38] -Results [3]: [sum#35, sum#36, count#39] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32, count(ws_order_number#4)#35] +Results [3]: [sum#33, sum#34, count#36] -(62) Exchange -Input [3]: [sum#35, sum#36, count#39] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#40] +(57) Exchange +Input [3]: [sum#33, sum#34, count#36] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#37] -(63) HashAggregate [codegen id : 23] -Input [3]: [sum#35, sum#36, count#39] +(58) HashAggregate [codegen id : 20] +Input [3]: [sum#33, sum#34, count#36] Keys: [] Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#5)), sum(UnscaledValue(ws_net_profit#6)), count(distinct ws_order_number#4)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#33, sum(UnscaledValue(ws_net_profit#6))#34, count(ws_order_number#4)#38] -Results [3]: [count(ws_order_number#4)#38 AS order count #41, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#5))#33,17,2) AS total shipping cost #42, MakeDecimal(sum(UnscaledValue(ws_net_profit#6))#34,17,2) AS total net profit #43] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32, count(ws_order_number#4)#35] +Results [3]: [count(ws_order_number#4)#35 AS order count #38, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#5))#31,17,2) AS total shipping cost #39, MakeDecimal(sum(UnscaledValue(ws_net_profit#6))#32,17,2) AS total net profit #40] -(64) Sort [codegen id : 23] -Input [3]: [order count #41, total shipping cost #42, total net profit #43] -Arguments: [order count #41 ASC NULLS FIRST], true, 0 +(59) Sort [codegen id : 20] +Input [3]: [order count #38, total shipping cost #39, total net profit #40] +Arguments: [order count #38 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/simplified.txt index adf95b02f07e5..2372a40bd00d6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/simplified.txt @@ -1,110 +1,99 @@ -WholeStageCodegen (23) +WholeStageCodegen (20) Sort [order count ] HashAggregate [sum,sum,count] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] InputAdapter Exchange #1 - WholeStageCodegen (22) + WholeStageCodegen (19) HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),sum,sum,count,sum,sum,count] HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] - InputAdapter - Exchange [ws_order_number] #2 - WholeStageCodegen (21) - HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] - Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] - Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] - Project [ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] - InputAdapter - SortMergeJoin [ws_order_number,wr_order_number] - WholeStageCodegen (8) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #3 - SortMergeJoin [ws_order_number,ws_order_number] - WholeStageCodegen (2) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #4 - WholeStageCodegen (1) - Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] - WholeStageCodegen (7) - Project [ws_order_number] - SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] - InputAdapter - WholeStageCodegen (4) - Sort [ws_order_number] - InputAdapter - Exchange [ws_order_number] #5 - WholeStageCodegen (3) - Project [ws_warehouse_sk,ws_order_number] - Filter [ws_order_number,ws_warehouse_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] - InputAdapter - WholeStageCodegen (6) - Sort [ws_order_number] - InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #5 - WholeStageCodegen (17) - Project [wr_order_number] - SortMergeJoin [wr_order_number,ws_order_number] - InputAdapter - WholeStageCodegen (10) - Sort [wr_order_number] - InputAdapter - Exchange [wr_order_number] #6 - WholeStageCodegen (9) - Project [wr_order_number] - Filter [wr_order_number] - ColumnarToRow - InputAdapter - Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] - InputAdapter - WholeStageCodegen (16) - Sort [ws_order_number] + HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + Project [ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + InputAdapter + SortMergeJoin [ws_order_number,wr_order_number] + SortMergeJoin [ws_order_number,ws_order_number] + WholeStageCodegen (2) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #2 + WholeStageCodegen (1) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] + ColumnarToRow InputAdapter - Exchange [ws_order_number] #7 - WholeStageCodegen (15) - Project [ws_order_number] - SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] - InputAdapter - WholeStageCodegen (12) - Sort [ws_order_number] - InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #5 - InputAdapter - WholeStageCodegen (14) - Sort [ws_order_number] - InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #5 - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (18) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow + Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] + WholeStageCodegen (7) + Project [ws_order_number] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ws_order_number] InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] - InputAdapter - BroadcastExchange #9 - WholeStageCodegen (19) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter - BroadcastExchange #10 - WholeStageCodegen (20) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] - ColumnarToRow + Exchange [ws_order_number] #3 + WholeStageCodegen (3) + Project [ws_warehouse_sk,ws_order_number] + Filter [ws_order_number,ws_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + WholeStageCodegen (15) + Project [wr_order_number] + SortMergeJoin [wr_order_number,ws_order_number] InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] + WholeStageCodegen (9) + Sort [wr_order_number] + InputAdapter + Exchange [wr_order_number] #4 + WholeStageCodegen (8) + Project [wr_order_number] + Filter [wr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] + InputAdapter + WholeStageCodegen (14) + Project [ws_order_number] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + InputAdapter + WholeStageCodegen (13) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (16) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (17) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (18) + Project [web_site_sk] + Filter [web_company_name,web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt index 1c0ed5c8c188b..7cdc8074e74e1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt @@ -182,18 +182,18 @@ Input [14]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name (30) Exchange Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] -Arguments: hashpartitioning(cast(ss_ticket_number#21 as bigint), cast(ss_item_sk#18 as bigint), 5), ENSURE_REQUIREMENTS, [id=#31] +Arguments: hashpartitioning(ss_ticket_number#21, ss_item_sk#18, 5), ENSURE_REQUIREMENTS, [id=#31] (31) Sort [codegen id : 6] Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] -Arguments: [cast(ss_ticket_number#21 as bigint) ASC NULLS FIRST, cast(ss_item_sk#18 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#21 ASC NULLS FIRST, ss_item_sk#18 ASC NULLS FIRST], false, 0 (32) Scan parquet default.store_returns Output [3]: [sr_item_sk#32, sr_ticket_number#33, sr_returned_date_sk#34] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (33) ColumnarToRow [codegen id : 7] Input [3]: [sr_item_sk#32, sr_ticket_number#33, sr_returned_date_sk#34] @@ -215,7 +215,7 @@ Input [2]: [sr_item_sk#32, sr_ticket_number#33] Arguments: [sr_ticket_number#33 ASC NULLS FIRST, sr_item_sk#32 ASC NULLS FIRST], false, 0 (38) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ss_ticket_number#21 as bigint), cast(ss_item_sk#18 as bigint)] +Left keys [2]: [ss_ticket_number#21, ss_item_sk#18] Right keys [2]: [sr_ticket_number#33, sr_item_sk#32] Join condition: None @@ -472,18 +472,18 @@ Input [14]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_n (82) Exchange Input [13]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] -Arguments: hashpartitioning(cast(ss_ticket_number#72 as bigint), cast(ss_item_sk#69 as bigint), 5), ENSURE_REQUIREMENTS, [id=#83] +Arguments: hashpartitioning(ss_ticket_number#72, ss_item_sk#69, 5), ENSURE_REQUIREMENTS, [id=#83] (83) Sort [codegen id : 9] Input [13]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] -Arguments: [cast(ss_ticket_number#72 as bigint) ASC NULLS FIRST, cast(ss_item_sk#69 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#72 ASC NULLS FIRST, ss_item_sk#69 ASC NULLS FIRST], false, 0 (84) Scan parquet default.store_returns Output [3]: [sr_item_sk#84, sr_ticket_number#85, sr_returned_date_sk#86] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (85) ColumnarToRow [codegen id : 10] Input [3]: [sr_item_sk#84, sr_ticket_number#85, sr_returned_date_sk#86] @@ -505,7 +505,7 @@ Input [2]: [sr_item_sk#84, sr_ticket_number#85] Arguments: [sr_ticket_number#85 ASC NULLS FIRST, sr_item_sk#84 ASC NULLS FIRST], false, 0 (90) SortMergeJoin [codegen id : 12] -Left keys [2]: [cast(ss_ticket_number#72 as bigint), cast(ss_item_sk#69 as bigint)] +Left keys [2]: [ss_ticket_number#72, ss_item_sk#69] Right keys [2]: [sr_ticket_number#85, sr_item_sk#84] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/explain.txt index 7259a3d829613..2686a277825d4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/explain.txt @@ -70,18 +70,18 @@ Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, s (5) Exchange Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#7] (6) Sort [codegen id : 2] Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 (7) Scan parquet default.store_returns Output [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (8) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] @@ -103,7 +103,7 @@ Input [2]: [sr_item_sk#8, sr_ticket_number#9] Arguments: [sr_ticket_number#9 ASC NULLS FIRST, sr_item_sk#8 ASC NULLS FIRST], false, 0 (13) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] Right keys [2]: [sr_ticket_number#9, sr_item_sk#8] Join condition: None @@ -345,18 +345,18 @@ Input [6]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#5 (54) Exchange Input [5]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56] -Arguments: hashpartitioning(cast(ss_ticket_number#55 as bigint), cast(ss_item_sk#52 as bigint), 5), ENSURE_REQUIREMENTS, [id=#58] +Arguments: hashpartitioning(ss_ticket_number#55, ss_item_sk#52, 5), ENSURE_REQUIREMENTS, [id=#58] (55) Sort [codegen id : 2] Input [5]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56] -Arguments: [cast(ss_ticket_number#55 as bigint) ASC NULLS FIRST, cast(ss_item_sk#52 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#55 ASC NULLS FIRST, ss_item_sk#52 ASC NULLS FIRST], false, 0 (56) Scan parquet default.store_returns Output [3]: [sr_item_sk#59, sr_ticket_number#60, sr_returned_date_sk#61] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (57) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#59, sr_ticket_number#60, sr_returned_date_sk#61] @@ -378,7 +378,7 @@ Input [2]: [sr_item_sk#59, sr_ticket_number#60] Arguments: [sr_ticket_number#60 ASC NULLS FIRST, sr_item_sk#59 ASC NULLS FIRST], false, 0 (62) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ss_ticket_number#55 as bigint), cast(ss_item_sk#52 as bigint)] +Left keys [2]: [ss_ticket_number#55, ss_item_sk#52] Right keys [2]: [sr_ticket_number#60, sr_item_sk#59] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt index a1c7e4bfb35dc..b7c20b4826bb6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt @@ -143,18 +143,18 @@ Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_so (12) Exchange Input [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] -Arguments: hashpartitioning(cast(ws_order_number#2 as bigint), cast(ws_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#12] +Arguments: hashpartitioning(ws_order_number#2, ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#12] (13) Sort [codegen id : 3] Input [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] -Arguments: [cast(ws_order_number#2 as bigint) ASC NULLS FIRST, cast(ws_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_order_number#2 ASC NULLS FIRST, ws_item_sk#1 ASC NULLS FIRST], false, 0 (14) Scan parquet default.web_returns Output [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_return_amt), GreaterThan(wr_return_amt,10000.00), IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (15) ColumnarToRow [codegen id : 4] Input [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] @@ -176,7 +176,7 @@ Input [4]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_ Arguments: [wr_order_number#14 ASC NULLS FIRST, wr_item_sk#13 ASC NULLS FIRST], false, 0 (20) SortMergeJoin [codegen id : 6] -Left keys [2]: [cast(ws_order_number#2 as bigint), cast(ws_item_sk#1 as bigint)] +Left keys [2]: [ws_order_number#2, ws_item_sk#1] Right keys [2]: [wr_order_number#14, wr_item_sk#13] Join condition: None @@ -383,18 +383,18 @@ Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, (66) Exchange Input [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] -Arguments: hashpartitioning(cast(ss_ticket_number#82 as bigint), cast(ss_item_sk#81 as bigint), 5), ENSURE_REQUIREMENTS, [id=#88] +Arguments: hashpartitioning(ss_ticket_number#82, ss_item_sk#81, 5), ENSURE_REQUIREMENTS, [id=#88] (67) Sort [codegen id : 23] Input [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] -Arguments: [cast(ss_ticket_number#82 as bigint) ASC NULLS FIRST, cast(ss_item_sk#81 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#82 ASC NULLS FIRST, ss_item_sk#81 ASC NULLS FIRST], false, 0 (68) Scan parquet default.store_returns Output [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_return_amt), GreaterThan(sr_return_amt,10000.00), IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (69) ColumnarToRow [codegen id : 24] Input [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] @@ -416,7 +416,7 @@ Input [4]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return Arguments: [sr_ticket_number#90 ASC NULLS FIRST, sr_item_sk#89 ASC NULLS FIRST], false, 0 (74) SortMergeJoin [codegen id : 26] -Left keys [2]: [cast(ss_ticket_number#82 as bigint), cast(ss_item_sk#81 as bigint)] +Left keys [2]: [ss_ticket_number#82, ss_item_sk#81] Right keys [2]: [sr_ticket_number#90, sr_item_sk#89] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt index 74b789e4a7a65..1665244594850 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt @@ -103,14 +103,14 @@ Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_ne (5) BroadcastExchange Input [5]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint), cast(input[0, int, true] as bigint)),false), [id=#8] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#8] (6) Scan parquet default.web_returns Output [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_return_amt), GreaterThan(wr_return_amt,10000.00), IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] @@ -124,7 +124,7 @@ Output [4]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_ Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] (10) BroadcastHashJoin [codegen id : 3] -Left keys [2]: [cast(ws_order_number#2 as bigint), cast(ws_item_sk#1 as bigint)] +Left keys [2]: [ws_order_number#2, ws_item_sk#1] Right keys [2]: [wr_order_number#10, wr_item_sk#9] Join condition: None @@ -338,14 +338,14 @@ Input [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, (57) BroadcastExchange Input [5]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint), cast(input[0, int, true] as bigint)),false), [id=#85] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#85] (58) Scan parquet default.store_returns Output [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_return_amt), GreaterThan(sr_return_amt,10000.00), IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (59) ColumnarToRow Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] @@ -359,7 +359,7 @@ Output [4]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_retur Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] (62) BroadcastHashJoin [codegen id : 17] -Left keys [2]: [cast(ss_ticket_number#80 as bigint), cast(ss_item_sk#79 as bigint)] +Left keys [2]: [ss_ticket_number#80, ss_item_sk#79] Right keys [2]: [sr_ticket_number#87, sr_item_sk#86] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt index ef8088e415cc5..e660800796abe 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt @@ -99,7 +99,8 @@ TakeOrderedAndProject (94) Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cast(ss_sold_date_sk#4 as bigint)), dynamicpruningexpression(cast(ss_sold_date_sk#4 as bigint) IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] ReadSchema: struct (2) ColumnarToRow [codegen id : 1] @@ -107,10 +108,10 @@ Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_s (3) Filter [codegen id : 1] Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] -Condition : isnotnull(cast(ss_store_sk#1 as bigint)) +Condition : isnotnull(ss_store_sk#1) (4) Project [codegen id : 1] -Output [6]: [cast(ss_store_sk#1 as bigint) AS store_sk#6, cast(ss_sold_date_sk#4 as bigint) AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] +Output [6]: [ss_store_sk#1 AS store_sk#6, ss_sold_date_sk#4 AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] (5) Scan parquet default.store_returns @@ -119,7 +120,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#15), dynamicpruningexpression(sr_returned_date_sk#15 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (6) ColumnarToRow [codegen id : 2] Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] @@ -154,7 +155,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (14) BroadcastHashJoin [codegen id : 5] Left keys [1]: [store_sk#6] -Right keys [1]: [cast(s_store_sk#22 as bigint)] +Right keys [1]: [s_store_sk#22] Join condition: None (15) Project [codegen id : 5] @@ -185,7 +186,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (21) BroadcastHashJoin [codegen id : 5] Left keys [1]: [date_sk#7] -Right keys [1]: [cast(d_date_sk#25 as bigint)] +Right keys [1]: [d_date_sk#25] Join condition: None (22) Project [codegen id : 5] @@ -214,7 +215,7 @@ Results [5]: [store channel AS channel#41, concat(store, s_store_id#23) AS id#42 Output [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#50)] +PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#5)] PushedFilters: [IsNotNull(cs_catalog_page_sk)] ReadSchema: struct @@ -226,217 +227,217 @@ Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_s Condition : isnotnull(cs_catalog_page_sk#46) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#46 AS page_sk#51, cs_sold_date_sk#49 AS date_sk#52, cs_ext_sales_price#47 AS sales_price#53, cs_net_profit#48 AS profit#54, 0.00 AS return_amt#55, 0.00 AS net_loss#56] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#50, cs_sold_date_sk#49 AS date_sk#51, cs_ext_sales_price#47 AS sales_price#52, cs_net_profit#48 AS profit#53, 0.00 AS return_amt#54, 0.00 AS net_loss#55] Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] (30) Scan parquet default.catalog_returns -Output [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Output [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cr_returned_date_sk#60), dynamicpruningexpression(cr_returned_date_sk#60 IN dynamicpruning#50)] +PartitionFilters: [isnotnull(cr_returned_date_sk#59), dynamicpruningexpression(cr_returned_date_sk#59 IN dynamicpruning#5)] PushedFilters: [IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] (32) Filter [codegen id : 8] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] -Condition : isnotnull(cr_catalog_page_sk#57) +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : isnotnull(cr_catalog_page_sk#56) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#57 AS page_sk#61, cr_returned_date_sk#60 AS date_sk#62, 0.00 AS sales_price#63, 0.00 AS profit#64, cr_return_amount#58 AS return_amt#65, cr_net_loss#59 AS net_loss#66] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#60, cr_returned_date_sk#59 AS date_sk#61, 0.00 AS sales_price#62, 0.00 AS profit#63, cr_return_amount#57 AS return_amt#64, cr_net_loss#58 AS net_loss#65] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] (34) Union (35) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Output [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (36) ColumnarToRow [codegen id : 9] -Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] (37) Filter [codegen id : 9] -Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] -Condition : isnotnull(cp_catalog_page_sk#67) +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Condition : isnotnull(cp_catalog_page_sk#66) (38) BroadcastExchange -Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#68] (39) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#51] -Right keys [1]: [cp_catalog_page_sk#67] +Left keys [1]: [page_sk#50] +Right keys [1]: [cp_catalog_page_sk#66] Join condition: None (40) Project [codegen id : 11] -Output [6]: [date_sk#52, sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#68] -Input [8]: [page_sk#51, date_sk#52, sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_sk#67, cp_catalog_page_id#68] +Output [6]: [date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Input [8]: [page_sk#50, date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_sk#66, cp_catalog_page_id#67] (41) ReusedExchange [Reuses operator id: 20] -Output [1]: [d_date_sk#70] +Output [1]: [d_date_sk#69] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#52] -Right keys [1]: [d_date_sk#70] +Left keys [1]: [date_sk#51] +Right keys [1]: [d_date_sk#69] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#68] -Input [7]: [date_sk#52, sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#68, d_date_sk#70] +Output [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Input [7]: [date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67, d_date_sk#69] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#68] -Keys [1]: [cp_catalog_page_id#68] -Functions [4]: [partial_sum(UnscaledValue(sales_price#53)), partial_sum(UnscaledValue(return_amt#55)), partial_sum(UnscaledValue(profit#54)), partial_sum(UnscaledValue(net_loss#56))] -Aggregate Attributes [4]: [sum#71, sum#72, sum#73, sum#74] -Results [5]: [cp_catalog_page_id#68, sum#75, sum#76, sum#77, sum#78] +Input [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Keys [1]: [cp_catalog_page_id#67] +Functions [4]: [partial_sum(UnscaledValue(sales_price#52)), partial_sum(UnscaledValue(return_amt#54)), partial_sum(UnscaledValue(profit#53)), partial_sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum#70, sum#71, sum#72, sum#73] +Results [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] (45) Exchange -Input [5]: [cp_catalog_page_id#68, sum#75, sum#76, sum#77, sum#78] -Arguments: hashpartitioning(cp_catalog_page_id#68, 5), ENSURE_REQUIREMENTS, [id=#79] +Input [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] +Arguments: hashpartitioning(cp_catalog_page_id#67, 5), ENSURE_REQUIREMENTS, [id=#78] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#68, sum#75, sum#76, sum#77, sum#78] -Keys [1]: [cp_catalog_page_id#68] -Functions [4]: [sum(UnscaledValue(sales_price#53)), sum(UnscaledValue(return_amt#55)), sum(UnscaledValue(profit#54)), sum(UnscaledValue(net_loss#56))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#53))#80, sum(UnscaledValue(return_amt#55))#81, sum(UnscaledValue(profit#54))#82, sum(UnscaledValue(net_loss#56))#83] -Results [5]: [catalog channel AS channel#84, concat(catalog_page, cp_catalog_page_id#68) AS id#85, MakeDecimal(sum(UnscaledValue(sales_price#53))#80,17,2) AS sales#86, MakeDecimal(sum(UnscaledValue(return_amt#55))#81,17,2) AS returns#87, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#54))#82,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#56))#83,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#88] +Input [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] +Keys [1]: [cp_catalog_page_id#67] +Functions [4]: [sum(UnscaledValue(sales_price#52)), sum(UnscaledValue(return_amt#54)), sum(UnscaledValue(profit#53)), sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#52))#79, sum(UnscaledValue(return_amt#54))#80, sum(UnscaledValue(profit#53))#81, sum(UnscaledValue(net_loss#55))#82] +Results [5]: [catalog channel AS channel#83, concat(catalog_page, cp_catalog_page_id#67) AS id#84, MakeDecimal(sum(UnscaledValue(sales_price#52))#79,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(return_amt#54))#80,17,2) AS returns#86, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#53))#81,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#55))#82,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#87] (47) Scan parquet default.web_sales -Output [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Output [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cast(ws_sold_date_sk#92 as bigint)), dynamicpruningexpression(cast(ws_sold_date_sk#92 as bigint) IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ws_sold_date_sk#91), dynamicpruningexpression(ws_sold_date_sk#91 IN dynamicpruning#5)] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] (49) Filter [codegen id : 13] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Condition : isnotnull(ws_web_site_sk#89) +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Condition : isnotnull(ws_web_site_sk#88) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#89 AS wsr_web_site_sk#93, cast(ws_sold_date_sk#92 as bigint) AS date_sk#94, ws_ext_sales_price#90 AS sales_price#95, ws_net_profit#91 AS profit#96, 0.00 AS return_amt#97, 0.00 AS net_loss#98] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Output [6]: [ws_web_site_sk#88 AS wsr_web_site_sk#92, ws_sold_date_sk#91 AS date_sk#93, ws_ext_sales_price#89 AS sales_price#94, ws_net_profit#90 AS profit#95, 0.00 AS return_amt#96, 0.00 AS net_loss#97] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] (51) Scan parquet default.web_returns -Output [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] +Output [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#103), dynamicpruningexpression(wr_returned_date_sk#103 IN dynamicpruning#5)] -ReadSchema: struct +PartitionFilters: [isnotnull(wr_returned_date_sk#102), dynamicpruningexpression(wr_returned_date_sk#102 IN dynamicpruning#5)] +ReadSchema: struct (52) ColumnarToRow [codegen id : 14] -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] (53) Exchange -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] -Arguments: hashpartitioning(wr_item_sk#99, wr_order_number#100, 5), ENSURE_REQUIREMENTS, [id=#104] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: hashpartitioning(wr_item_sk#98, wr_order_number#99, 5), ENSURE_REQUIREMENTS, [id=#103] (54) Sort [codegen id : 15] -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] -Arguments: [wr_item_sk#99 ASC NULLS FIRST, wr_order_number#100 ASC NULLS FIRST], false, 0 +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: [wr_item_sk#98 ASC NULLS FIRST, wr_order_number#99 ASC NULLS FIRST], false, 0 (55) Scan parquet default.web_sales -Output [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Output [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (56) ColumnarToRow [codegen id : 16] -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] (57) Filter [codegen id : 16] -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] -Condition : ((isnotnull(ws_item_sk#105) AND isnotnull(ws_order_number#107)) AND isnotnull(ws_web_site_sk#106)) +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Condition : ((isnotnull(ws_item_sk#104) AND isnotnull(ws_order_number#106)) AND isnotnull(ws_web_site_sk#105)) (58) Project [codegen id : 16] -Output [3]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Output [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] (59) Exchange -Input [3]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] -Arguments: hashpartitioning(cast(ws_item_sk#105 as bigint), cast(ws_order_number#107 as bigint), 5), ENSURE_REQUIREMENTS, [id=#109] +Input [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Arguments: hashpartitioning(ws_item_sk#104, ws_order_number#106, 5), ENSURE_REQUIREMENTS, [id=#108] (60) Sort [codegen id : 17] -Input [3]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] -Arguments: [cast(ws_item_sk#105 as bigint) ASC NULLS FIRST, cast(ws_order_number#107 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Arguments: [ws_item_sk#104 ASC NULLS FIRST, ws_order_number#106 ASC NULLS FIRST], false, 0 (61) SortMergeJoin [codegen id : 18] -Left keys [2]: [wr_item_sk#99, wr_order_number#100] -Right keys [2]: [cast(ws_item_sk#105 as bigint), cast(ws_order_number#107 as bigint)] +Left keys [2]: [wr_item_sk#98, wr_order_number#99] +Right keys [2]: [ws_item_sk#104, ws_order_number#106] Join condition: None (62) Project [codegen id : 18] -Output [6]: [ws_web_site_sk#106 AS wsr_web_site_sk#110, wr_returned_date_sk#103 AS date_sk#111, 0.00 AS sales_price#112, 0.00 AS profit#113, wr_return_amt#101 AS return_amt#114, wr_net_loss#102 AS net_loss#115] -Input [8]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103, ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] +Output [6]: [ws_web_site_sk#105 AS wsr_web_site_sk#109, wr_returned_date_sk#102 AS date_sk#110, 0.00 AS sales_price#111, 0.00 AS profit#112, wr_return_amt#100 AS return_amt#113, wr_net_loss#101 AS net_loss#114] +Input [8]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102, ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] (63) Union (64) Scan parquet default.web_site -Output [2]: [web_site_sk#116, web_site_id#117] +Output [2]: [web_site_sk#115, web_site_id#116] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (65) ColumnarToRow [codegen id : 19] -Input [2]: [web_site_sk#116, web_site_id#117] +Input [2]: [web_site_sk#115, web_site_id#116] (66) Filter [codegen id : 19] -Input [2]: [web_site_sk#116, web_site_id#117] -Condition : isnotnull(web_site_sk#116) +Input [2]: [web_site_sk#115, web_site_id#116] +Condition : isnotnull(web_site_sk#115) (67) BroadcastExchange -Input [2]: [web_site_sk#116, web_site_id#117] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#118] +Input [2]: [web_site_sk#115, web_site_id#116] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#117] (68) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [wsr_web_site_sk#93] -Right keys [1]: [web_site_sk#116] +Left keys [1]: [wsr_web_site_sk#92] +Right keys [1]: [web_site_sk#115] Join condition: None (69) Project [codegen id : 21] -Output [6]: [date_sk#94, sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Input [8]: [wsr_web_site_sk#93, date_sk#94, sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_sk#116, web_site_id#117] +Output [6]: [date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [8]: [wsr_web_site_sk#92, date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_sk#115, web_site_id#116] (70) ReusedExchange [Reuses operator id: 20] -Output [1]: [d_date_sk#119] +Output [1]: [d_date_sk#118] (71) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [date_sk#94] -Right keys [1]: [cast(d_date_sk#119 as bigint)] +Left keys [1]: [date_sk#93] +Right keys [1]: [d_date_sk#118] Join condition: None (72) Project [codegen id : 21] -Output [5]: [sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Input [7]: [date_sk#94, sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117, d_date_sk#119] +Output [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [7]: [date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116, d_date_sk#118] (73) HashAggregate [codegen id : 21] -Input [5]: [sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Keys [1]: [web_site_id#117] -Functions [4]: [partial_sum(UnscaledValue(sales_price#95)), partial_sum(UnscaledValue(return_amt#97)), partial_sum(UnscaledValue(profit#96)), partial_sum(UnscaledValue(net_loss#98))] -Aggregate Attributes [4]: [sum#120, sum#121, sum#122, sum#123] -Results [5]: [web_site_id#117, sum#124, sum#125, sum#126, sum#127] +Input [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Keys [1]: [web_site_id#116] +Functions [4]: [partial_sum(UnscaledValue(sales_price#94)), partial_sum(UnscaledValue(return_amt#96)), partial_sum(UnscaledValue(profit#95)), partial_sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum#119, sum#120, sum#121, sum#122] +Results [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] (74) Exchange -Input [5]: [web_site_id#117, sum#124, sum#125, sum#126, sum#127] -Arguments: hashpartitioning(web_site_id#117, 5), ENSURE_REQUIREMENTS, [id=#128] +Input [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] +Arguments: hashpartitioning(web_site_id#116, 5), ENSURE_REQUIREMENTS, [id=#127] (75) HashAggregate [codegen id : 22] -Input [5]: [web_site_id#117, sum#124, sum#125, sum#126, sum#127] -Keys [1]: [web_site_id#117] -Functions [4]: [sum(UnscaledValue(sales_price#95)), sum(UnscaledValue(return_amt#97)), sum(UnscaledValue(profit#96)), sum(UnscaledValue(net_loss#98))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#95))#129, sum(UnscaledValue(return_amt#97))#130, sum(UnscaledValue(profit#96))#131, sum(UnscaledValue(net_loss#98))#132] -Results [5]: [web channel AS channel#133, concat(web_site, web_site_id#117) AS id#134, MakeDecimal(sum(UnscaledValue(sales_price#95))#129,17,2) AS sales#135, MakeDecimal(sum(UnscaledValue(return_amt#97))#130,17,2) AS returns#136, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#96))#131,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#98))#132,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#137] +Input [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] +Keys [1]: [web_site_id#116] +Functions [4]: [sum(UnscaledValue(sales_price#94)), sum(UnscaledValue(return_amt#96)), sum(UnscaledValue(profit#95)), sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#94))#128, sum(UnscaledValue(return_amt#96))#129, sum(UnscaledValue(profit#95))#130, sum(UnscaledValue(net_loss#97))#131] +Results [5]: [web channel AS channel#132, concat(web_site, web_site_id#116) AS id#133, MakeDecimal(sum(UnscaledValue(sales_price#94))#128,17,2) AS sales#134, MakeDecimal(sum(UnscaledValue(return_amt#96))#129,17,2) AS returns#135, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#95))#130,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#97))#131,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#136] (76) Union @@ -444,103 +445,103 @@ Results [5]: [web channel AS channel#133, concat(web_site, web_site_id#117) AS i Input [5]: [channel#41, id#42, sales#43, returns#44, profit#45] Keys [2]: [channel#41, id#42] Functions [3]: [partial_sum(sales#43), partial_sum(returns#44), partial_sum(profit#45)] -Aggregate Attributes [6]: [sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] -Results [8]: [channel#41, id#42, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] +Aggregate Attributes [6]: [sum#137, isEmpty#138, sum#139, isEmpty#140, sum#141, isEmpty#142] +Results [8]: [channel#41, id#42, sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] (78) Exchange -Input [8]: [channel#41, id#42, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] -Arguments: hashpartitioning(channel#41, id#42, 5), ENSURE_REQUIREMENTS, [id=#150] +Input [8]: [channel#41, id#42, sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] +Arguments: hashpartitioning(channel#41, id#42, 5), ENSURE_REQUIREMENTS, [id=#149] (79) HashAggregate [codegen id : 24] -Input [8]: [channel#41, id#42, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] +Input [8]: [channel#41, id#42, sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] Keys [2]: [channel#41, id#42] Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] -Aggregate Attributes [3]: [sum(sales#43)#151, sum(returns#44)#152, sum(profit#45)#153] -Results [5]: [channel#41, id#42, cast(sum(sales#43)#151 as decimal(37,2)) AS sales#154, cast(sum(returns#44)#152 as decimal(37,2)) AS returns#155, cast(sum(profit#45)#153 as decimal(38,2)) AS profit#156] +Aggregate Attributes [3]: [sum(sales#43)#150, sum(returns#44)#151, sum(profit#45)#152] +Results [5]: [channel#41, id#42, cast(sum(sales#43)#150 as decimal(37,2)) AS sales#153, cast(sum(returns#44)#151 as decimal(37,2)) AS returns#154, cast(sum(profit#45)#152 as decimal(38,2)) AS profit#155] (80) ReusedExchange [Reuses operator id: unknown] -Output [8]: [channel#41, id#42, sum#157, isEmpty#158, sum#159, isEmpty#160, sum#161, isEmpty#162] +Output [8]: [channel#41, id#42, sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] (81) HashAggregate [codegen id : 48] -Input [8]: [channel#41, id#42, sum#157, isEmpty#158, sum#159, isEmpty#160, sum#161, isEmpty#162] +Input [8]: [channel#41, id#42, sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] Keys [2]: [channel#41, id#42] -Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#163)] -Aggregate Attributes [3]: [sum(sales#43)#164, sum(returns#44)#165, sum(profit#163)#166] -Results [4]: [channel#41, sum(sales#43)#164 AS sales#167, sum(returns#44)#165 AS returns#168, sum(profit#163)#166 AS profit#169] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#162, sum(returns#44)#163, sum(profit#45)#164] +Results [4]: [channel#41, sum(sales#43)#162 AS sales#165, sum(returns#44)#163 AS returns#166, sum(profit#45)#164 AS profit#167] (82) HashAggregate [codegen id : 48] -Input [4]: [channel#41, sales#167, returns#168, profit#169] +Input [4]: [channel#41, sales#165, returns#166, profit#167] Keys [1]: [channel#41] -Functions [3]: [partial_sum(sales#167), partial_sum(returns#168), partial_sum(profit#169)] -Aggregate Attributes [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] -Results [7]: [channel#41, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Functions [3]: [partial_sum(sales#165), partial_sum(returns#166), partial_sum(profit#167)] +Aggregate Attributes [6]: [sum#168, isEmpty#169, sum#170, isEmpty#171, sum#172, isEmpty#173] +Results [7]: [channel#41, sum#174, isEmpty#175, sum#176, isEmpty#177, sum#178, isEmpty#179] (83) Exchange -Input [7]: [channel#41, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] -Arguments: hashpartitioning(channel#41, 5), ENSURE_REQUIREMENTS, [id=#182] +Input [7]: [channel#41, sum#174, isEmpty#175, sum#176, isEmpty#177, sum#178, isEmpty#179] +Arguments: hashpartitioning(channel#41, 5), ENSURE_REQUIREMENTS, [id=#180] (84) HashAggregate [codegen id : 49] -Input [7]: [channel#41, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Input [7]: [channel#41, sum#174, isEmpty#175, sum#176, isEmpty#177, sum#178, isEmpty#179] Keys [1]: [channel#41] -Functions [3]: [sum(sales#167), sum(returns#168), sum(profit#169)] -Aggregate Attributes [3]: [sum(sales#167)#183, sum(returns#168)#184, sum(profit#169)#185] -Results [5]: [channel#41, null AS id#186, sum(sales#167)#183 AS sum(sales)#187, sum(returns#168)#184 AS sum(returns)#188, sum(profit#169)#185 AS sum(profit)#189] +Functions [3]: [sum(sales#165), sum(returns#166), sum(profit#167)] +Aggregate Attributes [3]: [sum(sales#165)#181, sum(returns#166)#182, sum(profit#167)#183] +Results [5]: [channel#41, null AS id#184, sum(sales#165)#181 AS sum(sales)#185, sum(returns#166)#182 AS sum(returns)#186, sum(profit#167)#183 AS sum(profit)#187] (85) ReusedExchange [Reuses operator id: unknown] -Output [8]: [channel#41, id#42, sum#190, isEmpty#191, sum#192, isEmpty#193, sum#194, isEmpty#195] +Output [8]: [channel#41, id#42, sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] (86) HashAggregate [codegen id : 73] -Input [8]: [channel#41, id#42, sum#190, isEmpty#191, sum#192, isEmpty#193, sum#194, isEmpty#195] +Input [8]: [channel#41, id#42, sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] Keys [2]: [channel#41, id#42] -Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#196)] -Aggregate Attributes [3]: [sum(sales#43)#197, sum(returns#44)#198, sum(profit#196)#199] -Results [3]: [sum(sales#43)#197 AS sales#167, sum(returns#44)#198 AS returns#168, sum(profit#196)#199 AS profit#169] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#194, sum(returns#44)#195, sum(profit#45)#196] +Results [3]: [sum(sales#43)#194 AS sales#165, sum(returns#44)#195 AS returns#166, sum(profit#45)#196 AS profit#167] (87) HashAggregate [codegen id : 73] -Input [3]: [sales#167, returns#168, profit#169] +Input [3]: [sales#165, returns#166, profit#167] Keys: [] -Functions [3]: [partial_sum(sales#167), partial_sum(returns#168), partial_sum(profit#169)] -Aggregate Attributes [6]: [sum#200, isEmpty#201, sum#202, isEmpty#203, sum#204, isEmpty#205] -Results [6]: [sum#206, isEmpty#207, sum#208, isEmpty#209, sum#210, isEmpty#211] +Functions [3]: [partial_sum(sales#165), partial_sum(returns#166), partial_sum(profit#167)] +Aggregate Attributes [6]: [sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202] +Results [6]: [sum#203, isEmpty#204, sum#205, isEmpty#206, sum#207, isEmpty#208] (88) Exchange -Input [6]: [sum#206, isEmpty#207, sum#208, isEmpty#209, sum#210, isEmpty#211] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#212] +Input [6]: [sum#203, isEmpty#204, sum#205, isEmpty#206, sum#207, isEmpty#208] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#209] (89) HashAggregate [codegen id : 74] -Input [6]: [sum#206, isEmpty#207, sum#208, isEmpty#209, sum#210, isEmpty#211] +Input [6]: [sum#203, isEmpty#204, sum#205, isEmpty#206, sum#207, isEmpty#208] Keys: [] -Functions [3]: [sum(sales#167), sum(returns#168), sum(profit#169)] -Aggregate Attributes [3]: [sum(sales#167)#213, sum(returns#168)#214, sum(profit#169)#215] -Results [5]: [null AS channel#216, null AS id#217, sum(sales#167)#213 AS sum(sales)#218, sum(returns#168)#214 AS sum(returns)#219, sum(profit#169)#215 AS sum(profit)#220] +Functions [3]: [sum(sales#165), sum(returns#166), sum(profit#167)] +Aggregate Attributes [3]: [sum(sales#165)#210, sum(returns#166)#211, sum(profit#167)#212] +Results [5]: [null AS channel#213, null AS id#214, sum(sales#165)#210 AS sum(sales)#215, sum(returns#166)#211 AS sum(returns)#216, sum(profit#167)#212 AS sum(profit)#217] (90) Union (91) HashAggregate [codegen id : 75] -Input [5]: [channel#41, id#42, sales#154, returns#155, profit#156] -Keys [5]: [channel#41, id#42, sales#154, returns#155, profit#156] +Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Keys [5]: [channel#41, id#42, sales#153, returns#154, profit#155] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#41, id#42, sales#154, returns#155, profit#156] +Results [5]: [channel#41, id#42, sales#153, returns#154, profit#155] (92) Exchange -Input [5]: [channel#41, id#42, sales#154, returns#155, profit#156] -Arguments: hashpartitioning(channel#41, id#42, sales#154, returns#155, profit#156, 5), ENSURE_REQUIREMENTS, [id=#221] +Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Arguments: hashpartitioning(channel#41, id#42, sales#153, returns#154, profit#155, 5), ENSURE_REQUIREMENTS, [id=#218] (93) HashAggregate [codegen id : 76] -Input [5]: [channel#41, id#42, sales#154, returns#155, profit#156] -Keys [5]: [channel#41, id#42, sales#154, returns#155, profit#156] +Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Keys [5]: [channel#41, id#42, sales#153, returns#154, profit#155] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#41, id#42, sales#154, returns#155, profit#156] +Results [5]: [channel#41, id#42, sales#153, returns#154, profit#155] (94) TakeOrderedAndProject -Input [5]: [channel#41, id#42, sales#154, returns#155, profit#156] -Arguments: 100, [channel#41 ASC NULLS FIRST, id#42 ASC NULLS FIRST], [channel#41, id#42, sales#154, returns#155, profit#156] +Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Arguments: 100, [channel#41 ASC NULLS FIRST, id#42 ASC NULLS FIRST], [channel#41, id#42, sales#153, returns#154, profit#155] ===== Subqueries ===== -Subquery:1 Hosting operator id = 1 Hosting Expression = cast(ss_sold_date_sk#4 as bigint) IN dynamicpruning#5 +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 ReusedExchange (95) @@ -549,17 +550,12 @@ Output [1]: [d_date_sk#25] Subquery:2 Hosting operator id = 5 Hosting Expression = sr_returned_date_sk#15 IN dynamicpruning#5 -Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#50 -ReusedExchange (96) - - -(96) ReusedExchange [Reuses operator id: 20] -Output [1]: [d_date_sk#70] +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#5 -Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#60 IN dynamicpruning#50 +Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#59 IN dynamicpruning#5 -Subquery:5 Hosting operator id = 47 Hosting Expression = cast(ws_sold_date_sk#92 as bigint) IN dynamicpruning#5 +Subquery:5 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#91 IN dynamicpruning#5 -Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#103 IN dynamicpruning#5 +Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#102 IN dynamicpruning#5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt index dd2c25b96568b..558e8bcc406bc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt @@ -75,15 +75,14 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] - SubqueryBroadcast [d_date_sk] #2 - ReusedExchange [d_date_sk] #4 + ReusedSubquery [d_date_sk] #1 WholeStageCodegen (8) Project [cr_catalog_page_sk,cr_returned_date_sk,cr_return_amount,cr_net_loss] Filter [cr_catalog_page_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_catalog_page_sk,cr_return_amount,cr_net_loss,cr_returned_date_sk] - ReusedSubquery [d_date_sk] #2 + ReusedSubquery [d_date_sk] #1 InputAdapter BroadcastExchange #7 WholeStageCodegen (9) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt index c6b64d59abf82..036b3cdcb22fe 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt @@ -96,7 +96,8 @@ TakeOrderedAndProject (91) Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cast(ss_sold_date_sk#4 as bigint)), dynamicpruningexpression(cast(ss_sold_date_sk#4 as bigint) IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] ReadSchema: struct (2) ColumnarToRow [codegen id : 1] @@ -104,10 +105,10 @@ Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_s (3) Filter [codegen id : 1] Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] -Condition : isnotnull(cast(ss_store_sk#1 as bigint)) +Condition : isnotnull(ss_store_sk#1) (4) Project [codegen id : 1] -Output [6]: [cast(ss_store_sk#1 as bigint) AS store_sk#6, cast(ss_sold_date_sk#4 as bigint) AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] +Output [6]: [ss_store_sk#1 AS store_sk#6, ss_sold_date_sk#4 AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] (5) Scan parquet default.store_returns @@ -116,7 +117,7 @@ Batched: true Location: InMemoryFileIndex [] PartitionFilters: [isnotnull(sr_returned_date_sk#15), dynamicpruningexpression(sr_returned_date_sk#15 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (6) ColumnarToRow [codegen id : 2] Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] @@ -155,7 +156,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (15) BroadcastHashJoin [codegen id : 5] Left keys [1]: [date_sk#7] -Right keys [1]: [cast(d_date_sk#22 as bigint)] +Right keys [1]: [d_date_sk#22] Join condition: None (16) Project [codegen id : 5] @@ -182,7 +183,7 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint) (21) BroadcastHashJoin [codegen id : 5] Left keys [1]: [store_sk#6] -Right keys [1]: [cast(s_store_sk#25 as bigint)] +Right keys [1]: [s_store_sk#25] Join condition: None (22) Project [codegen id : 5] @@ -211,7 +212,7 @@ Results [5]: [store channel AS channel#41, concat(store, s_store_id#26) AS id#42 Output [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#50)] +PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#5)] PushedFilters: [IsNotNull(cs_catalog_page_sk)] ReadSchema: struct @@ -223,205 +224,205 @@ Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_s Condition : isnotnull(cs_catalog_page_sk#46) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#46 AS page_sk#51, cs_sold_date_sk#49 AS date_sk#52, cs_ext_sales_price#47 AS sales_price#53, cs_net_profit#48 AS profit#54, 0.00 AS return_amt#55, 0.00 AS net_loss#56] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#50, cs_sold_date_sk#49 AS date_sk#51, cs_ext_sales_price#47 AS sales_price#52, cs_net_profit#48 AS profit#53, 0.00 AS return_amt#54, 0.00 AS net_loss#55] Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] (30) Scan parquet default.catalog_returns -Output [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Output [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cr_returned_date_sk#60), dynamicpruningexpression(cr_returned_date_sk#60 IN dynamicpruning#50)] +PartitionFilters: [isnotnull(cr_returned_date_sk#59), dynamicpruningexpression(cr_returned_date_sk#59 IN dynamicpruning#5)] PushedFilters: [IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] (32) Filter [codegen id : 8] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] -Condition : isnotnull(cr_catalog_page_sk#57) +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : isnotnull(cr_catalog_page_sk#56) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#57 AS page_sk#61, cr_returned_date_sk#60 AS date_sk#62, 0.00 AS sales_price#63, 0.00 AS profit#64, cr_return_amount#58 AS return_amt#65, cr_net_loss#59 AS net_loss#66] -Input [4]: [cr_catalog_page_sk#57, cr_return_amount#58, cr_net_loss#59, cr_returned_date_sk#60] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#60, cr_returned_date_sk#59 AS date_sk#61, 0.00 AS sales_price#62, 0.00 AS profit#63, cr_return_amount#57 AS return_amt#64, cr_net_loss#58 AS net_loss#65] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] (34) Union (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#67] +Output [1]: [d_date_sk#66] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#52] -Right keys [1]: [d_date_sk#67] +Left keys [1]: [date_sk#51] +Right keys [1]: [d_date_sk#66] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#51, sales_price#53, profit#54, return_amt#55, net_loss#56] -Input [7]: [page_sk#51, date_sk#52, sales_price#53, profit#54, return_amt#55, net_loss#56, d_date_sk#67] +Output [5]: [page_sk#50, sales_price#52, profit#53, return_amt#54, net_loss#55] +Input [7]: [page_sk#50, date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, d_date_sk#66] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#68, cp_catalog_page_id#69] +Output [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#68, cp_catalog_page_id#69] +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#68, cp_catalog_page_id#69] -Condition : isnotnull(cp_catalog_page_sk#68) +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Condition : isnotnull(cp_catalog_page_sk#67) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#68, cp_catalog_page_id#69] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#70] +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#51] -Right keys [1]: [cp_catalog_page_sk#68] +Left keys [1]: [page_sk#50] +Right keys [1]: [cp_catalog_page_sk#67] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#69] -Input [7]: [page_sk#51, sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_sk#68, cp_catalog_page_id#69] +Output [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#68] +Input [7]: [page_sk#50, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_sk#67, cp_catalog_page_id#68] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#53, profit#54, return_amt#55, net_loss#56, cp_catalog_page_id#69] -Keys [1]: [cp_catalog_page_id#69] -Functions [4]: [partial_sum(UnscaledValue(sales_price#53)), partial_sum(UnscaledValue(return_amt#55)), partial_sum(UnscaledValue(profit#54)), partial_sum(UnscaledValue(net_loss#56))] -Aggregate Attributes [4]: [sum#71, sum#72, sum#73, sum#74] -Results [5]: [cp_catalog_page_id#69, sum#75, sum#76, sum#77, sum#78] +Input [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#68] +Keys [1]: [cp_catalog_page_id#68] +Functions [4]: [partial_sum(UnscaledValue(sales_price#52)), partial_sum(UnscaledValue(return_amt#54)), partial_sum(UnscaledValue(profit#53)), partial_sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum#70, sum#71, sum#72, sum#73] +Results [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] (45) Exchange -Input [5]: [cp_catalog_page_id#69, sum#75, sum#76, sum#77, sum#78] -Arguments: hashpartitioning(cp_catalog_page_id#69, 5), ENSURE_REQUIREMENTS, [id=#79] +Input [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] +Arguments: hashpartitioning(cp_catalog_page_id#68, 5), ENSURE_REQUIREMENTS, [id=#78] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#69, sum#75, sum#76, sum#77, sum#78] -Keys [1]: [cp_catalog_page_id#69] -Functions [4]: [sum(UnscaledValue(sales_price#53)), sum(UnscaledValue(return_amt#55)), sum(UnscaledValue(profit#54)), sum(UnscaledValue(net_loss#56))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#53))#80, sum(UnscaledValue(return_amt#55))#81, sum(UnscaledValue(profit#54))#82, sum(UnscaledValue(net_loss#56))#83] -Results [5]: [catalog channel AS channel#84, concat(catalog_page, cp_catalog_page_id#69) AS id#85, MakeDecimal(sum(UnscaledValue(sales_price#53))#80,17,2) AS sales#86, MakeDecimal(sum(UnscaledValue(return_amt#55))#81,17,2) AS returns#87, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#54))#82,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#56))#83,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#88] +Input [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] +Keys [1]: [cp_catalog_page_id#68] +Functions [4]: [sum(UnscaledValue(sales_price#52)), sum(UnscaledValue(return_amt#54)), sum(UnscaledValue(profit#53)), sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#52))#79, sum(UnscaledValue(return_amt#54))#80, sum(UnscaledValue(profit#53))#81, sum(UnscaledValue(net_loss#55))#82] +Results [5]: [catalog channel AS channel#83, concat(catalog_page, cp_catalog_page_id#68) AS id#84, MakeDecimal(sum(UnscaledValue(sales_price#52))#79,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(return_amt#54))#80,17,2) AS returns#86, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#53))#81,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#55))#82,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#87] (47) Scan parquet default.web_sales -Output [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Output [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cast(ws_sold_date_sk#92 as bigint)), dynamicpruningexpression(cast(ws_sold_date_sk#92 as bigint) IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ws_sold_date_sk#91), dynamicpruningexpression(ws_sold_date_sk#91 IN dynamicpruning#5)] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] (49) Filter [codegen id : 13] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Condition : isnotnull(ws_web_site_sk#89) +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Condition : isnotnull(ws_web_site_sk#88) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#89 AS wsr_web_site_sk#93, cast(ws_sold_date_sk#92 as bigint) AS date_sk#94, ws_ext_sales_price#90 AS sales_price#95, ws_net_profit#91 AS profit#96, 0.00 AS return_amt#97, 0.00 AS net_loss#98] -Input [4]: [ws_web_site_sk#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Output [6]: [ws_web_site_sk#88 AS wsr_web_site_sk#92, ws_sold_date_sk#91 AS date_sk#93, ws_ext_sales_price#89 AS sales_price#94, ws_net_profit#90 AS profit#95, 0.00 AS return_amt#96, 0.00 AS net_loss#97] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] (51) Scan parquet default.web_returns -Output [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] +Output [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#103), dynamicpruningexpression(wr_returned_date_sk#103 IN dynamicpruning#5)] -ReadSchema: struct +PartitionFilters: [isnotnull(wr_returned_date_sk#102), dynamicpruningexpression(wr_returned_date_sk#102 IN dynamicpruning#5)] +ReadSchema: struct (52) ColumnarToRow [codegen id : 14] -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] (53) BroadcastExchange -Input [5]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103] -Arguments: HashedRelationBroadcastMode(List(input[0, bigint, true], input[1, bigint, true]),false), [id=#104] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[1, int, true] as bigint) & 4294967295))),false), [id=#103] (54) Scan parquet default.web_sales -Output [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Output [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (55) ColumnarToRow -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] (56) Filter -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] -Condition : ((isnotnull(ws_item_sk#105) AND isnotnull(ws_order_number#107)) AND isnotnull(ws_web_site_sk#106)) +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Condition : ((isnotnull(ws_item_sk#104) AND isnotnull(ws_order_number#106)) AND isnotnull(ws_web_site_sk#105)) (57) Project -Output [3]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] -Input [4]: [ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107, ws_sold_date_sk#108] +Output [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] (58) BroadcastHashJoin [codegen id : 15] -Left keys [2]: [wr_item_sk#99, wr_order_number#100] -Right keys [2]: [cast(ws_item_sk#105 as bigint), cast(ws_order_number#107 as bigint)] +Left keys [2]: [wr_item_sk#98, wr_order_number#99] +Right keys [2]: [ws_item_sk#104, ws_order_number#106] Join condition: None (59) Project [codegen id : 15] -Output [6]: [ws_web_site_sk#106 AS wsr_web_site_sk#109, wr_returned_date_sk#103 AS date_sk#110, 0.00 AS sales_price#111, 0.00 AS profit#112, wr_return_amt#101 AS return_amt#113, wr_net_loss#102 AS net_loss#114] -Input [8]: [wr_item_sk#99, wr_order_number#100, wr_return_amt#101, wr_net_loss#102, wr_returned_date_sk#103, ws_item_sk#105, ws_web_site_sk#106, ws_order_number#107] +Output [6]: [ws_web_site_sk#105 AS wsr_web_site_sk#108, wr_returned_date_sk#102 AS date_sk#109, 0.00 AS sales_price#110, 0.00 AS profit#111, wr_return_amt#100 AS return_amt#112, wr_net_loss#101 AS net_loss#113] +Input [8]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102, ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] (60) Union (61) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#115] +Output [1]: [d_date_sk#114] (62) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [date_sk#94] -Right keys [1]: [cast(d_date_sk#115 as bigint)] +Left keys [1]: [date_sk#93] +Right keys [1]: [d_date_sk#114] Join condition: None (63) Project [codegen id : 18] -Output [5]: [wsr_web_site_sk#93, sales_price#95, profit#96, return_amt#97, net_loss#98] -Input [7]: [wsr_web_site_sk#93, date_sk#94, sales_price#95, profit#96, return_amt#97, net_loss#98, d_date_sk#115] +Output [5]: [wsr_web_site_sk#92, sales_price#94, profit#95, return_amt#96, net_loss#97] +Input [7]: [wsr_web_site_sk#92, date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, d_date_sk#114] (64) Scan parquet default.web_site -Output [2]: [web_site_sk#116, web_site_id#117] +Output [2]: [web_site_sk#115, web_site_id#116] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (65) ColumnarToRow [codegen id : 17] -Input [2]: [web_site_sk#116, web_site_id#117] +Input [2]: [web_site_sk#115, web_site_id#116] (66) Filter [codegen id : 17] -Input [2]: [web_site_sk#116, web_site_id#117] -Condition : isnotnull(web_site_sk#116) +Input [2]: [web_site_sk#115, web_site_id#116] +Condition : isnotnull(web_site_sk#115) (67) BroadcastExchange -Input [2]: [web_site_sk#116, web_site_id#117] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#118] +Input [2]: [web_site_sk#115, web_site_id#116] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#117] (68) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [wsr_web_site_sk#93] -Right keys [1]: [web_site_sk#116] +Left keys [1]: [wsr_web_site_sk#92] +Right keys [1]: [web_site_sk#115] Join condition: None (69) Project [codegen id : 18] -Output [5]: [sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Input [7]: [wsr_web_site_sk#93, sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_sk#116, web_site_id#117] +Output [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [7]: [wsr_web_site_sk#92, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_sk#115, web_site_id#116] (70) HashAggregate [codegen id : 18] -Input [5]: [sales_price#95, profit#96, return_amt#97, net_loss#98, web_site_id#117] -Keys [1]: [web_site_id#117] -Functions [4]: [partial_sum(UnscaledValue(sales_price#95)), partial_sum(UnscaledValue(return_amt#97)), partial_sum(UnscaledValue(profit#96)), partial_sum(UnscaledValue(net_loss#98))] -Aggregate Attributes [4]: [sum#119, sum#120, sum#121, sum#122] -Results [5]: [web_site_id#117, sum#123, sum#124, sum#125, sum#126] +Input [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Keys [1]: [web_site_id#116] +Functions [4]: [partial_sum(UnscaledValue(sales_price#94)), partial_sum(UnscaledValue(return_amt#96)), partial_sum(UnscaledValue(profit#95)), partial_sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum#118, sum#119, sum#120, sum#121] +Results [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] (71) Exchange -Input [5]: [web_site_id#117, sum#123, sum#124, sum#125, sum#126] -Arguments: hashpartitioning(web_site_id#117, 5), ENSURE_REQUIREMENTS, [id=#127] +Input [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] +Arguments: hashpartitioning(web_site_id#116, 5), ENSURE_REQUIREMENTS, [id=#126] (72) HashAggregate [codegen id : 19] -Input [5]: [web_site_id#117, sum#123, sum#124, sum#125, sum#126] -Keys [1]: [web_site_id#117] -Functions [4]: [sum(UnscaledValue(sales_price#95)), sum(UnscaledValue(return_amt#97)), sum(UnscaledValue(profit#96)), sum(UnscaledValue(net_loss#98))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#95))#128, sum(UnscaledValue(return_amt#97))#129, sum(UnscaledValue(profit#96))#130, sum(UnscaledValue(net_loss#98))#131] -Results [5]: [web channel AS channel#132, concat(web_site, web_site_id#117) AS id#133, MakeDecimal(sum(UnscaledValue(sales_price#95))#128,17,2) AS sales#134, MakeDecimal(sum(UnscaledValue(return_amt#97))#129,17,2) AS returns#135, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#96))#130,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#98))#131,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#136] +Input [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] +Keys [1]: [web_site_id#116] +Functions [4]: [sum(UnscaledValue(sales_price#94)), sum(UnscaledValue(return_amt#96)), sum(UnscaledValue(profit#95)), sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#94))#127, sum(UnscaledValue(return_amt#96))#128, sum(UnscaledValue(profit#95))#129, sum(UnscaledValue(net_loss#97))#130] +Results [5]: [web channel AS channel#131, concat(web_site, web_site_id#116) AS id#132, MakeDecimal(sum(UnscaledValue(sales_price#94))#127,17,2) AS sales#133, MakeDecimal(sum(UnscaledValue(return_amt#96))#128,17,2) AS returns#134, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#95))#129,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#97))#130,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#135] (73) Union @@ -429,103 +430,103 @@ Results [5]: [web channel AS channel#132, concat(web_site, web_site_id#117) AS i Input [5]: [channel#41, id#42, sales#43, returns#44, profit#45] Keys [2]: [channel#41, id#42] Functions [3]: [partial_sum(sales#43), partial_sum(returns#44), partial_sum(profit#45)] -Aggregate Attributes [6]: [sum#137, isEmpty#138, sum#139, isEmpty#140, sum#141, isEmpty#142] -Results [8]: [channel#41, id#42, sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] +Aggregate Attributes [6]: [sum#136, isEmpty#137, sum#138, isEmpty#139, sum#140, isEmpty#141] +Results [8]: [channel#41, id#42, sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] (75) Exchange -Input [8]: [channel#41, id#42, sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] -Arguments: hashpartitioning(channel#41, id#42, 5), ENSURE_REQUIREMENTS, [id=#149] +Input [8]: [channel#41, id#42, sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] +Arguments: hashpartitioning(channel#41, id#42, 5), ENSURE_REQUIREMENTS, [id=#148] (76) HashAggregate [codegen id : 21] -Input [8]: [channel#41, id#42, sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] +Input [8]: [channel#41, id#42, sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] Keys [2]: [channel#41, id#42] Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] -Aggregate Attributes [3]: [sum(sales#43)#150, sum(returns#44)#151, sum(profit#45)#152] -Results [5]: [channel#41, id#42, cast(sum(sales#43)#150 as decimal(37,2)) AS sales#153, cast(sum(returns#44)#151 as decimal(37,2)) AS returns#154, cast(sum(profit#45)#152 as decimal(38,2)) AS profit#155] +Aggregate Attributes [3]: [sum(sales#43)#149, sum(returns#44)#150, sum(profit#45)#151] +Results [5]: [channel#41, id#42, cast(sum(sales#43)#149 as decimal(37,2)) AS sales#152, cast(sum(returns#44)#150 as decimal(37,2)) AS returns#153, cast(sum(profit#45)#151 as decimal(38,2)) AS profit#154] (77) ReusedExchange [Reuses operator id: unknown] -Output [8]: [channel#41, id#42, sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] +Output [8]: [channel#41, id#42, sum#155, isEmpty#156, sum#157, isEmpty#158, sum#159, isEmpty#160] (78) HashAggregate [codegen id : 42] -Input [8]: [channel#41, id#42, sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] +Input [8]: [channel#41, id#42, sum#155, isEmpty#156, sum#157, isEmpty#158, sum#159, isEmpty#160] Keys [2]: [channel#41, id#42] -Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#162)] -Aggregate Attributes [3]: [sum(sales#43)#163, sum(returns#44)#164, sum(profit#162)#165] -Results [4]: [channel#41, sum(sales#43)#163 AS sales#166, sum(returns#44)#164 AS returns#167, sum(profit#162)#165 AS profit#168] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#161, sum(returns#44)#162, sum(profit#45)#163] +Results [4]: [channel#41, sum(sales#43)#161 AS sales#164, sum(returns#44)#162 AS returns#165, sum(profit#45)#163 AS profit#166] (79) HashAggregate [codegen id : 42] -Input [4]: [channel#41, sales#166, returns#167, profit#168] +Input [4]: [channel#41, sales#164, returns#165, profit#166] Keys [1]: [channel#41] -Functions [3]: [partial_sum(sales#166), partial_sum(returns#167), partial_sum(profit#168)] -Aggregate Attributes [6]: [sum#169, isEmpty#170, sum#171, isEmpty#172, sum#173, isEmpty#174] -Results [7]: [channel#41, sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] +Functions [3]: [partial_sum(sales#164), partial_sum(returns#165), partial_sum(profit#166)] +Aggregate Attributes [6]: [sum#167, isEmpty#168, sum#169, isEmpty#170, sum#171, isEmpty#172] +Results [7]: [channel#41, sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] (80) Exchange -Input [7]: [channel#41, sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] -Arguments: hashpartitioning(channel#41, 5), ENSURE_REQUIREMENTS, [id=#181] +Input [7]: [channel#41, sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] +Arguments: hashpartitioning(channel#41, 5), ENSURE_REQUIREMENTS, [id=#179] (81) HashAggregate [codegen id : 43] -Input [7]: [channel#41, sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] +Input [7]: [channel#41, sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] Keys [1]: [channel#41] -Functions [3]: [sum(sales#166), sum(returns#167), sum(profit#168)] -Aggregate Attributes [3]: [sum(sales#166)#182, sum(returns#167)#183, sum(profit#168)#184] -Results [5]: [channel#41, null AS id#185, sum(sales#166)#182 AS sum(sales)#186, sum(returns#167)#183 AS sum(returns)#187, sum(profit#168)#184 AS sum(profit)#188] +Functions [3]: [sum(sales#164), sum(returns#165), sum(profit#166)] +Aggregate Attributes [3]: [sum(sales#164)#180, sum(returns#165)#181, sum(profit#166)#182] +Results [5]: [channel#41, null AS id#183, sum(sales#164)#180 AS sum(sales)#184, sum(returns#165)#181 AS sum(returns)#185, sum(profit#166)#182 AS sum(profit)#186] (82) ReusedExchange [Reuses operator id: unknown] -Output [8]: [channel#41, id#42, sum#189, isEmpty#190, sum#191, isEmpty#192, sum#193, isEmpty#194] +Output [8]: [channel#41, id#42, sum#187, isEmpty#188, sum#189, isEmpty#190, sum#191, isEmpty#192] (83) HashAggregate [codegen id : 64] -Input [8]: [channel#41, id#42, sum#189, isEmpty#190, sum#191, isEmpty#192, sum#193, isEmpty#194] +Input [8]: [channel#41, id#42, sum#187, isEmpty#188, sum#189, isEmpty#190, sum#191, isEmpty#192] Keys [2]: [channel#41, id#42] -Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#195)] -Aggregate Attributes [3]: [sum(sales#43)#196, sum(returns#44)#197, sum(profit#195)#198] -Results [3]: [sum(sales#43)#196 AS sales#166, sum(returns#44)#197 AS returns#167, sum(profit#195)#198 AS profit#168] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#193, sum(returns#44)#194, sum(profit#45)#195] +Results [3]: [sum(sales#43)#193 AS sales#164, sum(returns#44)#194 AS returns#165, sum(profit#45)#195 AS profit#166] (84) HashAggregate [codegen id : 64] -Input [3]: [sales#166, returns#167, profit#168] +Input [3]: [sales#164, returns#165, profit#166] Keys: [] -Functions [3]: [partial_sum(sales#166), partial_sum(returns#167), partial_sum(profit#168)] -Aggregate Attributes [6]: [sum#199, isEmpty#200, sum#201, isEmpty#202, sum#203, isEmpty#204] -Results [6]: [sum#205, isEmpty#206, sum#207, isEmpty#208, sum#209, isEmpty#210] +Functions [3]: [partial_sum(sales#164), partial_sum(returns#165), partial_sum(profit#166)] +Aggregate Attributes [6]: [sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] +Results [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] (85) Exchange -Input [6]: [sum#205, isEmpty#206, sum#207, isEmpty#208, sum#209, isEmpty#210] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#211] +Input [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#208] (86) HashAggregate [codegen id : 65] -Input [6]: [sum#205, isEmpty#206, sum#207, isEmpty#208, sum#209, isEmpty#210] +Input [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] Keys: [] -Functions [3]: [sum(sales#166), sum(returns#167), sum(profit#168)] -Aggregate Attributes [3]: [sum(sales#166)#212, sum(returns#167)#213, sum(profit#168)#214] -Results [5]: [null AS channel#215, null AS id#216, sum(sales#166)#212 AS sum(sales)#217, sum(returns#167)#213 AS sum(returns)#218, sum(profit#168)#214 AS sum(profit)#219] +Functions [3]: [sum(sales#164), sum(returns#165), sum(profit#166)] +Aggregate Attributes [3]: [sum(sales#164)#209, sum(returns#165)#210, sum(profit#166)#211] +Results [5]: [null AS channel#212, null AS id#213, sum(sales#164)#209 AS sum(sales)#214, sum(returns#165)#210 AS sum(returns)#215, sum(profit#166)#211 AS sum(profit)#216] (87) Union (88) HashAggregate [codegen id : 66] -Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] -Keys [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Input [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Keys [5]: [channel#41, id#42, sales#152, returns#153, profit#154] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Results [5]: [channel#41, id#42, sales#152, returns#153, profit#154] (89) Exchange -Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] -Arguments: hashpartitioning(channel#41, id#42, sales#153, returns#154, profit#155, 5), ENSURE_REQUIREMENTS, [id=#220] +Input [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Arguments: hashpartitioning(channel#41, id#42, sales#152, returns#153, profit#154, 5), ENSURE_REQUIREMENTS, [id=#217] (90) HashAggregate [codegen id : 67] -Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] -Keys [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Input [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Keys [5]: [channel#41, id#42, sales#152, returns#153, profit#154] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Results [5]: [channel#41, id#42, sales#152, returns#153, profit#154] (91) TakeOrderedAndProject -Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] -Arguments: 100, [channel#41 ASC NULLS FIRST, id#42 ASC NULLS FIRST], [channel#41, id#42, sales#153, returns#154, profit#155] +Input [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Arguments: 100, [channel#41 ASC NULLS FIRST, id#42 ASC NULLS FIRST], [channel#41, id#42, sales#152, returns#153, profit#154] ===== Subqueries ===== -Subquery:1 Hosting operator id = 1 Hosting Expression = cast(ss_sold_date_sk#4 as bigint) IN dynamicpruning#5 +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 ReusedExchange (92) @@ -534,17 +535,12 @@ Output [1]: [d_date_sk#22] Subquery:2 Hosting operator id = 5 Hosting Expression = sr_returned_date_sk#15 IN dynamicpruning#5 -Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#50 -ReusedExchange (93) - - -(93) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#67] +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#5 -Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#60 IN dynamicpruning#50 +Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#59 IN dynamicpruning#5 -Subquery:5 Hosting operator id = 47 Hosting Expression = cast(ws_sold_date_sk#92 as bigint) IN dynamicpruning#5 +Subquery:5 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#91 IN dynamicpruning#5 -Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#103 IN dynamicpruning#5 +Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#102 IN dynamicpruning#5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt index caa7fcf4957ca..0e98998fb31d5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt @@ -75,15 +75,14 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] - SubqueryBroadcast [d_date_sk] #2 - ReusedExchange [d_date_sk] #4 + ReusedSubquery [d_date_sk] #1 WholeStageCodegen (8) Project [cr_catalog_page_sk,cr_returned_date_sk,cr_return_amount,cr_net_loss] Filter [cr_catalog_page_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_catalog_page_sk,cr_return_amount,cr_net_loss,cr_returned_date_sk] - ReusedSubquery [d_date_sk] #2 + ReusedSubquery [d_date_sk] #1 InputAdapter ReusedExchange [d_date_sk] #4 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/explain.txt index 3847146fa8fa8..ce584592dd831 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/explain.txt @@ -233,18 +233,18 @@ Condition : (((((((isnotnull(ss_item_sk#1) AND isnotnull(ss_ticket_number#8)) AN (4) Exchange Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] -Arguments: hashpartitioning(cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#8 as bigint), 5), ENSURE_REQUIREMENTS, [id=#14] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#8, 5), ENSURE_REQUIREMENTS, [id=#14] (5) Sort [codegen id : 2] Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] -Arguments: [cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#8 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#8 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] @@ -266,7 +266,7 @@ Input [2]: [sr_item_sk#15, sr_ticket_number#16] Arguments: [sr_item_sk#15 ASC NULLS FIRST, sr_ticket_number#16 ASC NULLS FIRST], false, 0 (12) SortMergeJoin [codegen id : 13] -Left keys [2]: [cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#8 as bigint)] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#8] Right keys [2]: [sr_item_sk#15, sr_ticket_number#16] Join condition: None @@ -811,11 +811,11 @@ Condition : (((((((isnotnull(ss_item_sk#129) AND isnotnull(ss_ticket_number#136) (135) Exchange Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] -Arguments: hashpartitioning(cast(ss_item_sk#129 as bigint), cast(ss_ticket_number#136 as bigint), 5), ENSURE_REQUIREMENTS, [id=#142] +Arguments: hashpartitioning(ss_item_sk#129, ss_ticket_number#136, 5), ENSURE_REQUIREMENTS, [id=#142] (136) Sort [codegen id : 45] Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] -Arguments: [cast(ss_item_sk#129 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#136 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#129 ASC NULLS FIRST, ss_ticket_number#136 ASC NULLS FIRST], false, 0 (137) ReusedExchange [Reuses operator id: 10] Output [2]: [sr_item_sk#143, sr_ticket_number#144] @@ -825,7 +825,7 @@ Input [2]: [sr_item_sk#143, sr_ticket_number#144] Arguments: [sr_item_sk#143 ASC NULLS FIRST, sr_ticket_number#144 ASC NULLS FIRST], false, 0 (139) SortMergeJoin [codegen id : 56] -Left keys [2]: [cast(ss_item_sk#129 as bigint), cast(ss_ticket_number#136 as bigint)] +Left keys [2]: [ss_item_sk#129, ss_ticket_number#136] Right keys [2]: [sr_item_sk#143, sr_ticket_number#144] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/explain.txt index 0115f4ab8a63a..8a0e66f7f44ed 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/explain.txt @@ -207,14 +207,14 @@ Condition : (((((((isnotnull(ss_item_sk#1) AND isnotnull(ss_ticket_number#8)) AN (4) BroadcastExchange Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[7, int, false] as bigint)),false), [id=#14] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[7, int, false] as bigint) & 4294967295))),false), [id=#14] (5) Scan parquet default.store_returns Output [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (6) ColumnarToRow Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] @@ -228,7 +228,7 @@ Output [2]: [sr_item_sk#15, sr_ticket_number#16] Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] (9) BroadcastHashJoin [codegen id : 2] -Left keys [2]: [cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#8 as bigint)] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#8] Right keys [2]: [sr_item_sk#15, sr_ticket_number#16] Join condition: None @@ -717,14 +717,14 @@ Condition : (((((((isnotnull(ss_item_sk#122) AND isnotnull(ss_ticket_number#129) (118) BroadcastExchange Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[7, int, false] as bigint)),false), [id=#135] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[7, int, false] as bigint) & 4294967295))),false), [id=#135] (119) Scan parquet default.store_returns Output [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (120) ColumnarToRow Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] @@ -738,7 +738,7 @@ Output [2]: [sr_item_sk#136, sr_ticket_number#137] Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] (123) BroadcastHashJoin [codegen id : 28] -Left keys [2]: [cast(ss_item_sk#122 as bigint), cast(ss_ticket_number#129 as bigint)] +Left keys [2]: [ss_item_sk#122, ss_ticket_number#129] Right keys [2]: [sr_item_sk#136, sr_ticket_number#137] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt index 56998d9197835..420144cfe4536 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt @@ -291,18 +291,18 @@ Input [11]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_pr (36) Exchange Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] -Arguments: hashpartitioning(cast(ss_ticket_number#27 as bigint), cast(ss_item_sk#26 as bigint), 5), ENSURE_REQUIREMENTS, [id=#38] +Arguments: hashpartitioning(ss_ticket_number#27, ss_item_sk#26, 5), ENSURE_REQUIREMENTS, [id=#38] (37) Sort [codegen id : 11] Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] -Arguments: [cast(ss_ticket_number#27 as bigint) ASC NULLS FIRST, cast(ss_item_sk#26 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#27 ASC NULLS FIRST, ss_item_sk#26 ASC NULLS FIRST], false, 0 (38) Scan parquet default.store_returns Output [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (39) ColumnarToRow [codegen id : 12] Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] @@ -324,7 +324,7 @@ Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return Arguments: [sr_ticket_number#40 ASC NULLS FIRST, sr_item_sk#39 ASC NULLS FIRST], false, 0 (44) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#27 as bigint), cast(ss_item_sk#26 as bigint)] +Left keys [2]: [ss_ticket_number#27, ss_item_sk#26] Right keys [2]: [sr_ticket_number#40, sr_item_sk#39] Join condition: None @@ -373,18 +373,18 @@ Input [11]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_pri (55) Exchange Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] -Arguments: hashpartitioning(cast(ws_order_number#48 as bigint), cast(ws_item_sk#47 as bigint), 5), ENSURE_REQUIREMENTS, [id=#59] +Arguments: hashpartitioning(ws_order_number#48, ws_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#59] (56) Sort [codegen id : 18] Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] -Arguments: [cast(ws_order_number#48 as bigint) ASC NULLS FIRST, cast(ws_item_sk#47 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_order_number#48 ASC NULLS FIRST, ws_item_sk#47 ASC NULLS FIRST], false, 0 (57) Scan parquet default.web_returns Output [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (58) ColumnarToRow [codegen id : 19] Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] @@ -406,7 +406,7 @@ Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_ Arguments: [wr_order_number#61 ASC NULLS FIRST, wr_item_sk#60 ASC NULLS FIRST], false, 0 (63) SortMergeJoin -Left keys [2]: [cast(ws_order_number#48 as bigint), cast(ws_item_sk#47 as bigint)] +Left keys [2]: [ws_order_number#48, ws_item_sk#47] Right keys [2]: [wr_order_number#61, wr_item_sk#60] Join condition: None @@ -579,11 +579,11 @@ Input [11]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_p (101) Exchange Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] -Arguments: hashpartitioning(cast(ss_ticket_number#99 as bigint), cast(ss_item_sk#98 as bigint), 5), ENSURE_REQUIREMENTS, [id=#110] +Arguments: hashpartitioning(ss_ticket_number#99, ss_item_sk#98, 5), ENSURE_REQUIREMENTS, [id=#110] (102) Sort [codegen id : 36] Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] -Arguments: [cast(ss_ticket_number#99 as bigint) ASC NULLS FIRST, cast(ss_item_sk#98 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#99 ASC NULLS FIRST, ss_item_sk#98 ASC NULLS FIRST], false, 0 (103) ReusedExchange [Reuses operator id: 42] Output [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] @@ -593,76 +593,76 @@ Input [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_ret Arguments: [sr_ticket_number#112 ASC NULLS FIRST, sr_item_sk#111 ASC NULLS FIRST], false, 0 (105) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#99 as bigint), cast(ss_item_sk#98 as bigint)] +Left keys [2]: [ss_ticket_number#99, ss_item_sk#98] Right keys [2]: [sr_ticket_number#112, sr_item_sk#111] Join condition: None (106) Project [codegen id : 39] -Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#115] +Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] Input [13]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109, sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] (107) Scan parquet default.web_sales -Output [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] +Output [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#120), dynamicpruningexpression(ws_sold_date_sk#120 IN dynamicpruning#84)] +PartitionFilters: [isnotnull(ws_sold_date_sk#119), dynamicpruningexpression(ws_sold_date_sk#119 IN dynamicpruning#84)] PushedFilters: [IsNotNull(ws_item_sk)] ReadSchema: struct (108) ColumnarToRow [codegen id : 42] -Input [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] (109) Filter [codegen id : 42] -Input [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] -Condition : isnotnull(ws_item_sk#116) +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Condition : isnotnull(ws_item_sk#115) (110) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#121, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] +Output [5]: [i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] (111) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ws_item_sk#116] -Right keys [1]: [i_item_sk#121] +Left keys [1]: [ws_item_sk#115] +Right keys [1]: [i_item_sk#120] Join condition: None (112) Project [codegen id : 42] -Output [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] -Input [10]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_item_sk#121, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] +Input [10]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] (113) ReusedExchange [Reuses operator id: 83] -Output [2]: [d_date_sk#126, d_year#127] +Output [2]: [d_date_sk#125, d_year#126] (114) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ws_sold_date_sk#120] -Right keys [1]: [d_date_sk#126] +Left keys [1]: [ws_sold_date_sk#119] +Right keys [1]: [d_date_sk#125] Join condition: None (115) Project [codegen id : 42] -Output [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Input [11]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_date_sk#126, d_year#127] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Input [11]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_date_sk#125, d_year#126] (116) Exchange -Input [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Arguments: hashpartitioning(cast(ws_order_number#117 as bigint), cast(ws_item_sk#116 as bigint), 5), ENSURE_REQUIREMENTS, [id=#128] +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: hashpartitioning(ws_order_number#116, ws_item_sk#115, 5), ENSURE_REQUIREMENTS, [id=#127] (117) Sort [codegen id : 43] -Input [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Arguments: [cast(ws_order_number#117 as bigint) ASC NULLS FIRST, cast(ws_item_sk#116 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: [ws_order_number#116 ASC NULLS FIRST, ws_item_sk#115 ASC NULLS FIRST], false, 0 (118) ReusedExchange [Reuses operator id: 61] -Output [4]: [wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] +Output [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] (119) Sort [codegen id : 45] -Input [4]: [wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] -Arguments: [wr_order_number#130 ASC NULLS FIRST, wr_item_sk#129 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] +Arguments: [wr_order_number#129 ASC NULLS FIRST, wr_item_sk#128 ASC NULLS FIRST], false, 0 (120) SortMergeJoin -Left keys [2]: [cast(ws_order_number#117 as bigint), cast(ws_item_sk#116 as bigint)] -Right keys [2]: [wr_order_number#130, wr_item_sk#129] +Left keys [2]: [ws_order_number#116, ws_item_sk#115] +Right keys [2]: [wr_order_number#129, wr_item_sk#128] Join condition: None (121) Project [codegen id : 46] -Output [7]: [d_year#127, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, (ws_quantity#118 - coalesce(wr_return_quantity#131, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#119 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#132, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#133] -Input [13]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127, wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] +Output [7]: [d_year#126, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, (ws_quantity#117 - coalesce(wr_return_quantity#130, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#118 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#131, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126, wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] (122) Union @@ -675,7 +675,7 @@ Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manuf (124) Exchange Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] -Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#134] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#132] (125) HashAggregate [codegen id : 48] Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] @@ -688,40 +688,40 @@ Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manuf Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] -Aggregate Attributes [2]: [sum#135, sum#136] -Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] +Aggregate Attributes [2]: [sum#133, sum#134] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] (127) Exchange -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] -Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#139] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#137] (128) HashAggregate [codegen id : 49] -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] -Aggregate Attributes [2]: [sum(sales_cnt#24)#140, sum(UnscaledValue(sales_amt#25))#141] -Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#140 AS sales_cnt#142, MakeDecimal(sum(UnscaledValue(sales_amt#25))#141,18,2) AS sales_amt#143] +Aggregate Attributes [2]: [sum(sales_cnt#24)#138, sum(UnscaledValue(sales_amt#25))#139] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#138 AS sales_cnt#140, MakeDecimal(sum(UnscaledValue(sales_amt#25))#139,18,2) AS sales_amt#141] (129) Exchange -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] -Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#144] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#142] (130) Sort [codegen id : 50] -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] Arguments: [i_brand_id#86 ASC NULLS FIRST, i_class_id#87 ASC NULLS FIRST, i_category_id#88 ASC NULLS FIRST, i_manufact_id#89 ASC NULLS FIRST], false, 0 (131) SortMergeJoin [codegen id : 51] Left keys [4]: [i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] Right keys [4]: [i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#142 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#140 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (132) Project [codegen id : 51] -Output [10]: [d_year#91 AS prev_year#145, d_year#15 AS year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#142 AS prev_yr_cnt#147, sales_cnt#76 AS curr_yr_cnt#148, (sales_cnt#76 - sales_cnt#142) AS sales_cnt_diff#149, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#143 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#150] -Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] +Output [10]: [d_year#91 AS prev_year#143, d_year#15 AS year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#140 AS prev_yr_cnt#145, sales_cnt#76 AS curr_yr_cnt#146, (sales_cnt#76 - sales_cnt#140) AS sales_cnt_diff#147, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#141 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#148] +Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] (133) TakeOrderedAndProject -Input [10]: [prev_year#145, year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#147, curr_yr_cnt#148, sales_cnt_diff#149, sales_amt_diff#150] -Arguments: 100, [sales_cnt_diff#149 ASC NULLS FIRST, sales_amt_diff#150 ASC NULLS FIRST], [prev_year#145, year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#147, curr_yr_cnt#148, sales_cnt_diff#149, sales_amt_diff#150] +Input [10]: [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] +Arguments: 100, [sales_cnt_diff#147 ASC NULLS FIRST, sales_amt_diff#148 ASC NULLS FIRST], [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] ===== Subqueries ===== @@ -745,6 +745,6 @@ Output [2]: [d_date_sk#90, d_year#91] Subquery:5 Hosting operator id = 92 Hosting Expression = ss_sold_date_sk#102 IN dynamicpruning#84 -Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#120 IN dynamicpruning#84 +Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#119 IN dynamicpruning#84 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt index 56998d9197835..420144cfe4536 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt @@ -291,18 +291,18 @@ Input [11]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_pr (36) Exchange Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] -Arguments: hashpartitioning(cast(ss_ticket_number#27 as bigint), cast(ss_item_sk#26 as bigint), 5), ENSURE_REQUIREMENTS, [id=#38] +Arguments: hashpartitioning(ss_ticket_number#27, ss_item_sk#26, 5), ENSURE_REQUIREMENTS, [id=#38] (37) Sort [codegen id : 11] Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] -Arguments: [cast(ss_ticket_number#27 as bigint) ASC NULLS FIRST, cast(ss_item_sk#26 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#27 ASC NULLS FIRST, ss_item_sk#26 ASC NULLS FIRST], false, 0 (38) Scan parquet default.store_returns Output [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (39) ColumnarToRow [codegen id : 12] Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] @@ -324,7 +324,7 @@ Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return Arguments: [sr_ticket_number#40 ASC NULLS FIRST, sr_item_sk#39 ASC NULLS FIRST], false, 0 (44) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#27 as bigint), cast(ss_item_sk#26 as bigint)] +Left keys [2]: [ss_ticket_number#27, ss_item_sk#26] Right keys [2]: [sr_ticket_number#40, sr_item_sk#39] Join condition: None @@ -373,18 +373,18 @@ Input [11]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_pri (55) Exchange Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] -Arguments: hashpartitioning(cast(ws_order_number#48 as bigint), cast(ws_item_sk#47 as bigint), 5), ENSURE_REQUIREMENTS, [id=#59] +Arguments: hashpartitioning(ws_order_number#48, ws_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#59] (56) Sort [codegen id : 18] Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] -Arguments: [cast(ws_order_number#48 as bigint) ASC NULLS FIRST, cast(ws_item_sk#47 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_order_number#48 ASC NULLS FIRST, ws_item_sk#47 ASC NULLS FIRST], false, 0 (57) Scan parquet default.web_returns Output [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (58) ColumnarToRow [codegen id : 19] Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] @@ -406,7 +406,7 @@ Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_ Arguments: [wr_order_number#61 ASC NULLS FIRST, wr_item_sk#60 ASC NULLS FIRST], false, 0 (63) SortMergeJoin -Left keys [2]: [cast(ws_order_number#48 as bigint), cast(ws_item_sk#47 as bigint)] +Left keys [2]: [ws_order_number#48, ws_item_sk#47] Right keys [2]: [wr_order_number#61, wr_item_sk#60] Join condition: None @@ -579,11 +579,11 @@ Input [11]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_p (101) Exchange Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] -Arguments: hashpartitioning(cast(ss_ticket_number#99 as bigint), cast(ss_item_sk#98 as bigint), 5), ENSURE_REQUIREMENTS, [id=#110] +Arguments: hashpartitioning(ss_ticket_number#99, ss_item_sk#98, 5), ENSURE_REQUIREMENTS, [id=#110] (102) Sort [codegen id : 36] Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] -Arguments: [cast(ss_ticket_number#99 as bigint) ASC NULLS FIRST, cast(ss_item_sk#98 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#99 ASC NULLS FIRST, ss_item_sk#98 ASC NULLS FIRST], false, 0 (103) ReusedExchange [Reuses operator id: 42] Output [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] @@ -593,76 +593,76 @@ Input [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_ret Arguments: [sr_ticket_number#112 ASC NULLS FIRST, sr_item_sk#111 ASC NULLS FIRST], false, 0 (105) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#99 as bigint), cast(ss_item_sk#98 as bigint)] +Left keys [2]: [ss_ticket_number#99, ss_item_sk#98] Right keys [2]: [sr_ticket_number#112, sr_item_sk#111] Join condition: None (106) Project [codegen id : 39] -Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#115] +Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] Input [13]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109, sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] (107) Scan parquet default.web_sales -Output [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] +Output [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#120), dynamicpruningexpression(ws_sold_date_sk#120 IN dynamicpruning#84)] +PartitionFilters: [isnotnull(ws_sold_date_sk#119), dynamicpruningexpression(ws_sold_date_sk#119 IN dynamicpruning#84)] PushedFilters: [IsNotNull(ws_item_sk)] ReadSchema: struct (108) ColumnarToRow [codegen id : 42] -Input [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] (109) Filter [codegen id : 42] -Input [5]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120] -Condition : isnotnull(ws_item_sk#116) +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Condition : isnotnull(ws_item_sk#115) (110) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#121, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] +Output [5]: [i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] (111) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ws_item_sk#116] -Right keys [1]: [i_item_sk#121] +Left keys [1]: [ws_item_sk#115] +Right keys [1]: [i_item_sk#120] Join condition: None (112) Project [codegen id : 42] -Output [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] -Input [10]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_item_sk#121, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] +Input [10]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] (113) ReusedExchange [Reuses operator id: 83] -Output [2]: [d_date_sk#126, d_year#127] +Output [2]: [d_date_sk#125, d_year#126] (114) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ws_sold_date_sk#120] -Right keys [1]: [d_date_sk#126] +Left keys [1]: [ws_sold_date_sk#119] +Right keys [1]: [d_date_sk#125] Join condition: None (115) Project [codegen id : 42] -Output [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Input [11]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, ws_sold_date_sk#120, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_date_sk#126, d_year#127] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Input [11]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_date_sk#125, d_year#126] (116) Exchange -Input [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Arguments: hashpartitioning(cast(ws_order_number#117 as bigint), cast(ws_item_sk#116 as bigint), 5), ENSURE_REQUIREMENTS, [id=#128] +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: hashpartitioning(ws_order_number#116, ws_item_sk#115, 5), ENSURE_REQUIREMENTS, [id=#127] (117) Sort [codegen id : 43] -Input [9]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127] -Arguments: [cast(ws_order_number#117 as bigint) ASC NULLS FIRST, cast(ws_item_sk#116 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: [ws_order_number#116 ASC NULLS FIRST, ws_item_sk#115 ASC NULLS FIRST], false, 0 (118) ReusedExchange [Reuses operator id: 61] -Output [4]: [wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] +Output [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] (119) Sort [codegen id : 45] -Input [4]: [wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] -Arguments: [wr_order_number#130 ASC NULLS FIRST, wr_item_sk#129 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] +Arguments: [wr_order_number#129 ASC NULLS FIRST, wr_item_sk#128 ASC NULLS FIRST], false, 0 (120) SortMergeJoin -Left keys [2]: [cast(ws_order_number#117 as bigint), cast(ws_item_sk#116 as bigint)] -Right keys [2]: [wr_order_number#130, wr_item_sk#129] +Left keys [2]: [ws_order_number#116, ws_item_sk#115] +Right keys [2]: [wr_order_number#129, wr_item_sk#128] Join condition: None (121) Project [codegen id : 46] -Output [7]: [d_year#127, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, (ws_quantity#118 - coalesce(wr_return_quantity#131, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#119 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#132, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#133] -Input [13]: [ws_item_sk#116, ws_order_number#117, ws_quantity#118, ws_ext_sales_price#119, i_brand_id#122, i_class_id#123, i_category_id#124, i_manufact_id#125, d_year#127, wr_item_sk#129, wr_order_number#130, wr_return_quantity#131, wr_return_amt#132] +Output [7]: [d_year#126, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, (ws_quantity#117 - coalesce(wr_return_quantity#130, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#118 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#131, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126, wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] (122) Union @@ -675,7 +675,7 @@ Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manuf (124) Exchange Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] -Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#134] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#132] (125) HashAggregate [codegen id : 48] Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] @@ -688,40 +688,40 @@ Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manuf Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] -Aggregate Attributes [2]: [sum#135, sum#136] -Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] +Aggregate Attributes [2]: [sum#133, sum#134] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] (127) Exchange -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] -Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#139] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#137] (128) HashAggregate [codegen id : 49] -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#137, sum#138] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] -Aggregate Attributes [2]: [sum(sales_cnt#24)#140, sum(UnscaledValue(sales_amt#25))#141] -Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#140 AS sales_cnt#142, MakeDecimal(sum(UnscaledValue(sales_amt#25))#141,18,2) AS sales_amt#143] +Aggregate Attributes [2]: [sum(sales_cnt#24)#138, sum(UnscaledValue(sales_amt#25))#139] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#138 AS sales_cnt#140, MakeDecimal(sum(UnscaledValue(sales_amt#25))#139,18,2) AS sales_amt#141] (129) Exchange -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] -Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#144] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#142] (130) Sort [codegen id : 50] -Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] Arguments: [i_brand_id#86 ASC NULLS FIRST, i_class_id#87 ASC NULLS FIRST, i_category_id#88 ASC NULLS FIRST, i_manufact_id#89 ASC NULLS FIRST], false, 0 (131) SortMergeJoin [codegen id : 51] Left keys [4]: [i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] Right keys [4]: [i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#142 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#140 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (132) Project [codegen id : 51] -Output [10]: [d_year#91 AS prev_year#145, d_year#15 AS year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#142 AS prev_yr_cnt#147, sales_cnt#76 AS curr_yr_cnt#148, (sales_cnt#76 - sales_cnt#142) AS sales_cnt_diff#149, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#143 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#150] -Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#142, sales_amt#143] +Output [10]: [d_year#91 AS prev_year#143, d_year#15 AS year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#140 AS prev_yr_cnt#145, sales_cnt#76 AS curr_yr_cnt#146, (sales_cnt#76 - sales_cnt#140) AS sales_cnt_diff#147, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#141 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#148] +Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] (133) TakeOrderedAndProject -Input [10]: [prev_year#145, year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#147, curr_yr_cnt#148, sales_cnt_diff#149, sales_amt_diff#150] -Arguments: 100, [sales_cnt_diff#149 ASC NULLS FIRST, sales_amt_diff#150 ASC NULLS FIRST], [prev_year#145, year#146, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#147, curr_yr_cnt#148, sales_cnt_diff#149, sales_amt_diff#150] +Input [10]: [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] +Arguments: 100, [sales_cnt_diff#147 ASC NULLS FIRST, sales_amt_diff#148 ASC NULLS FIRST], [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] ===== Subqueries ===== @@ -745,6 +745,6 @@ Output [2]: [d_date_sk#90, d_year#91] Subquery:5 Hosting operator id = 92 Hosting Expression = ss_sold_date_sk#102 IN dynamicpruning#84 -Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#120 IN dynamicpruning#84 +Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#119 IN dynamicpruning#84 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt index 422443509b417..1f4f137f42c4a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt @@ -198,9 +198,9 @@ Results [3]: [s_store_sk#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2)) Output [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#24)] +PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (21) ColumnarToRow [codegen id : 6] Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] @@ -209,51 +209,51 @@ Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_s Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] Condition : isnotnull(sr_store_sk#20) -(23) ReusedExchange [Reuses operator id: 14] -Output [1]: [s_store_sk#25] +(23) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#24] (24) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sr_store_sk#20] -Right keys [1]: [cast(s_store_sk#25 as bigint)] +Left keys [1]: [sr_returned_date_sk#23] +Right keys [1]: [d_date_sk#24] Join condition: None (25) Project [codegen id : 6] -Output [4]: [sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, s_store_sk#25] -Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, s_store_sk#25] +Output [3]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] +Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#24] -(26) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#26] +(26) ReusedExchange [Reuses operator id: 14] +Output [1]: [s_store_sk#25] (27) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sr_returned_date_sk#23] -Right keys [1]: [cast(d_date_sk#26 as bigint)] +Left keys [1]: [sr_store_sk#20] +Right keys [1]: [s_store_sk#25] Join condition: None (28) Project [codegen id : 6] Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] -Input [5]: [sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, s_store_sk#25, d_date_sk#26] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#25] (29) HashAggregate [codegen id : 6] Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] Keys [1]: [s_store_sk#25] Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] -Aggregate Attributes [2]: [sum#27, sum#28] -Results [3]: [s_store_sk#25, sum#29, sum#30] +Aggregate Attributes [2]: [sum#26, sum#27] +Results [3]: [s_store_sk#25, sum#28, sum#29] (30) Exchange -Input [3]: [s_store_sk#25, sum#29, sum#30] -Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#31] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] (31) HashAggregate [codegen id : 7] -Input [3]: [s_store_sk#25, sum#29, sum#30] +Input [3]: [s_store_sk#25, sum#28, sum#29] Keys [1]: [s_store_sk#25] Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] -Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#32, sum(UnscaledValue(sr_net_loss#22))#33] -Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#32,17,2) AS returns#34, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#33,17,2) AS profit_loss#35] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#31, sum(UnscaledValue(sr_net_loss#22))#32] +Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#31,17,2) AS returns#33, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#32,17,2) AS profit_loss#34] (32) BroadcastExchange -Input [3]: [s_store_sk#25, returns#34, profit_loss#35] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#36] +Input [3]: [s_store_sk#25, returns#33, profit_loss#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] (33) BroadcastHashJoin [codegen id : 8] Left keys [1]: [s_store_sk#9] @@ -261,341 +261,341 @@ Right keys [1]: [s_store_sk#25] Join condition: None (34) Project [codegen id : 8] -Output [5]: [store channel AS channel#37, s_store_sk#9 AS id#38, sales#18, coalesce(returns#34, 0.00) AS returns#39, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#35, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#40] -Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#34, profit_loss#35] +Output [5]: [store channel AS channel#36, s_store_sk#9 AS id#37, sales#18, coalesce(returns#33, 0.00) AS returns#38, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#34, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#39] +Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#33, profit_loss#34] (35) Scan parquet default.catalog_sales -Output [4]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44] +Output [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#44), dynamicpruningexpression(cs_sold_date_sk#44 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(cs_sold_date_sk#43), dynamicpruningexpression(cs_sold_date_sk#43 IN dynamicpruning#5)] ReadSchema: struct (36) ColumnarToRow [codegen id : 10] -Input [4]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44] +Input [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] (37) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#45] +Output [1]: [d_date_sk#44] (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#44] -Right keys [1]: [d_date_sk#45] +Left keys [1]: [cs_sold_date_sk#43] +Right keys [1]: [d_date_sk#44] Join condition: None (39) Project [codegen id : 10] -Output [3]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43] -Input [5]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44, d_date_sk#45] +Output [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Input [5]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43, d_date_sk#44] (40) HashAggregate [codegen id : 10] -Input [3]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43] -Keys [1]: [cs_call_center_sk#41] -Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#42)), partial_sum(UnscaledValue(cs_net_profit#43))] -Aggregate Attributes [2]: [sum#46, sum#47] -Results [3]: [cs_call_center_sk#41, sum#48, sum#49] +Input [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#41)), partial_sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum#45, sum#46] +Results [3]: [cs_call_center_sk#40, sum#47, sum#48] (41) Exchange -Input [3]: [cs_call_center_sk#41, sum#48, sum#49] -Arguments: hashpartitioning(cs_call_center_sk#41, 5), ENSURE_REQUIREMENTS, [id=#50] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Arguments: hashpartitioning(cs_call_center_sk#40, 5), ENSURE_REQUIREMENTS, [id=#49] (42) HashAggregate [codegen id : 14] -Input [3]: [cs_call_center_sk#41, sum#48, sum#49] -Keys [1]: [cs_call_center_sk#41] -Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#42)), sum(UnscaledValue(cs_net_profit#43))] -Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#42))#51, sum(UnscaledValue(cs_net_profit#43))#52] -Results [3]: [cs_call_center_sk#41, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#42))#51,17,2) AS sales#53, MakeDecimal(sum(UnscaledValue(cs_net_profit#43))#52,17,2) AS profit#54] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#41)), sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#41))#50, sum(UnscaledValue(cs_net_profit#42))#51] +Results [3]: [cs_call_center_sk#40, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#41))#50,17,2) AS sales#52, MakeDecimal(sum(UnscaledValue(cs_net_profit#42))#51,17,2) AS profit#53] (43) Scan parquet default.catalog_returns -Output [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] +Output [3]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cr_returned_date_sk#57), dynamicpruningexpression(cr_returned_date_sk#57 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(cr_returned_date_sk#56), dynamicpruningexpression(cr_returned_date_sk#56 IN dynamicpruning#5)] ReadSchema: struct (44) ColumnarToRow [codegen id : 12] -Input [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] +Input [3]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56] (45) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#58] +Output [1]: [d_date_sk#57] (46) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [cr_returned_date_sk#57] -Right keys [1]: [d_date_sk#58] +Left keys [1]: [cr_returned_date_sk#56] +Right keys [1]: [d_date_sk#57] Join condition: None (47) Project [codegen id : 12] -Output [2]: [cr_return_amount#55, cr_net_loss#56] -Input [4]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57, d_date_sk#58] +Output [2]: [cr_return_amount#54, cr_net_loss#55] +Input [4]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56, d_date_sk#57] (48) HashAggregate [codegen id : 12] -Input [2]: [cr_return_amount#55, cr_net_loss#56] +Input [2]: [cr_return_amount#54, cr_net_loss#55] Keys: [] -Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#55)), partial_sum(UnscaledValue(cr_net_loss#56))] -Aggregate Attributes [2]: [sum#59, sum#60] -Results [2]: [sum#61, sum#62] +Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#54)), partial_sum(UnscaledValue(cr_net_loss#55))] +Aggregate Attributes [2]: [sum#58, sum#59] +Results [2]: [sum#60, sum#61] (49) Exchange -Input [2]: [sum#61, sum#62] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#63] +Input [2]: [sum#60, sum#61] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#62] (50) HashAggregate [codegen id : 13] -Input [2]: [sum#61, sum#62] +Input [2]: [sum#60, sum#61] Keys: [] -Functions [2]: [sum(UnscaledValue(cr_return_amount#55)), sum(UnscaledValue(cr_net_loss#56))] -Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#55))#64, sum(UnscaledValue(cr_net_loss#56))#65] -Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#55))#64,17,2) AS returns#66, MakeDecimal(sum(UnscaledValue(cr_net_loss#56))#65,17,2) AS profit_loss#67] +Functions [2]: [sum(UnscaledValue(cr_return_amount#54)), sum(UnscaledValue(cr_net_loss#55))] +Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#54))#63, sum(UnscaledValue(cr_net_loss#55))#64] +Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#54))#63,17,2) AS returns#65, MakeDecimal(sum(UnscaledValue(cr_net_loss#55))#64,17,2) AS profit_loss#66] (51) BroadcastExchange -Input [2]: [returns#66, profit_loss#67] -Arguments: IdentityBroadcastMode, [id=#68] +Input [2]: [returns#65, profit_loss#66] +Arguments: IdentityBroadcastMode, [id=#67] (52) BroadcastNestedLoopJoin [codegen id : 14] Join condition: None (53) Project [codegen id : 14] -Output [5]: [catalog channel AS channel#69, cs_call_center_sk#41 AS id#70, sales#53, returns#66, CheckOverflow((promote_precision(cast(profit#54 as decimal(18,2))) - promote_precision(cast(profit_loss#67 as decimal(18,2)))), DecimalType(18,2), true) AS profit#71] -Input [5]: [cs_call_center_sk#41, sales#53, profit#54, returns#66, profit_loss#67] +Output [5]: [catalog channel AS channel#68, cs_call_center_sk#40 AS id#69, sales#52, returns#65, CheckOverflow((promote_precision(cast(profit#53 as decimal(18,2))) - promote_precision(cast(profit_loss#66 as decimal(18,2)))), DecimalType(18,2), true) AS profit#70] +Input [5]: [cs_call_center_sk#40, sales#52, profit#53, returns#65, profit_loss#66] (54) Scan parquet default.web_sales -Output [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] +Output [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#75), dynamicpruningexpression(ws_sold_date_sk#75 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ws_sold_date_sk#74), dynamicpruningexpression(ws_sold_date_sk#74 IN dynamicpruning#5)] PushedFilters: [IsNotNull(ws_web_page_sk)] ReadSchema: struct (55) ColumnarToRow [codegen id : 17] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] (56) Filter [codegen id : 17] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] -Condition : isnotnull(ws_web_page_sk#72) +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Condition : isnotnull(ws_web_page_sk#71) (57) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#76] +Output [1]: [d_date_sk#75] (58) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_sold_date_sk#75] -Right keys [1]: [d_date_sk#76] +Left keys [1]: [ws_sold_date_sk#74] +Right keys [1]: [d_date_sk#75] Join condition: None (59) Project [codegen id : 17] -Output [3]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74] -Input [5]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75, d_date_sk#76] +Output [3]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73] +Input [5]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74, d_date_sk#75] (60) Scan parquet default.web_page -Output [1]: [wp_web_page_sk#77] +Output [1]: [wp_web_page_sk#76] Batched: true Location [not included in comparison]/{warehouse_dir}/web_page] PushedFilters: [IsNotNull(wp_web_page_sk)] ReadSchema: struct (61) ColumnarToRow [codegen id : 16] -Input [1]: [wp_web_page_sk#77] +Input [1]: [wp_web_page_sk#76] (62) Filter [codegen id : 16] -Input [1]: [wp_web_page_sk#77] -Condition : isnotnull(wp_web_page_sk#77) +Input [1]: [wp_web_page_sk#76] +Condition : isnotnull(wp_web_page_sk#76) (63) BroadcastExchange -Input [1]: [wp_web_page_sk#77] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#78] +Input [1]: [wp_web_page_sk#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] (64) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_web_page_sk#72] -Right keys [1]: [wp_web_page_sk#77] +Left keys [1]: [ws_web_page_sk#71] +Right keys [1]: [wp_web_page_sk#76] Join condition: None (65) Project [codegen id : 17] -Output [3]: [ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] +Output [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] (66) HashAggregate [codegen id : 17] -Input [3]: [ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] -Keys [1]: [wp_web_page_sk#77] -Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#73)), partial_sum(UnscaledValue(ws_net_profit#74))] -Aggregate Attributes [2]: [sum#79, sum#80] -Results [3]: [wp_web_page_sk#77, sum#81, sum#82] +Input [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#72)), partial_sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum#78, sum#79] +Results [3]: [wp_web_page_sk#76, sum#80, sum#81] (67) Exchange -Input [3]: [wp_web_page_sk#77, sum#81, sum#82] -Arguments: hashpartitioning(wp_web_page_sk#77, 5), ENSURE_REQUIREMENTS, [id=#83] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Arguments: hashpartitioning(wp_web_page_sk#76, 5), ENSURE_REQUIREMENTS, [id=#82] (68) HashAggregate [codegen id : 22] -Input [3]: [wp_web_page_sk#77, sum#81, sum#82] -Keys [1]: [wp_web_page_sk#77] -Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#73)), sum(UnscaledValue(ws_net_profit#74))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#73))#84, sum(UnscaledValue(ws_net_profit#74))#85] -Results [3]: [wp_web_page_sk#77, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#73))#84,17,2) AS sales#86, MakeDecimal(sum(UnscaledValue(ws_net_profit#74))#85,17,2) AS profit#87] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#72)), sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#72))#83, sum(UnscaledValue(ws_net_profit#73))#84] +Results [3]: [wp_web_page_sk#76, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#72))#83,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(ws_net_profit#73))#84,17,2) AS profit#86] (69) Scan parquet default.web_returns -Output [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] +Output [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#91), dynamicpruningexpression(wr_returned_date_sk#91 IN dynamicpruning#24)] +PartitionFilters: [isnotnull(wr_returned_date_sk#90), dynamicpruningexpression(wr_returned_date_sk#90 IN dynamicpruning#5)] PushedFilters: [IsNotNull(wr_web_page_sk)] -ReadSchema: struct +ReadSchema: struct (70) ColumnarToRow [codegen id : 20] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] (71) Filter [codegen id : 20] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] -Condition : isnotnull(wr_web_page_sk#88) +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Condition : isnotnull(wr_web_page_sk#87) -(72) ReusedExchange [Reuses operator id: 63] -Output [1]: [wp_web_page_sk#92] +(72) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#91] (73) BroadcastHashJoin [codegen id : 20] -Left keys [1]: [wr_web_page_sk#88] -Right keys [1]: [cast(wp_web_page_sk#92 as bigint)] +Left keys [1]: [wr_returned_date_sk#90] +Right keys [1]: [d_date_sk#91] Join condition: None (74) Project [codegen id : 20] -Output [4]: [wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91, wp_web_page_sk#92] -Input [5]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91, wp_web_page_sk#92] +Output [3]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89] +Input [5]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90, d_date_sk#91] -(75) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#93] +(75) ReusedExchange [Reuses operator id: 63] +Output [1]: [wp_web_page_sk#92] (76) BroadcastHashJoin [codegen id : 20] -Left keys [1]: [wr_returned_date_sk#91] -Right keys [1]: [cast(d_date_sk#93 as bigint)] +Left keys [1]: [wr_web_page_sk#87] +Right keys [1]: [wp_web_page_sk#92] Join condition: None (77) Project [codegen id : 20] -Output [3]: [wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#92] -Input [5]: [wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91, wp_web_page_sk#92, d_date_sk#93] +Output [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] (78) HashAggregate [codegen id : 20] -Input [3]: [wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#92] +Input [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] Keys [1]: [wp_web_page_sk#92] -Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#89)), partial_sum(UnscaledValue(wr_net_loss#90))] -Aggregate Attributes [2]: [sum#94, sum#95] -Results [3]: [wp_web_page_sk#92, sum#96, sum#97] +Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#88)), partial_sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum#93, sum#94] +Results [3]: [wp_web_page_sk#92, sum#95, sum#96] (79) Exchange -Input [3]: [wp_web_page_sk#92, sum#96, sum#97] -Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#98] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#97] (80) HashAggregate [codegen id : 21] -Input [3]: [wp_web_page_sk#92, sum#96, sum#97] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] Keys [1]: [wp_web_page_sk#92] -Functions [2]: [sum(UnscaledValue(wr_return_amt#89)), sum(UnscaledValue(wr_net_loss#90))] -Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#89))#99, sum(UnscaledValue(wr_net_loss#90))#100] -Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#89))#99,17,2) AS returns#101, MakeDecimal(sum(UnscaledValue(wr_net_loss#90))#100,17,2) AS profit_loss#102] +Functions [2]: [sum(UnscaledValue(wr_return_amt#88)), sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#88))#98, sum(UnscaledValue(wr_net_loss#89))#99] +Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#88))#98,17,2) AS returns#100, MakeDecimal(sum(UnscaledValue(wr_net_loss#89))#99,17,2) AS profit_loss#101] (81) BroadcastExchange -Input [3]: [wp_web_page_sk#92, returns#101, profit_loss#102] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#103] +Input [3]: [wp_web_page_sk#92, returns#100, profit_loss#101] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] (82) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [wp_web_page_sk#77] +Left keys [1]: [wp_web_page_sk#76] Right keys [1]: [wp_web_page_sk#92] Join condition: None (83) Project [codegen id : 22] -Output [5]: [web channel AS channel#104, wp_web_page_sk#77 AS id#105, sales#86, coalesce(returns#101, 0.00) AS returns#106, CheckOverflow((promote_precision(cast(profit#87 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#102, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#107] -Input [6]: [wp_web_page_sk#77, sales#86, profit#87, wp_web_page_sk#92, returns#101, profit_loss#102] +Output [5]: [web channel AS channel#103, wp_web_page_sk#76 AS id#104, sales#85, coalesce(returns#100, 0.00) AS returns#105, CheckOverflow((promote_precision(cast(profit#86 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#101, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#106] +Input [6]: [wp_web_page_sk#76, sales#85, profit#86, wp_web_page_sk#92, returns#100, profit_loss#101] (84) Union (85) HashAggregate [codegen id : 23] -Input [5]: [channel#37, id#38, sales#18, returns#39, profit#40] -Keys [2]: [channel#37, id#38] -Functions [3]: [partial_sum(sales#18), partial_sum(returns#39), partial_sum(profit#40)] -Aggregate Attributes [6]: [sum#108, isEmpty#109, sum#110, isEmpty#111, sum#112, isEmpty#113] -Results [8]: [channel#37, id#38, sum#114, isEmpty#115, sum#116, isEmpty#117, sum#118, isEmpty#119] +Input [5]: [channel#36, id#37, sales#18, returns#38, profit#39] +Keys [2]: [channel#36, id#37] +Functions [3]: [partial_sum(sales#18), partial_sum(returns#38), partial_sum(profit#39)] +Aggregate Attributes [6]: [sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Results [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] (86) Exchange -Input [8]: [channel#37, id#38, sum#114, isEmpty#115, sum#116, isEmpty#117, sum#118, isEmpty#119] -Arguments: hashpartitioning(channel#37, id#38, 5), ENSURE_REQUIREMENTS, [id=#120] +Input [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] +Arguments: hashpartitioning(channel#36, id#37, 5), ENSURE_REQUIREMENTS, [id=#119] (87) HashAggregate [codegen id : 24] -Input [8]: [channel#37, id#38, sum#114, isEmpty#115, sum#116, isEmpty#117, sum#118, isEmpty#119] -Keys [2]: [channel#37, id#38] -Functions [3]: [sum(sales#18), sum(returns#39), sum(profit#40)] -Aggregate Attributes [3]: [sum(sales#18)#121, sum(returns#39)#122, sum(profit#40)#123] -Results [5]: [channel#37, id#38, cast(sum(sales#18)#121 as decimal(37,2)) AS sales#124, cast(sum(returns#39)#122 as decimal(37,2)) AS returns#125, cast(sum(profit#40)#123 as decimal(38,2)) AS profit#126] +Input [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#39)] +Aggregate Attributes [3]: [sum(sales#18)#120, sum(returns#38)#121, sum(profit#39)#122] +Results [5]: [channel#36, id#37, cast(sum(sales#18)#120 as decimal(37,2)) AS sales#123, cast(sum(returns#38)#121 as decimal(37,2)) AS returns#124, cast(sum(profit#39)#122 as decimal(38,2)) AS profit#125] (88) ReusedExchange [Reuses operator id: unknown] -Output [8]: [channel#37, id#38, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] +Output [8]: [channel#36, id#37, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] (89) HashAggregate [codegen id : 48] -Input [8]: [channel#37, id#38, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] -Keys [2]: [channel#37, id#38] -Functions [3]: [sum(sales#18), sum(returns#39), sum(profit#133)] -Aggregate Attributes [3]: [sum(sales#18)#134, sum(returns#39)#135, sum(profit#133)#136] -Results [4]: [channel#37, sum(sales#18)#134 AS sales#137, sum(returns#39)#135 AS returns#138, sum(profit#133)#136 AS profit#139] +Input [8]: [channel#36, id#37, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#132)] +Aggregate Attributes [3]: [sum(sales#18)#133, sum(returns#38)#134, sum(profit#132)#135] +Results [4]: [channel#36, sum(sales#18)#133 AS sales#136, sum(returns#38)#134 AS returns#137, sum(profit#132)#135 AS profit#138] (90) HashAggregate [codegen id : 48] -Input [4]: [channel#37, sales#137, returns#138, profit#139] -Keys [1]: [channel#37] -Functions [3]: [partial_sum(sales#137), partial_sum(returns#138), partial_sum(profit#139)] -Aggregate Attributes [6]: [sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] -Results [7]: [channel#37, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] +Input [4]: [channel#36, sales#136, returns#137, profit#138] +Keys [1]: [channel#36] +Functions [3]: [partial_sum(sales#136), partial_sum(returns#137), partial_sum(profit#138)] +Aggregate Attributes [6]: [sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Results [7]: [channel#36, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] (91) Exchange -Input [7]: [channel#37, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] -Arguments: hashpartitioning(channel#37, 5), ENSURE_REQUIREMENTS, [id=#152] +Input [7]: [channel#36, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] +Arguments: hashpartitioning(channel#36, 5), ENSURE_REQUIREMENTS, [id=#151] (92) HashAggregate [codegen id : 49] -Input [7]: [channel#37, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] -Keys [1]: [channel#37] -Functions [3]: [sum(sales#137), sum(returns#138), sum(profit#139)] -Aggregate Attributes [3]: [sum(sales#137)#153, sum(returns#138)#154, sum(profit#139)#155] -Results [5]: [channel#37, null AS id#156, sum(sales#137)#153 AS sales#157, sum(returns#138)#154 AS returns#158, sum(profit#139)#155 AS profit#159] +Input [7]: [channel#36, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] +Keys [1]: [channel#36] +Functions [3]: [sum(sales#136), sum(returns#137), sum(profit#138)] +Aggregate Attributes [3]: [sum(sales#136)#152, sum(returns#137)#153, sum(profit#138)#154] +Results [5]: [channel#36, null AS id#155, sum(sales#136)#152 AS sales#156, sum(returns#137)#153 AS returns#157, sum(profit#138)#154 AS profit#158] (93) ReusedExchange [Reuses operator id: unknown] -Output [8]: [channel#37, id#38, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] +Output [8]: [channel#36, id#37, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] (94) HashAggregate [codegen id : 73] -Input [8]: [channel#37, id#38, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] -Keys [2]: [channel#37, id#38] -Functions [3]: [sum(sales#18), sum(returns#39), sum(profit#166)] -Aggregate Attributes [3]: [sum(sales#18)#167, sum(returns#39)#168, sum(profit#166)#169] -Results [3]: [sum(sales#18)#167 AS sales#137, sum(returns#39)#168 AS returns#138, sum(profit#166)#169 AS profit#139] +Input [8]: [channel#36, id#37, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#165)] +Aggregate Attributes [3]: [sum(sales#18)#166, sum(returns#38)#167, sum(profit#165)#168] +Results [3]: [sum(sales#18)#166 AS sales#136, sum(returns#38)#167 AS returns#137, sum(profit#165)#168 AS profit#138] (95) HashAggregate [codegen id : 73] -Input [3]: [sales#137, returns#138, profit#139] +Input [3]: [sales#136, returns#137, profit#138] Keys: [] -Functions [3]: [partial_sum(sales#137), partial_sum(returns#138), partial_sum(profit#139)] -Aggregate Attributes [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] -Results [6]: [sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Functions [3]: [partial_sum(sales#136), partial_sum(returns#137), partial_sum(profit#138)] +Aggregate Attributes [6]: [sum#169, isEmpty#170, sum#171, isEmpty#172, sum#173, isEmpty#174] +Results [6]: [sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] (96) Exchange -Input [6]: [sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#182] +Input [6]: [sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#181] (97) HashAggregate [codegen id : 74] -Input [6]: [sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Input [6]: [sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] Keys: [] -Functions [3]: [sum(sales#137), sum(returns#138), sum(profit#139)] -Aggregate Attributes [3]: [sum(sales#137)#183, sum(returns#138)#184, sum(profit#139)#185] -Results [5]: [null AS channel#186, null AS id#187, sum(sales#137)#183 AS sales#188, sum(returns#138)#184 AS returns#189, sum(profit#139)#185 AS profit#190] +Functions [3]: [sum(sales#136), sum(returns#137), sum(profit#138)] +Aggregate Attributes [3]: [sum(sales#136)#182, sum(returns#137)#183, sum(profit#138)#184] +Results [5]: [null AS channel#185, null AS id#186, sum(sales#136)#182 AS sales#187, sum(returns#137)#183 AS returns#188, sum(profit#138)#184 AS profit#189] (98) Union (99) HashAggregate [codegen id : 75] -Input [5]: [channel#37, id#38, sales#124, returns#125, profit#126] -Keys [5]: [channel#37, id#38, sales#124, returns#125, profit#126] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Keys [5]: [channel#36, id#37, sales#123, returns#124, profit#125] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#37, id#38, sales#124, returns#125, profit#126] +Results [5]: [channel#36, id#37, sales#123, returns#124, profit#125] (100) Exchange -Input [5]: [channel#37, id#38, sales#124, returns#125, profit#126] -Arguments: hashpartitioning(channel#37, id#38, sales#124, returns#125, profit#126, 5), ENSURE_REQUIREMENTS, [id=#191] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Arguments: hashpartitioning(channel#36, id#37, sales#123, returns#124, profit#125, 5), ENSURE_REQUIREMENTS, [id=#190] (101) HashAggregate [codegen id : 76] -Input [5]: [channel#37, id#38, sales#124, returns#125, profit#126] -Keys [5]: [channel#37, id#38, sales#124, returns#125, profit#126] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Keys [5]: [channel#36, id#37, sales#123, returns#124, profit#125] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#37, id#38, sales#124, returns#125, profit#126] +Results [5]: [channel#36, id#37, sales#123, returns#124, profit#125] (102) TakeOrderedAndProject -Input [5]: [channel#37, id#38, sales#124, returns#125, profit#126] -Arguments: 100, [channel#37 ASC NULLS FIRST, id#38 ASC NULLS FIRST], [channel#37, id#38, sales#124, returns#125, profit#126] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Arguments: 100, [channel#36 ASC NULLS FIRST, id#37 ASC NULLS FIRST], [channel#36, id#37, sales#123, returns#124, profit#125] ===== Subqueries ===== @@ -606,19 +606,14 @@ ReusedExchange (103) (103) ReusedExchange [Reuses operator id: 8] Output [1]: [d_date_sk#6] -Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#24 -ReusedExchange (104) - - -(104) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#26] +Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#5 -Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#44 IN dynamicpruning#5 +Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#43 IN dynamicpruning#5 -Subquery:4 Hosting operator id = 43 Hosting Expression = cr_returned_date_sk#57 IN dynamicpruning#5 +Subquery:4 Hosting operator id = 43 Hosting Expression = cr_returned_date_sk#56 IN dynamicpruning#5 -Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#75 IN dynamicpruning#5 +Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#74 IN dynamicpruning#5 -Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#91 IN dynamicpruning#24 +Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#90 IN dynamicpruning#5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt index 88605e50dd04b..4cadc7fb960a2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt @@ -57,19 +57,18 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (6) HashAggregate [s_store_sk,sr_return_amt,sr_net_loss] [sum,sum,sum,sum] Project [sr_return_amt,sr_net_loss,s_store_sk] - BroadcastHashJoin [sr_returned_date_sk,d_date_sk] - Project [sr_return_amt,sr_net_loss,sr_returned_date_sk,s_store_sk] - BroadcastHashJoin [sr_store_sk,s_store_sk] + BroadcastHashJoin [sr_store_sk,s_store_sk] + Project [sr_store_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] Filter [sr_store_sk] ColumnarToRow InputAdapter Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] - SubqueryBroadcast [d_date_sk] #2 - ReusedExchange [d_date_sk] #4 + ReusedSubquery [d_date_sk] #1 InputAdapter - ReusedExchange [s_store_sk] #5 + ReusedExchange [d_date_sk] #4 InputAdapter - ReusedExchange [d_date_sk] #4 + ReusedExchange [s_store_sk] #5 WholeStageCodegen (14) Project [cs_call_center_sk,sales,returns,profit,profit_loss] BroadcastNestedLoopJoin @@ -137,18 +136,18 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (20) HashAggregate [wp_web_page_sk,wr_return_amt,wr_net_loss] [sum,sum,sum,sum] Project [wr_return_amt,wr_net_loss,wp_web_page_sk] - BroadcastHashJoin [wr_returned_date_sk,d_date_sk] - Project [wr_return_amt,wr_net_loss,wr_returned_date_sk,wp_web_page_sk] - BroadcastHashJoin [wr_web_page_sk,wp_web_page_sk] + BroadcastHashJoin [wr_web_page_sk,wp_web_page_sk] + Project [wr_web_page_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] Filter [wr_web_page_sk] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_web_page_sk,wr_return_amt,wr_net_loss,wr_returned_date_sk] - ReusedSubquery [d_date_sk] #2 + ReusedSubquery [d_date_sk] #1 InputAdapter - ReusedExchange [wp_web_page_sk] #12 + ReusedExchange [d_date_sk] #4 InputAdapter - ReusedExchange [d_date_sk] #4 + ReusedExchange [wp_web_page_sk] #12 WholeStageCodegen (49) HashAggregate [channel,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),id,sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt index 705277b65ff0a..42c9e941756c3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt @@ -198,9 +198,9 @@ Results [3]: [s_store_sk#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2)) Output [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#24)] +PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#5)] PushedFilters: [IsNotNull(sr_store_sk)] -ReadSchema: struct +ReadSchema: struct (21) ColumnarToRow [codegen id : 6] Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] @@ -210,392 +210,392 @@ Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_s Condition : isnotnull(sr_store_sk#20) (23) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#25] +Output [1]: [d_date_sk#24] (24) BroadcastHashJoin [codegen id : 6] Left keys [1]: [sr_returned_date_sk#23] -Right keys [1]: [cast(d_date_sk#25 as bigint)] +Right keys [1]: [d_date_sk#24] Join condition: None (25) Project [codegen id : 6] Output [3]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] -Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#25] +Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#24] (26) ReusedExchange [Reuses operator id: 14] -Output [1]: [s_store_sk#26] +Output [1]: [s_store_sk#25] (27) BroadcastHashJoin [codegen id : 6] Left keys [1]: [sr_store_sk#20] -Right keys [1]: [cast(s_store_sk#26 as bigint)] +Right keys [1]: [s_store_sk#25] Join condition: None (28) Project [codegen id : 6] -Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#26] -Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#26] +Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#25] (29) HashAggregate [codegen id : 6] -Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#26] -Keys [1]: [s_store_sk#26] +Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Keys [1]: [s_store_sk#25] Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] -Aggregate Attributes [2]: [sum#27, sum#28] -Results [3]: [s_store_sk#26, sum#29, sum#30] +Aggregate Attributes [2]: [sum#26, sum#27] +Results [3]: [s_store_sk#25, sum#28, sum#29] (30) Exchange -Input [3]: [s_store_sk#26, sum#29, sum#30] -Arguments: hashpartitioning(s_store_sk#26, 5), ENSURE_REQUIREMENTS, [id=#31] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] (31) HashAggregate [codegen id : 7] -Input [3]: [s_store_sk#26, sum#29, sum#30] -Keys [1]: [s_store_sk#26] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Keys [1]: [s_store_sk#25] Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] -Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#32, sum(UnscaledValue(sr_net_loss#22))#33] -Results [3]: [s_store_sk#26, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#32,17,2) AS returns#34, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#33,17,2) AS profit_loss#35] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#31, sum(UnscaledValue(sr_net_loss#22))#32] +Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#31,17,2) AS returns#33, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#32,17,2) AS profit_loss#34] (32) BroadcastExchange -Input [3]: [s_store_sk#26, returns#34, profit_loss#35] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#36] +Input [3]: [s_store_sk#25, returns#33, profit_loss#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] (33) BroadcastHashJoin [codegen id : 8] Left keys [1]: [s_store_sk#9] -Right keys [1]: [s_store_sk#26] +Right keys [1]: [s_store_sk#25] Join condition: None (34) Project [codegen id : 8] -Output [5]: [store channel AS channel#37, s_store_sk#9 AS id#38, sales#18, coalesce(returns#34, 0.00) AS returns#39, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#35, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#40] -Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#26, returns#34, profit_loss#35] +Output [5]: [store channel AS channel#36, s_store_sk#9 AS id#37, sales#18, coalesce(returns#33, 0.00) AS returns#38, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#34, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#39] +Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#33, profit_loss#34] (35) Scan parquet default.catalog_sales -Output [4]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44] +Output [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#44), dynamicpruningexpression(cs_sold_date_sk#44 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(cs_sold_date_sk#43), dynamicpruningexpression(cs_sold_date_sk#43 IN dynamicpruning#5)] ReadSchema: struct (36) ColumnarToRow [codegen id : 10] -Input [4]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44] +Input [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] (37) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#45] +Output [1]: [d_date_sk#44] (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#44] -Right keys [1]: [d_date_sk#45] +Left keys [1]: [cs_sold_date_sk#43] +Right keys [1]: [d_date_sk#44] Join condition: None (39) Project [codegen id : 10] -Output [3]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43] -Input [5]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43, cs_sold_date_sk#44, d_date_sk#45] +Output [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Input [5]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43, d_date_sk#44] (40) HashAggregate [codegen id : 10] -Input [3]: [cs_call_center_sk#41, cs_ext_sales_price#42, cs_net_profit#43] -Keys [1]: [cs_call_center_sk#41] -Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#42)), partial_sum(UnscaledValue(cs_net_profit#43))] -Aggregate Attributes [2]: [sum#46, sum#47] -Results [3]: [cs_call_center_sk#41, sum#48, sum#49] +Input [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#41)), partial_sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum#45, sum#46] +Results [3]: [cs_call_center_sk#40, sum#47, sum#48] (41) Exchange -Input [3]: [cs_call_center_sk#41, sum#48, sum#49] -Arguments: hashpartitioning(cs_call_center_sk#41, 5), ENSURE_REQUIREMENTS, [id=#50] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Arguments: hashpartitioning(cs_call_center_sk#40, 5), ENSURE_REQUIREMENTS, [id=#49] (42) HashAggregate [codegen id : 11] -Input [3]: [cs_call_center_sk#41, sum#48, sum#49] -Keys [1]: [cs_call_center_sk#41] -Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#42)), sum(UnscaledValue(cs_net_profit#43))] -Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#42))#51, sum(UnscaledValue(cs_net_profit#43))#52] -Results [3]: [cs_call_center_sk#41, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#42))#51,17,2) AS sales#53, MakeDecimal(sum(UnscaledValue(cs_net_profit#43))#52,17,2) AS profit#54] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#41)), sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#41))#50, sum(UnscaledValue(cs_net_profit#42))#51] +Results [3]: [cs_call_center_sk#40, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#41))#50,17,2) AS sales#52, MakeDecimal(sum(UnscaledValue(cs_net_profit#42))#51,17,2) AS profit#53] (43) BroadcastExchange -Input [3]: [cs_call_center_sk#41, sales#53, profit#54] -Arguments: IdentityBroadcastMode, [id=#55] +Input [3]: [cs_call_center_sk#40, sales#52, profit#53] +Arguments: IdentityBroadcastMode, [id=#54] (44) Scan parquet default.catalog_returns -Output [3]: [cr_return_amount#56, cr_net_loss#57, cr_returned_date_sk#58] +Output [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cr_returned_date_sk#58), dynamicpruningexpression(cr_returned_date_sk#58 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(cr_returned_date_sk#57), dynamicpruningexpression(cr_returned_date_sk#57 IN dynamicpruning#5)] ReadSchema: struct (45) ColumnarToRow [codegen id : 13] -Input [3]: [cr_return_amount#56, cr_net_loss#57, cr_returned_date_sk#58] +Input [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] (46) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#59] +Output [1]: [d_date_sk#58] (47) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [cr_returned_date_sk#58] -Right keys [1]: [d_date_sk#59] +Left keys [1]: [cr_returned_date_sk#57] +Right keys [1]: [d_date_sk#58] Join condition: None (48) Project [codegen id : 13] -Output [2]: [cr_return_amount#56, cr_net_loss#57] -Input [4]: [cr_return_amount#56, cr_net_loss#57, cr_returned_date_sk#58, d_date_sk#59] +Output [2]: [cr_return_amount#55, cr_net_loss#56] +Input [4]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57, d_date_sk#58] (49) HashAggregate [codegen id : 13] -Input [2]: [cr_return_amount#56, cr_net_loss#57] +Input [2]: [cr_return_amount#55, cr_net_loss#56] Keys: [] -Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#56)), partial_sum(UnscaledValue(cr_net_loss#57))] -Aggregate Attributes [2]: [sum#60, sum#61] -Results [2]: [sum#62, sum#63] +Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#55)), partial_sum(UnscaledValue(cr_net_loss#56))] +Aggregate Attributes [2]: [sum#59, sum#60] +Results [2]: [sum#61, sum#62] (50) Exchange -Input [2]: [sum#62, sum#63] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#64] +Input [2]: [sum#61, sum#62] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#63] (51) HashAggregate -Input [2]: [sum#62, sum#63] +Input [2]: [sum#61, sum#62] Keys: [] -Functions [2]: [sum(UnscaledValue(cr_return_amount#56)), sum(UnscaledValue(cr_net_loss#57))] -Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#56))#65, sum(UnscaledValue(cr_net_loss#57))#66] -Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#56))#65,17,2) AS returns#67, MakeDecimal(sum(UnscaledValue(cr_net_loss#57))#66,17,2) AS profit_loss#68] +Functions [2]: [sum(UnscaledValue(cr_return_amount#55)), sum(UnscaledValue(cr_net_loss#56))] +Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#55))#64, sum(UnscaledValue(cr_net_loss#56))#65] +Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#55))#64,17,2) AS returns#66, MakeDecimal(sum(UnscaledValue(cr_net_loss#56))#65,17,2) AS profit_loss#67] (52) BroadcastNestedLoopJoin [codegen id : 14] Join condition: None (53) Project [codegen id : 14] -Output [5]: [catalog channel AS channel#69, cs_call_center_sk#41 AS id#70, sales#53, returns#67, CheckOverflow((promote_precision(cast(profit#54 as decimal(18,2))) - promote_precision(cast(profit_loss#68 as decimal(18,2)))), DecimalType(18,2), true) AS profit#71] -Input [5]: [cs_call_center_sk#41, sales#53, profit#54, returns#67, profit_loss#68] +Output [5]: [catalog channel AS channel#68, cs_call_center_sk#40 AS id#69, sales#52, returns#66, CheckOverflow((promote_precision(cast(profit#53 as decimal(18,2))) - promote_precision(cast(profit_loss#67 as decimal(18,2)))), DecimalType(18,2), true) AS profit#70] +Input [5]: [cs_call_center_sk#40, sales#52, profit#53, returns#66, profit_loss#67] (54) Scan parquet default.web_sales -Output [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] +Output [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#75), dynamicpruningexpression(ws_sold_date_sk#75 IN dynamicpruning#5)] +PartitionFilters: [isnotnull(ws_sold_date_sk#74), dynamicpruningexpression(ws_sold_date_sk#74 IN dynamicpruning#5)] PushedFilters: [IsNotNull(ws_web_page_sk)] ReadSchema: struct (55) ColumnarToRow [codegen id : 17] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] (56) Filter [codegen id : 17] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75] -Condition : isnotnull(ws_web_page_sk#72) +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Condition : isnotnull(ws_web_page_sk#71) (57) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#76] +Output [1]: [d_date_sk#75] (58) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_sold_date_sk#75] -Right keys [1]: [d_date_sk#76] +Left keys [1]: [ws_sold_date_sk#74] +Right keys [1]: [d_date_sk#75] Join condition: None (59) Project [codegen id : 17] -Output [3]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74] -Input [5]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, ws_sold_date_sk#75, d_date_sk#76] +Output [3]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73] +Input [5]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74, d_date_sk#75] (60) Scan parquet default.web_page -Output [1]: [wp_web_page_sk#77] +Output [1]: [wp_web_page_sk#76] Batched: true Location [not included in comparison]/{warehouse_dir}/web_page] PushedFilters: [IsNotNull(wp_web_page_sk)] ReadSchema: struct (61) ColumnarToRow [codegen id : 16] -Input [1]: [wp_web_page_sk#77] +Input [1]: [wp_web_page_sk#76] (62) Filter [codegen id : 16] -Input [1]: [wp_web_page_sk#77] -Condition : isnotnull(wp_web_page_sk#77) +Input [1]: [wp_web_page_sk#76] +Condition : isnotnull(wp_web_page_sk#76) (63) BroadcastExchange -Input [1]: [wp_web_page_sk#77] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#78] +Input [1]: [wp_web_page_sk#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] (64) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_web_page_sk#72] -Right keys [1]: [wp_web_page_sk#77] +Left keys [1]: [ws_web_page_sk#71] +Right keys [1]: [wp_web_page_sk#76] Join condition: None (65) Project [codegen id : 17] -Output [3]: [ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] -Input [4]: [ws_web_page_sk#72, ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] +Output [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] (66) HashAggregate [codegen id : 17] -Input [3]: [ws_ext_sales_price#73, ws_net_profit#74, wp_web_page_sk#77] -Keys [1]: [wp_web_page_sk#77] -Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#73)), partial_sum(UnscaledValue(ws_net_profit#74))] -Aggregate Attributes [2]: [sum#79, sum#80] -Results [3]: [wp_web_page_sk#77, sum#81, sum#82] +Input [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#72)), partial_sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum#78, sum#79] +Results [3]: [wp_web_page_sk#76, sum#80, sum#81] (67) Exchange -Input [3]: [wp_web_page_sk#77, sum#81, sum#82] -Arguments: hashpartitioning(wp_web_page_sk#77, 5), ENSURE_REQUIREMENTS, [id=#83] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Arguments: hashpartitioning(wp_web_page_sk#76, 5), ENSURE_REQUIREMENTS, [id=#82] (68) HashAggregate [codegen id : 22] -Input [3]: [wp_web_page_sk#77, sum#81, sum#82] -Keys [1]: [wp_web_page_sk#77] -Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#73)), sum(UnscaledValue(ws_net_profit#74))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#73))#84, sum(UnscaledValue(ws_net_profit#74))#85] -Results [3]: [wp_web_page_sk#77, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#73))#84,17,2) AS sales#86, MakeDecimal(sum(UnscaledValue(ws_net_profit#74))#85,17,2) AS profit#87] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#72)), sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#72))#83, sum(UnscaledValue(ws_net_profit#73))#84] +Results [3]: [wp_web_page_sk#76, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#72))#83,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(ws_net_profit#73))#84,17,2) AS profit#86] (69) Scan parquet default.web_returns -Output [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] +Output [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(wr_returned_date_sk#91), dynamicpruningexpression(wr_returned_date_sk#91 IN dynamicpruning#24)] +PartitionFilters: [isnotnull(wr_returned_date_sk#90), dynamicpruningexpression(wr_returned_date_sk#90 IN dynamicpruning#5)] PushedFilters: [IsNotNull(wr_web_page_sk)] -ReadSchema: struct +ReadSchema: struct (70) ColumnarToRow [codegen id : 20] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] (71) Filter [codegen id : 20] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91] -Condition : isnotnull(wr_web_page_sk#88) +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Condition : isnotnull(wr_web_page_sk#87) (72) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#92] +Output [1]: [d_date_sk#91] (73) BroadcastHashJoin [codegen id : 20] -Left keys [1]: [wr_returned_date_sk#91] -Right keys [1]: [cast(d_date_sk#92 as bigint)] +Left keys [1]: [wr_returned_date_sk#90] +Right keys [1]: [d_date_sk#91] Join condition: None (74) Project [codegen id : 20] -Output [3]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90] -Input [5]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wr_returned_date_sk#91, d_date_sk#92] +Output [3]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89] +Input [5]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90, d_date_sk#91] (75) ReusedExchange [Reuses operator id: 63] -Output [1]: [wp_web_page_sk#93] +Output [1]: [wp_web_page_sk#92] (76) BroadcastHashJoin [codegen id : 20] -Left keys [1]: [wr_web_page_sk#88] -Right keys [1]: [cast(wp_web_page_sk#93 as bigint)] +Left keys [1]: [wr_web_page_sk#87] +Right keys [1]: [wp_web_page_sk#92] Join condition: None (77) Project [codegen id : 20] -Output [3]: [wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#93] -Input [4]: [wr_web_page_sk#88, wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#93] +Output [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] (78) HashAggregate [codegen id : 20] -Input [3]: [wr_return_amt#89, wr_net_loss#90, wp_web_page_sk#93] -Keys [1]: [wp_web_page_sk#93] -Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#89)), partial_sum(UnscaledValue(wr_net_loss#90))] -Aggregate Attributes [2]: [sum#94, sum#95] -Results [3]: [wp_web_page_sk#93, sum#96, sum#97] +Input [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#88)), partial_sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum#93, sum#94] +Results [3]: [wp_web_page_sk#92, sum#95, sum#96] (79) Exchange -Input [3]: [wp_web_page_sk#93, sum#96, sum#97] -Arguments: hashpartitioning(wp_web_page_sk#93, 5), ENSURE_REQUIREMENTS, [id=#98] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#97] (80) HashAggregate [codegen id : 21] -Input [3]: [wp_web_page_sk#93, sum#96, sum#97] -Keys [1]: [wp_web_page_sk#93] -Functions [2]: [sum(UnscaledValue(wr_return_amt#89)), sum(UnscaledValue(wr_net_loss#90))] -Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#89))#99, sum(UnscaledValue(wr_net_loss#90))#100] -Results [3]: [wp_web_page_sk#93, MakeDecimal(sum(UnscaledValue(wr_return_amt#89))#99,17,2) AS returns#101, MakeDecimal(sum(UnscaledValue(wr_net_loss#90))#100,17,2) AS profit_loss#102] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [sum(UnscaledValue(wr_return_amt#88)), sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#88))#98, sum(UnscaledValue(wr_net_loss#89))#99] +Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#88))#98,17,2) AS returns#100, MakeDecimal(sum(UnscaledValue(wr_net_loss#89))#99,17,2) AS profit_loss#101] (81) BroadcastExchange -Input [3]: [wp_web_page_sk#93, returns#101, profit_loss#102] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#103] +Input [3]: [wp_web_page_sk#92, returns#100, profit_loss#101] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] (82) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [wp_web_page_sk#77] -Right keys [1]: [wp_web_page_sk#93] +Left keys [1]: [wp_web_page_sk#76] +Right keys [1]: [wp_web_page_sk#92] Join condition: None (83) Project [codegen id : 22] -Output [5]: [web channel AS channel#104, wp_web_page_sk#77 AS id#105, sales#86, coalesce(returns#101, 0.00) AS returns#106, CheckOverflow((promote_precision(cast(profit#87 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#102, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#107] -Input [6]: [wp_web_page_sk#77, sales#86, profit#87, wp_web_page_sk#93, returns#101, profit_loss#102] +Output [5]: [web channel AS channel#103, wp_web_page_sk#76 AS id#104, sales#85, coalesce(returns#100, 0.00) AS returns#105, CheckOverflow((promote_precision(cast(profit#86 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#101, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#106] +Input [6]: [wp_web_page_sk#76, sales#85, profit#86, wp_web_page_sk#92, returns#100, profit_loss#101] (84) Union (85) HashAggregate [codegen id : 23] -Input [5]: [channel#37, id#38, sales#18, returns#39, profit#40] -Keys [2]: [channel#37, id#38] -Functions [3]: [partial_sum(sales#18), partial_sum(returns#39), partial_sum(profit#40)] -Aggregate Attributes [6]: [sum#108, isEmpty#109, sum#110, isEmpty#111, sum#112, isEmpty#113] -Results [8]: [channel#37, id#38, sum#114, isEmpty#115, sum#116, isEmpty#117, sum#118, isEmpty#119] +Input [5]: [channel#36, id#37, sales#18, returns#38, profit#39] +Keys [2]: [channel#36, id#37] +Functions [3]: [partial_sum(sales#18), partial_sum(returns#38), partial_sum(profit#39)] +Aggregate Attributes [6]: [sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Results [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] (86) Exchange -Input [8]: [channel#37, id#38, sum#114, isEmpty#115, sum#116, isEmpty#117, sum#118, isEmpty#119] -Arguments: hashpartitioning(channel#37, id#38, 5), ENSURE_REQUIREMENTS, [id=#120] +Input [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] +Arguments: hashpartitioning(channel#36, id#37, 5), ENSURE_REQUIREMENTS, [id=#119] (87) HashAggregate [codegen id : 24] -Input [8]: [channel#37, id#38, sum#114, isEmpty#115, sum#116, isEmpty#117, sum#118, isEmpty#119] -Keys [2]: [channel#37, id#38] -Functions [3]: [sum(sales#18), sum(returns#39), sum(profit#40)] -Aggregate Attributes [3]: [sum(sales#18)#121, sum(returns#39)#122, sum(profit#40)#123] -Results [5]: [channel#37, id#38, cast(sum(sales#18)#121 as decimal(37,2)) AS sales#124, cast(sum(returns#39)#122 as decimal(37,2)) AS returns#125, cast(sum(profit#40)#123 as decimal(38,2)) AS profit#126] +Input [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#39)] +Aggregate Attributes [3]: [sum(sales#18)#120, sum(returns#38)#121, sum(profit#39)#122] +Results [5]: [channel#36, id#37, cast(sum(sales#18)#120 as decimal(37,2)) AS sales#123, cast(sum(returns#38)#121 as decimal(37,2)) AS returns#124, cast(sum(profit#39)#122 as decimal(38,2)) AS profit#125] (88) ReusedExchange [Reuses operator id: unknown] -Output [8]: [channel#37, id#38, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] +Output [8]: [channel#36, id#37, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] (89) HashAggregate [codegen id : 48] -Input [8]: [channel#37, id#38, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] -Keys [2]: [channel#37, id#38] -Functions [3]: [sum(sales#18), sum(returns#39), sum(profit#133)] -Aggregate Attributes [3]: [sum(sales#18)#134, sum(returns#39)#135, sum(profit#133)#136] -Results [4]: [channel#37, sum(sales#18)#134 AS sales#137, sum(returns#39)#135 AS returns#138, sum(profit#133)#136 AS profit#139] +Input [8]: [channel#36, id#37, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#132)] +Aggregate Attributes [3]: [sum(sales#18)#133, sum(returns#38)#134, sum(profit#132)#135] +Results [4]: [channel#36, sum(sales#18)#133 AS sales#136, sum(returns#38)#134 AS returns#137, sum(profit#132)#135 AS profit#138] (90) HashAggregate [codegen id : 48] -Input [4]: [channel#37, sales#137, returns#138, profit#139] -Keys [1]: [channel#37] -Functions [3]: [partial_sum(sales#137), partial_sum(returns#138), partial_sum(profit#139)] -Aggregate Attributes [6]: [sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] -Results [7]: [channel#37, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] +Input [4]: [channel#36, sales#136, returns#137, profit#138] +Keys [1]: [channel#36] +Functions [3]: [partial_sum(sales#136), partial_sum(returns#137), partial_sum(profit#138)] +Aggregate Attributes [6]: [sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Results [7]: [channel#36, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] (91) Exchange -Input [7]: [channel#37, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] -Arguments: hashpartitioning(channel#37, 5), ENSURE_REQUIREMENTS, [id=#152] +Input [7]: [channel#36, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] +Arguments: hashpartitioning(channel#36, 5), ENSURE_REQUIREMENTS, [id=#151] (92) HashAggregate [codegen id : 49] -Input [7]: [channel#37, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] -Keys [1]: [channel#37] -Functions [3]: [sum(sales#137), sum(returns#138), sum(profit#139)] -Aggregate Attributes [3]: [sum(sales#137)#153, sum(returns#138)#154, sum(profit#139)#155] -Results [5]: [channel#37, null AS id#156, sum(sales#137)#153 AS sales#157, sum(returns#138)#154 AS returns#158, sum(profit#139)#155 AS profit#159] +Input [7]: [channel#36, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] +Keys [1]: [channel#36] +Functions [3]: [sum(sales#136), sum(returns#137), sum(profit#138)] +Aggregate Attributes [3]: [sum(sales#136)#152, sum(returns#137)#153, sum(profit#138)#154] +Results [5]: [channel#36, null AS id#155, sum(sales#136)#152 AS sales#156, sum(returns#137)#153 AS returns#157, sum(profit#138)#154 AS profit#158] (93) ReusedExchange [Reuses operator id: unknown] -Output [8]: [channel#37, id#38, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] +Output [8]: [channel#36, id#37, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] (94) HashAggregate [codegen id : 73] -Input [8]: [channel#37, id#38, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] -Keys [2]: [channel#37, id#38] -Functions [3]: [sum(sales#18), sum(returns#39), sum(profit#166)] -Aggregate Attributes [3]: [sum(sales#18)#167, sum(returns#39)#168, sum(profit#166)#169] -Results [3]: [sum(sales#18)#167 AS sales#137, sum(returns#39)#168 AS returns#138, sum(profit#166)#169 AS profit#139] +Input [8]: [channel#36, id#37, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#165)] +Aggregate Attributes [3]: [sum(sales#18)#166, sum(returns#38)#167, sum(profit#165)#168] +Results [3]: [sum(sales#18)#166 AS sales#136, sum(returns#38)#167 AS returns#137, sum(profit#165)#168 AS profit#138] (95) HashAggregate [codegen id : 73] -Input [3]: [sales#137, returns#138, profit#139] +Input [3]: [sales#136, returns#137, profit#138] Keys: [] -Functions [3]: [partial_sum(sales#137), partial_sum(returns#138), partial_sum(profit#139)] -Aggregate Attributes [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] -Results [6]: [sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Functions [3]: [partial_sum(sales#136), partial_sum(returns#137), partial_sum(profit#138)] +Aggregate Attributes [6]: [sum#169, isEmpty#170, sum#171, isEmpty#172, sum#173, isEmpty#174] +Results [6]: [sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] (96) Exchange -Input [6]: [sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] -Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#182] +Input [6]: [sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#181] (97) HashAggregate [codegen id : 74] -Input [6]: [sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Input [6]: [sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] Keys: [] -Functions [3]: [sum(sales#137), sum(returns#138), sum(profit#139)] -Aggregate Attributes [3]: [sum(sales#137)#183, sum(returns#138)#184, sum(profit#139)#185] -Results [5]: [null AS channel#186, null AS id#187, sum(sales#137)#183 AS sales#188, sum(returns#138)#184 AS returns#189, sum(profit#139)#185 AS profit#190] +Functions [3]: [sum(sales#136), sum(returns#137), sum(profit#138)] +Aggregate Attributes [3]: [sum(sales#136)#182, sum(returns#137)#183, sum(profit#138)#184] +Results [5]: [null AS channel#185, null AS id#186, sum(sales#136)#182 AS sales#187, sum(returns#137)#183 AS returns#188, sum(profit#138)#184 AS profit#189] (98) Union (99) HashAggregate [codegen id : 75] -Input [5]: [channel#37, id#38, sales#124, returns#125, profit#126] -Keys [5]: [channel#37, id#38, sales#124, returns#125, profit#126] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Keys [5]: [channel#36, id#37, sales#123, returns#124, profit#125] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#37, id#38, sales#124, returns#125, profit#126] +Results [5]: [channel#36, id#37, sales#123, returns#124, profit#125] (100) Exchange -Input [5]: [channel#37, id#38, sales#124, returns#125, profit#126] -Arguments: hashpartitioning(channel#37, id#38, sales#124, returns#125, profit#126, 5), ENSURE_REQUIREMENTS, [id=#191] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Arguments: hashpartitioning(channel#36, id#37, sales#123, returns#124, profit#125, 5), ENSURE_REQUIREMENTS, [id=#190] (101) HashAggregate [codegen id : 76] -Input [5]: [channel#37, id#38, sales#124, returns#125, profit#126] -Keys [5]: [channel#37, id#38, sales#124, returns#125, profit#126] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Keys [5]: [channel#36, id#37, sales#123, returns#124, profit#125] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#37, id#38, sales#124, returns#125, profit#126] +Results [5]: [channel#36, id#37, sales#123, returns#124, profit#125] (102) TakeOrderedAndProject -Input [5]: [channel#37, id#38, sales#124, returns#125, profit#126] -Arguments: 100, [channel#37 ASC NULLS FIRST, id#38 ASC NULLS FIRST], [channel#37, id#38, sales#124, returns#125, profit#126] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Arguments: 100, [channel#36 ASC NULLS FIRST, id#37 ASC NULLS FIRST], [channel#36, id#37, sales#123, returns#124, profit#125] ===== Subqueries ===== @@ -606,19 +606,14 @@ ReusedExchange (103) (103) ReusedExchange [Reuses operator id: 8] Output [1]: [d_date_sk#6] -Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#24 -ReusedExchange (104) +Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#5 +Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#43 IN dynamicpruning#5 -(104) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#25] +Subquery:4 Hosting operator id = 44 Hosting Expression = cr_returned_date_sk#57 IN dynamicpruning#5 -Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#44 IN dynamicpruning#5 +Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#74 IN dynamicpruning#5 -Subquery:4 Hosting operator id = 44 Hosting Expression = cr_returned_date_sk#58 IN dynamicpruning#5 - -Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#75 IN dynamicpruning#5 - -Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#91 IN dynamicpruning#24 +Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#90 IN dynamicpruning#5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt index 56ea3c1686217..6248fbf0129bc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt @@ -64,8 +64,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] - SubqueryBroadcast [d_date_sk] #2 - ReusedExchange [d_date_sk] #4 + ReusedSubquery [d_date_sk] #1 InputAdapter ReusedExchange [d_date_sk] #4 InputAdapter @@ -144,7 +143,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_web_page_sk,wr_return_amt,wr_net_loss,wr_returned_date_sk] - ReusedSubquery [d_date_sk] #2 + ReusedSubquery [d_date_sk] #1 InputAdapter ReusedExchange [d_date_sk] #4 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt index a12ab50a89f43..68cf417e81905 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt @@ -42,13 +42,13 @@ TakeOrderedAndProject (73) : : : +- Exchange (28) : : : +- * Filter (27) : : : +- * ColumnarToRow (26) - : : : +- Scan parquet default.catalog_sales (25) + : : : +- Scan parquet default.web_sales (25) : : +- * Sort (35) : : +- Exchange (34) : : +- * Project (33) : : +- * Filter (32) : : +- * ColumnarToRow (31) - : : +- Scan parquet default.catalog_returns (30) + : : +- Scan parquet default.web_returns (30) : +- ReusedExchange (39) +- * Sort (70) +- * Filter (69) @@ -64,13 +64,13 @@ TakeOrderedAndProject (73) : : +- Exchange (52) : : +- * Filter (51) : : +- * ColumnarToRow (50) - : : +- Scan parquet default.web_sales (49) + : : +- Scan parquet default.catalog_sales (49) : +- * Sort (59) : +- Exchange (58) : +- * Project (57) : +- * Filter (56) : +- * ColumnarToRow (55) - : +- Scan parquet default.web_returns (54) + : +- Scan parquet default.catalog_returns (54) +- ReusedExchange (63) @@ -91,18 +91,18 @@ Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) (4) Exchange Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] -Arguments: hashpartitioning(cast(ss_ticket_number#3 as bigint), cast(ss_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#9] +Arguments: hashpartitioning(ss_ticket_number#3, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] (5) Sort [codegen id : 2] Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] -Arguments: [cast(ss_ticket_number#3 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#3 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] @@ -124,7 +124,7 @@ Input [2]: [sr_item_sk#10, sr_ticket_number#11] Arguments: [sr_ticket_number#11 ASC NULLS FIRST, sr_item_sk#10 ASC NULLS FIRST], false, 0 (12) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#3 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [ss_ticket_number#3, ss_item_sk#1] Right keys [2]: [sr_ticket_number#11, sr_item_sk#10] Join condition: None @@ -185,223 +185,223 @@ Results [6]: [d_year#15 AS ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, sum( Input [6]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] Arguments: [ss_sold_year#27 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.catalog_sales -Output [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] +(25) Scan parquet default.web_sales +Output [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(cs_sold_date_sk#37), dynamicpruningexpression(cs_sold_date_sk#37 IN dynamicpruning#8)] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] -ReadSchema: struct +PartitionFilters: [isnotnull(ws_sold_date_sk#37), dynamicpruningexpression(ws_sold_date_sk#37 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct (26) ColumnarToRow [codegen id : 8] -Input [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] (27) Filter [codegen id : 8] -Input [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] -Condition : (isnotnull(cs_item_sk#32) AND isnotnull(cs_bill_customer_sk#31)) +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Condition : (isnotnull(ws_item_sk#31) AND isnotnull(ws_bill_customer_sk#32)) (28) Exchange -Input [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] -Arguments: hashpartitioning(cs_order_number#33, cs_item_sk#32, 5), ENSURE_REQUIREMENTS, [id=#38] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: hashpartitioning(ws_order_number#33, ws_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#38] (29) Sort [codegen id : 9] -Input [7]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] -Arguments: [cs_order_number#33 ASC NULLS FIRST, cs_item_sk#32 ASC NULLS FIRST], false, 0 +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: [ws_order_number#33 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST], false, 0 -(30) Scan parquet default.catalog_returns -Output [3]: [cr_item_sk#39, cr_order_number#40, cr_returned_date_sk#41] +(30) Scan parquet default.web_returns +Output [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct (31) ColumnarToRow [codegen id : 10] -Input [3]: [cr_item_sk#39, cr_order_number#40, cr_returned_date_sk#41] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] (32) Filter [codegen id : 10] -Input [3]: [cr_item_sk#39, cr_order_number#40, cr_returned_date_sk#41] -Condition : (isnotnull(cr_order_number#40) AND isnotnull(cr_item_sk#39)) +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Condition : (isnotnull(wr_order_number#40) AND isnotnull(wr_item_sk#39)) (33) Project [codegen id : 10] -Output [2]: [cr_item_sk#39, cr_order_number#40] -Input [3]: [cr_item_sk#39, cr_order_number#40, cr_returned_date_sk#41] +Output [2]: [wr_item_sk#39, wr_order_number#40] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] (34) Exchange -Input [2]: [cr_item_sk#39, cr_order_number#40] -Arguments: hashpartitioning(cr_order_number#40, cr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#42] +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: hashpartitioning(wr_order_number#40, wr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#42] (35) Sort [codegen id : 11] -Input [2]: [cr_item_sk#39, cr_order_number#40] -Arguments: [cr_order_number#40 ASC NULLS FIRST, cr_item_sk#39 ASC NULLS FIRST], false, 0 +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: [wr_order_number#40 ASC NULLS FIRST, wr_item_sk#39 ASC NULLS FIRST], false, 0 (36) SortMergeJoin -Left keys [2]: [cs_order_number#33, cs_item_sk#32] -Right keys [2]: [cr_order_number#40, cr_item_sk#39] +Left keys [2]: [ws_order_number#33, ws_item_sk#31] +Right keys [2]: [wr_order_number#40, wr_item_sk#39] Join condition: None (37) Filter [codegen id : 13] -Input [9]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37, cr_item_sk#39, cr_order_number#40] -Condition : isnull(cr_order_number#40) +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] +Condition : isnull(wr_order_number#40) (38) Project [codegen id : 13] -Output [6]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37] -Input [9]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_order_number#33, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37, cr_item_sk#39, cr_order_number#40] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] (39) ReusedExchange [Reuses operator id: 18] Output [2]: [d_date_sk#43, d_year#44] (40) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [cs_sold_date_sk#37] +Left keys [1]: [ws_sold_date_sk#37] Right keys [1]: [d_date_sk#43] Join condition: None (41) Project [codegen id : 13] -Output [6]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, d_year#44] -Input [8]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, cs_sold_date_sk#37, d_date_sk#43, d_year#44] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Input [8]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, d_date_sk#43, d_year#44] (42) HashAggregate [codegen id : 13] -Input [6]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#34, cs_wholesale_cost#35, cs_sales_price#36, d_year#44] -Keys [3]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31] -Functions [3]: [partial_sum(cs_quantity#34), partial_sum(UnscaledValue(cs_wholesale_cost#35)), partial_sum(UnscaledValue(cs_sales_price#36))] +Input [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [partial_sum(ws_quantity#34), partial_sum(UnscaledValue(ws_wholesale_cost#35)), partial_sum(UnscaledValue(ws_sales_price#36))] Aggregate Attributes [3]: [sum#45, sum#46, sum#47] -Results [6]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31, sum#48, sum#49, sum#50] +Results [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] (43) Exchange -Input [6]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31, sum#48, sum#49, sum#50] -Arguments: hashpartitioning(d_year#44, cs_item_sk#32, cs_bill_customer_sk#31, 5), ENSURE_REQUIREMENTS, [id=#51] +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Arguments: hashpartitioning(d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, 5), ENSURE_REQUIREMENTS, [id=#51] (44) HashAggregate [codegen id : 14] -Input [6]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31, sum#48, sum#49, sum#50] -Keys [3]: [d_year#44, cs_item_sk#32, cs_bill_customer_sk#31] -Functions [3]: [sum(cs_quantity#34), sum(UnscaledValue(cs_wholesale_cost#35)), sum(UnscaledValue(cs_sales_price#36))] -Aggregate Attributes [3]: [sum(cs_quantity#34)#52, sum(UnscaledValue(cs_wholesale_cost#35))#53, sum(UnscaledValue(cs_sales_price#36))#54] -Results [6]: [d_year#44 AS cs_sold_year#55, cs_item_sk#32, cs_bill_customer_sk#31 AS cs_customer_sk#56, sum(cs_quantity#34)#52 AS cs_qty#57, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#35))#53,17,2) AS cs_wc#58, MakeDecimal(sum(UnscaledValue(cs_sales_price#36))#54,17,2) AS cs_sp#59] +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [sum(ws_quantity#34), sum(UnscaledValue(ws_wholesale_cost#35)), sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum(ws_quantity#34)#52, sum(UnscaledValue(ws_wholesale_cost#35))#53, sum(UnscaledValue(ws_sales_price#36))#54] +Results [6]: [d_year#44 AS ws_sold_year#55, ws_item_sk#31, ws_bill_customer_sk#32 AS ws_customer_sk#56, sum(ws_quantity#34)#52 AS ws_qty#57, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#35))#53,17,2) AS ws_wc#58, MakeDecimal(sum(UnscaledValue(ws_sales_price#36))#54,17,2) AS ws_sp#59] (45) Filter [codegen id : 14] -Input [6]: [cs_sold_year#55, cs_item_sk#32, cs_customer_sk#56, cs_qty#57, cs_wc#58, cs_sp#59] -Condition : (coalesce(cs_qty#57, 0) > 0) +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Condition : (coalesce(ws_qty#57, 0) > 0) (46) Sort [codegen id : 14] -Input [6]: [cs_sold_year#55, cs_item_sk#32, cs_customer_sk#56, cs_qty#57, cs_wc#58, cs_sp#59] -Arguments: [cs_sold_year#55 ASC NULLS FIRST, cs_item_sk#32 ASC NULLS FIRST, cs_customer_sk#56 ASC NULLS FIRST], false, 0 +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Arguments: [ws_sold_year#55 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST, ws_customer_sk#56 ASC NULLS FIRST], false, 0 (47) SortMergeJoin [codegen id : 15] Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] -Right keys [3]: [cs_sold_year#55, cs_item_sk#32, cs_customer_sk#56] +Right keys [3]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56] Join condition: None (48) Project [codegen id : 15] -Output [9]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, cs_qty#57, cs_wc#58, cs_sp#59] -Input [12]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, cs_sold_year#55, cs_item_sk#32, cs_customer_sk#56, cs_qty#57, cs_wc#58, cs_sp#59] +Output [9]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59] +Input [12]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] -(49) Scan parquet default.web_sales -Output [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] +(49) Scan parquet default.catalog_sales +Output [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] Batched: true Location: InMemoryFileIndex [] -PartitionFilters: [isnotnull(ws_sold_date_sk#66), dynamicpruningexpression(ws_sold_date_sk#66 IN dynamicpruning#8)] -PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] -ReadSchema: struct +PartitionFilters: [isnotnull(cs_sold_date_sk#66), dynamicpruningexpression(cs_sold_date_sk#66 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct (50) ColumnarToRow [codegen id : 16] -Input [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] (51) Filter [codegen id : 16] -Input [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] -Condition : (isnotnull(ws_item_sk#60) AND isnotnull(ws_bill_customer_sk#61)) +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Condition : (isnotnull(cs_item_sk#61) AND isnotnull(cs_bill_customer_sk#60)) (52) Exchange -Input [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] -Arguments: hashpartitioning(cast(ws_order_number#62 as bigint), cast(ws_item_sk#60 as bigint), 5), ENSURE_REQUIREMENTS, [id=#67] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: hashpartitioning(cs_order_number#62, cs_item_sk#61, 5), ENSURE_REQUIREMENTS, [id=#67] (53) Sort [codegen id : 17] -Input [7]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] -Arguments: [cast(ws_order_number#62 as bigint) ASC NULLS FIRST, cast(ws_item_sk#60 as bigint) ASC NULLS FIRST], false, 0 +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: [cs_order_number#62 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST], false, 0 -(54) Scan parquet default.web_returns -Output [3]: [wr_item_sk#68, wr_order_number#69, wr_returned_date_sk#70] +(54) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_returns] -PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct (55) ColumnarToRow [codegen id : 18] -Input [3]: [wr_item_sk#68, wr_order_number#69, wr_returned_date_sk#70] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] (56) Filter [codegen id : 18] -Input [3]: [wr_item_sk#68, wr_order_number#69, wr_returned_date_sk#70] -Condition : (isnotnull(wr_order_number#69) AND isnotnull(wr_item_sk#68)) +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Condition : (isnotnull(cr_order_number#69) AND isnotnull(cr_item_sk#68)) (57) Project [codegen id : 18] -Output [2]: [wr_item_sk#68, wr_order_number#69] -Input [3]: [wr_item_sk#68, wr_order_number#69, wr_returned_date_sk#70] +Output [2]: [cr_item_sk#68, cr_order_number#69] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] (58) Exchange -Input [2]: [wr_item_sk#68, wr_order_number#69] -Arguments: hashpartitioning(wr_order_number#69, wr_item_sk#68, 5), ENSURE_REQUIREMENTS, [id=#71] +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: hashpartitioning(cr_order_number#69, cr_item_sk#68, 5), ENSURE_REQUIREMENTS, [id=#71] (59) Sort [codegen id : 19] -Input [2]: [wr_item_sk#68, wr_order_number#69] -Arguments: [wr_order_number#69 ASC NULLS FIRST, wr_item_sk#68 ASC NULLS FIRST], false, 0 +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: [cr_order_number#69 ASC NULLS FIRST, cr_item_sk#68 ASC NULLS FIRST], false, 0 (60) SortMergeJoin -Left keys [2]: [cast(ws_order_number#62 as bigint), cast(ws_item_sk#60 as bigint)] -Right keys [2]: [wr_order_number#69, wr_item_sk#68] +Left keys [2]: [cs_order_number#62, cs_item_sk#61] +Right keys [2]: [cr_order_number#69, cr_item_sk#68] Join condition: None (61) Filter [codegen id : 21] -Input [9]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66, wr_item_sk#68, wr_order_number#69] -Condition : isnull(wr_order_number#69) +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] +Condition : isnull(cr_order_number#69) (62) Project [codegen id : 21] -Output [6]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66] -Input [9]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_order_number#62, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66, wr_item_sk#68, wr_order_number#69] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] (63) ReusedExchange [Reuses operator id: 18] Output [2]: [d_date_sk#72, d_year#73] (64) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [ws_sold_date_sk#66] +Left keys [1]: [cs_sold_date_sk#66] Right keys [1]: [d_date_sk#72] Join condition: None (65) Project [codegen id : 21] -Output [6]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, d_year#73] -Input [8]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, ws_sold_date_sk#66, d_date_sk#72, d_year#73] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Input [8]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, d_date_sk#72, d_year#73] (66) HashAggregate [codegen id : 21] -Input [6]: [ws_item_sk#60, ws_bill_customer_sk#61, ws_quantity#63, ws_wholesale_cost#64, ws_sales_price#65, d_year#73] -Keys [3]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61] -Functions [3]: [partial_sum(ws_quantity#63), partial_sum(UnscaledValue(ws_wholesale_cost#64)), partial_sum(UnscaledValue(ws_sales_price#65))] +Input [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [partial_sum(cs_quantity#63), partial_sum(UnscaledValue(cs_wholesale_cost#64)), partial_sum(UnscaledValue(cs_sales_price#65))] Aggregate Attributes [3]: [sum#74, sum#75, sum#76] -Results [6]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61, sum#77, sum#78, sum#79] +Results [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] (67) Exchange -Input [6]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61, sum#77, sum#78, sum#79] -Arguments: hashpartitioning(d_year#73, ws_item_sk#60, ws_bill_customer_sk#61, 5), ENSURE_REQUIREMENTS, [id=#80] +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Arguments: hashpartitioning(d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, 5), ENSURE_REQUIREMENTS, [id=#80] (68) HashAggregate [codegen id : 22] -Input [6]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61, sum#77, sum#78, sum#79] -Keys [3]: [d_year#73, ws_item_sk#60, ws_bill_customer_sk#61] -Functions [3]: [sum(ws_quantity#63), sum(UnscaledValue(ws_wholesale_cost#64)), sum(UnscaledValue(ws_sales_price#65))] -Aggregate Attributes [3]: [sum(ws_quantity#63)#81, sum(UnscaledValue(ws_wholesale_cost#64))#82, sum(UnscaledValue(ws_sales_price#65))#83] -Results [6]: [d_year#73 AS ws_sold_year#84, ws_item_sk#60, ws_bill_customer_sk#61 AS ws_customer_sk#85, sum(ws_quantity#63)#81 AS ws_qty#86, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#64))#82,17,2) AS ws_wc#87, MakeDecimal(sum(UnscaledValue(ws_sales_price#65))#83,17,2) AS ws_sp#88] +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [sum(cs_quantity#63), sum(UnscaledValue(cs_wholesale_cost#64)), sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum(cs_quantity#63)#81, sum(UnscaledValue(cs_wholesale_cost#64))#82, sum(UnscaledValue(cs_sales_price#65))#83] +Results [6]: [d_year#73 AS cs_sold_year#84, cs_item_sk#61, cs_bill_customer_sk#60 AS cs_customer_sk#85, sum(cs_quantity#63)#81 AS cs_qty#86, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#64))#82,17,2) AS cs_wc#87, MakeDecimal(sum(UnscaledValue(cs_sales_price#65))#83,17,2) AS cs_sp#88] (69) Filter [codegen id : 22] -Input [6]: [ws_sold_year#84, ws_item_sk#60, ws_customer_sk#85, ws_qty#86, ws_wc#87, ws_sp#88] -Condition : (coalesce(ws_qty#86, 0) > 0) +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Condition : (coalesce(cs_qty#86, 0) > 0) (70) Sort [codegen id : 22] -Input [6]: [ws_sold_year#84, ws_item_sk#60, ws_customer_sk#85, ws_qty#86, ws_wc#87, ws_sp#88] -Arguments: [ws_sold_year#84 ASC NULLS FIRST, ws_item_sk#60 ASC NULLS FIRST, ws_customer_sk#85 ASC NULLS FIRST], false, 0 +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Arguments: [cs_sold_year#84 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST, cs_customer_sk#85 ASC NULLS FIRST], false, 0 (71) SortMergeJoin [codegen id : 23] Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] -Right keys [3]: [ws_sold_year#84, ws_item_sk#60, ws_customer_sk#85] +Right keys [3]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85] Join condition: None (72) Project [codegen id : 23] -Output [13]: [round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#86 + cs_qty#57), 1) as double)), 2) AS ratio#89, ss_qty#28 AS store_qty#90, ss_wc#29 AS store_wholesale_cost#91, ss_sp#30 AS store_sales_price#92, (coalesce(ws_qty#86, 0) + coalesce(cs_qty#57, 0)) AS other_chan_qty#93, CheckOverflow((promote_precision(cast(coalesce(ws_wc#87, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#58, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#94, CheckOverflow((promote_precision(cast(coalesce(ws_sp#88, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#59, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#95, ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] -Input [15]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, cs_qty#57, cs_wc#58, cs_sp#59, ws_sold_year#84, ws_item_sk#60, ws_customer_sk#85, ws_qty#86, ws_wc#87, ws_sp#88] +Output [13]: [round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#57 + cs_qty#86), 1) as double)), 2) AS ratio#89, ss_qty#28 AS store_qty#90, ss_wc#29 AS store_wholesale_cost#91, ss_sp#30 AS store_sales_price#92, (coalesce(ws_qty#57, 0) + coalesce(cs_qty#86, 0)) AS other_chan_qty#93, CheckOverflow((promote_precision(cast(coalesce(ws_wc#58, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#87, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#94, CheckOverflow((promote_precision(cast(coalesce(ws_sp#59, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#88, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#95, ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] +Input [15]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59, cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] (73) TakeOrderedAndProject Input [13]: [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95, ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] @@ -416,8 +416,8 @@ ReusedExchange (74) (74) ReusedExchange [Reuses operator id: 18] Output [2]: [d_date_sk#14, d_year#15] -Subquery:2 Hosting operator id = 25 Hosting Expression = cs_sold_date_sk#37 IN dynamicpruning#8 +Subquery:2 Hosting operator id = 25 Hosting Expression = ws_sold_date_sk#37 IN dynamicpruning#8 -Subquery:3 Hosting operator id = 49 Hosting Expression = ws_sold_date_sk#66 IN dynamicpruning#8 +Subquery:3 Hosting operator id = 49 Hosting Expression = cs_sold_date_sk#66 IN dynamicpruning#8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt index 33ed701649d4b..17421ac128698 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt @@ -1,11 +1,11 @@ TakeOrderedAndProject [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholesale_cost,other_chan_sales_price,ratio,store_qty,store_wholesale_cost,store_sales_price] WholeStageCodegen (23) Project [ss_qty,ws_qty,cs_qty,ss_wc,ss_sp,ws_wc,cs_wc,ws_sp,cs_sp,ss_sold_year,ss_item_sk,ss_customer_sk] - SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] InputAdapter WholeStageCodegen (15) - Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,cs_qty,cs_wc,cs_sp] - SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] + Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,ws_qty,ws_wc,ws_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] InputAdapter WholeStageCodegen (7) Sort [ss_sold_year,ss_item_sk,ss_customer_sk] @@ -50,75 +50,75 @@ TakeOrderedAndProject [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter WholeStageCodegen (14) - Sort [cs_sold_year,cs_item_sk,cs_customer_sk] - Filter [cs_qty] - HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cs_quantity),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] + Sort [ws_sold_year,ws_item_sk,ws_customer_sk] + Filter [ws_qty] + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,sum,sum,sum] [sum(ws_quantity),sum(UnscaledValue(ws_wholesale_cost)),sum(UnscaledValue(ws_sales_price)),ws_sold_year,ws_customer_sk,ws_qty,ws_wc,ws_sp,sum,sum,sum] InputAdapter - Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #5 + Exchange [d_year,ws_item_sk,ws_bill_customer_sk] #5 WholeStageCodegen (13) - HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] - Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] - Filter [cr_order_number] + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + Filter [wr_order_number] InputAdapter - SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] WholeStageCodegen (9) - Sort [cs_order_number,cs_item_sk] + Sort [ws_order_number,ws_item_sk] InputAdapter - Exchange [cs_order_number,cs_item_sk] #6 + Exchange [ws_order_number,ws_item_sk] #6 WholeStageCodegen (8) - Filter [cs_item_sk,cs_bill_customer_sk] + Filter [ws_item_sk,ws_bill_customer_sk] ColumnarToRow InputAdapter - Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] ReusedSubquery [d_date_sk] #1 WholeStageCodegen (11) - Sort [cr_order_number,cr_item_sk] + Sort [wr_order_number,wr_item_sk] InputAdapter - Exchange [cr_order_number,cr_item_sk] #7 + Exchange [wr_order_number,wr_item_sk] #7 WholeStageCodegen (10) - Project [cr_item_sk,cr_order_number] - Filter [cr_order_number,cr_item_sk] + Project [wr_item_sk,wr_order_number] + Filter [wr_order_number,wr_item_sk] ColumnarToRow InputAdapter - Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_returned_date_sk] InputAdapter ReusedExchange [d_date_sk,d_year] #3 InputAdapter WholeStageCodegen (22) - Sort [ws_sold_year,ws_item_sk,ws_customer_sk] - Filter [ws_qty] - HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,sum,sum,sum] [sum(ws_quantity),sum(UnscaledValue(ws_wholesale_cost)),sum(UnscaledValue(ws_sales_price)),ws_sold_year,ws_customer_sk,ws_qty,ws_wc,ws_sp,sum,sum,sum] + Sort [cs_sold_year,cs_item_sk,cs_customer_sk] + Filter [cs_qty] + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cs_quantity),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] InputAdapter - Exchange [d_year,ws_item_sk,ws_bill_customer_sk] #8 + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #8 WholeStageCodegen (21) - HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price] [sum,sum,sum,sum,sum,sum] - Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,d_year] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] - Filter [wr_order_number] + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + Filter [cr_order_number] InputAdapter - SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] WholeStageCodegen (17) - Sort [ws_order_number,ws_item_sk] + Sort [cs_order_number,cs_item_sk] InputAdapter - Exchange [ws_order_number,ws_item_sk] #9 + Exchange [cs_order_number,cs_item_sk] #9 WholeStageCodegen (16) - Filter [ws_item_sk,ws_bill_customer_sk] + Filter [cs_item_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter - Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] ReusedSubquery [d_date_sk] #1 WholeStageCodegen (19) - Sort [wr_order_number,wr_item_sk] + Sort [cr_order_number,cr_item_sk] InputAdapter - Exchange [wr_order_number,wr_item_sk] #10 + Exchange [cr_order_number,cr_item_sk] #10 WholeStageCodegen (18) - Project [wr_item_sk,wr_order_number] - Filter [wr_order_number,wr_item_sk] + Project [cr_item_sk,cr_order_number] + Filter [cr_order_number,cr_item_sk] ColumnarToRow InputAdapter - Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_returned_date_sk] + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] InputAdapter ReusedExchange [d_date_sk,d_year] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/explain.txt index b14ab47d28afe..68cf417e81905 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/explain.txt @@ -91,18 +91,18 @@ Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) (4) Exchange Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] -Arguments: hashpartitioning(cast(ss_ticket_number#3 as bigint), cast(ss_item_sk#1 as bigint), 5), ENSURE_REQUIREMENTS, [id=#9] +Arguments: hashpartitioning(ss_ticket_number#3, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] (5) Sort [codegen id : 2] Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] -Arguments: [cast(ss_ticket_number#3 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_ticket_number#3 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] @@ -124,7 +124,7 @@ Input [2]: [sr_item_sk#10, sr_ticket_number#11] Arguments: [sr_ticket_number#11 ASC NULLS FIRST, sr_item_sk#10 ASC NULLS FIRST], false, 0 (12) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#3 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [ss_ticket_number#3, ss_item_sk#1] Right keys [2]: [sr_ticket_number#11, sr_item_sk#10] Join condition: None @@ -202,18 +202,18 @@ Condition : (isnotnull(ws_item_sk#31) AND isnotnull(ws_bill_customer_sk#32)) (28) Exchange Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] -Arguments: hashpartitioning(cast(ws_order_number#33 as bigint), cast(ws_item_sk#31 as bigint), 5), ENSURE_REQUIREMENTS, [id=#38] +Arguments: hashpartitioning(ws_order_number#33, ws_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#38] (29) Sort [codegen id : 9] Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] -Arguments: [cast(ws_order_number#33 as bigint) ASC NULLS FIRST, cast(ws_item_sk#31 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_order_number#33 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST], false, 0 (30) Scan parquet default.web_returns Output [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] -ReadSchema: struct +ReadSchema: struct (31) ColumnarToRow [codegen id : 10] Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] @@ -235,7 +235,7 @@ Input [2]: [wr_item_sk#39, wr_order_number#40] Arguments: [wr_order_number#40 ASC NULLS FIRST, wr_item_sk#39 ASC NULLS FIRST], false, 0 (36) SortMergeJoin -Left keys [2]: [cast(ws_order_number#33 as bigint), cast(ws_item_sk#31 as bigint)] +Left keys [2]: [ws_order_number#33, ws_item_sk#31] Right keys [2]: [wr_order_number#40, wr_item_sk#39] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt index a5d47ede475ca..cd8f5d5c6ae61 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt @@ -142,18 +142,18 @@ Condition : ((isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnul (4) Exchange Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] -Arguments: hashpartitioning(cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint), 5), ENSURE_REQUIREMENTS, [id=#9] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#9] (5) Sort [codegen id : 2] Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] -Arguments: [cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] @@ -175,7 +175,7 @@ Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13 Arguments: [sr_item_sk#10 ASC NULLS FIRST, sr_ticket_number#11 ASC NULLS FIRST], false, 0 (12) SortMergeJoin -Left keys [2]: [cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#4] Right keys [2]: [sr_item_sk#10, sr_ticket_number#11] Join condition: None @@ -477,18 +477,18 @@ Condition : ((isnotnull(ws_web_site_sk#87) AND isnotnull(ws_item_sk#86)) AND isn (78) Exchange Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Arguments: hashpartitioning(cast(ws_item_sk#86 as bigint), cast(ws_order_number#89 as bigint), 5), ENSURE_REQUIREMENTS, [id=#93] +Arguments: hashpartitioning(ws_item_sk#86, ws_order_number#89, 5), ENSURE_REQUIREMENTS, [id=#93] (79) Sort [codegen id : 22] Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Arguments: [cast(ws_item_sk#86 as bigint) ASC NULLS FIRST, cast(ws_order_number#89 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_item_sk#86 ASC NULLS FIRST, ws_order_number#89 ASC NULLS FIRST], false, 0 (80) Scan parquet default.web_returns Output [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] -ReadSchema: struct +ReadSchema: struct (81) ColumnarToRow [codegen id : 23] Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] @@ -510,7 +510,7 @@ Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] Arguments: [wr_item_sk#94 ASC NULLS FIRST, wr_order_number#95 ASC NULLS FIRST], false, 0 (86) SortMergeJoin -Left keys [2]: [cast(ws_item_sk#86 as bigint), cast(ws_order_number#89 as bigint)] +Left keys [2]: [ws_item_sk#86, ws_order_number#89] Right keys [2]: [wr_item_sk#94, wr_order_number#95] Join condition: None diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt index 9e5bd3aeaa1d1..a9efbf56ef743 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt @@ -142,18 +142,18 @@ Condition : ((isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnul (4) Exchange Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] -Arguments: hashpartitioning(cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint), 5), ENSURE_REQUIREMENTS, [id=#9] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#9] (5) Sort [codegen id : 2] Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] -Arguments: [cast(ss_item_sk#1 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 (6) Scan parquet default.store_returns Output [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] -ReadSchema: struct +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] @@ -175,7 +175,7 @@ Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13 Arguments: [sr_item_sk#10 ASC NULLS FIRST, sr_ticket_number#11 ASC NULLS FIRST], false, 0 (12) SortMergeJoin -Left keys [2]: [cast(ss_item_sk#1 as bigint), cast(ss_ticket_number#4 as bigint)] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#4] Right keys [2]: [sr_item_sk#10, sr_ticket_number#11] Join condition: None @@ -477,18 +477,18 @@ Condition : ((isnotnull(ws_web_site_sk#87) AND isnotnull(ws_item_sk#86)) AND isn (78) Exchange Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Arguments: hashpartitioning(cast(ws_item_sk#86 as bigint), cast(ws_order_number#89 as bigint), 5), ENSURE_REQUIREMENTS, [id=#93] +Arguments: hashpartitioning(ws_item_sk#86, ws_order_number#89, 5), ENSURE_REQUIREMENTS, [id=#93] (79) Sort [codegen id : 22] Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] -Arguments: [cast(ws_item_sk#86 as bigint) ASC NULLS FIRST, cast(ws_order_number#89 as bigint) ASC NULLS FIRST], false, 0 +Arguments: [ws_item_sk#86 ASC NULLS FIRST, ws_order_number#89 ASC NULLS FIRST], false, 0 (80) Scan parquet default.web_returns Output [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] -ReadSchema: struct +ReadSchema: struct (81) ColumnarToRow [codegen id : 23] Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] @@ -510,7 +510,7 @@ Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] Arguments: [wr_item_sk#94 ASC NULLS FIRST, wr_order_number#95 ASC NULLS FIRST], false, 0 (86) SortMergeJoin -Left keys [2]: [cast(ws_item_sk#86 as bigint), cast(ws_order_number#89 as bigint)] +Left keys [2]: [ws_item_sk#86, ws_order_number#89] Right keys [2]: [wr_item_sk#94, wr_order_number#95] Join condition: None diff --git a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala index da3f95b4c6ec9..e0ed9c8ff5412 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala @@ -21,6 +21,31 @@ import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession + +/** + * Base trait for TPC-DS related tests. + * + * Datatype mapping for TPC-DS and Spark SQL, fully matching schemas defined in `tpcds.sql` of the + * official tpcds toolkit + * see more at: + * http://www.tpc.org/tpc_documents_current_versions/pdf/tpc-ds_v2.9.0.pdf + * + * |---------------|---------------| + * | TPC-DS | Spark SQL | + * |---------------|---------------| + * | Identifier | INT | + * |---------------|---------------| + * | Integer | INT | + * |---------------|---------------| + * | Decimal(d, f) | Decimal(d, f) | + * |---------------|---------------| + * | Char(N) | Char(N) | + * |---------------|---------------| + * | Varchar(N) | Varchar(N) | + * |---------------|---------------| + * | Date | Date | + * |---------------|---------------| + */ trait TPCDSBase extends SharedSparkSession { // The TPCDS queries below are based on v1.4 @@ -77,16 +102,16 @@ trait TPCDSBase extends SharedSparkSession { """.stripMargin, "store_returns" -> """ - |`sr_returned_date_sk` BIGINT, - |`sr_return_time_sk` BIGINT, - |`sr_item_sk` BIGINT, - |`sr_customer_sk` BIGINT, - |`sr_cdemo_sk` BIGINT, - |`sr_hdemo_sk` BIGINT, - |`sr_addr_sk` BIGINT, - |`sr_store_sk` BIGINT, - |`sr_reason_sk` BIGINT, - |`sr_ticket_number` BIGINT, + |`sr_returned_date_sk` INT, + |`sr_return_time_sk` INT, + |`sr_item_sk` INT, + |`sr_customer_sk` INT, + |`sr_cdemo_sk` INT, + |`sr_hdemo_sk` INT, + |`sr_addr_sk` INT, + |`sr_store_sk` INT, + |`sr_reason_sk` INT, + |`sr_ticket_number` INT, |`sr_return_quantity` INT, |`sr_return_amt` DECIMAL(7,2), |`sr_return_tax` DECIMAL(7,2), @@ -203,20 +228,20 @@ trait TPCDSBase extends SharedSparkSession { """.stripMargin, "web_returns" -> """ - |`wr_returned_date_sk` BIGINT, - |`wr_returned_time_sk` BIGINT, - |`wr_item_sk` BIGINT, - |`wr_refunded_customer_sk` BIGINT, - |`wr_refunded_cdemo_sk` BIGINT, - |`wr_refunded_hdemo_sk` BIGINT, - |`wr_refunded_addr_sk` BIGINT, - |`wr_returning_customer_sk` BIGINT, - |`wr_returning_cdemo_sk` BIGINT, - |`wr_returning_hdemo_sk` BIGINT, - |`wr_returning_addr_sk` BIGINT, - |`wr_web_page_sk` BIGINT, - |`wr_reason_sk` BIGINT, - |`wr_order_number` BIGINT, + |`wr_returned_date_sk` INT, + |`wr_returned_time_sk` INT, + |`wr_item_sk` INT, + |`wr_refunded_customer_sk` INT, + |`wr_refunded_cdemo_sk` INT, + |`wr_refunded_hdemo_sk` INT, + |`wr_refunded_addr_sk` INT, + |`wr_returning_customer_sk` INT, + |`wr_returning_cdemo_sk` INT, + |`wr_returning_hdemo_sk` INT, + |`wr_returning_addr_sk` INT, + |`wr_web_page_sk` INT, + |`wr_reason_sk` INT, + |`wr_order_number` INT, |`wr_return_quantity` INT, |`wr_return_amt` DECIMAL(7,2), |`wr_return_tax` DECIMAL(7,2),