== Physical Plan ==
TakeOrderedAndProject (54)
+- * HashAggregate (53)
   +- Exchange (52)
      +- * HashAggregate (51)
         +- * Project (50)
            +- * BroadcastHashJoin Inner BuildLeft (49)
               :- BroadcastExchange (45)
               :  +- * Project (44)
               :     +- * BroadcastHashJoin Inner BuildRight (43)
               :        :- * Project (37)
               :        :  +- SortMergeJoin LeftAnti (36)
               :        :     :- SortMergeJoin LeftAnti (27)
               :        :     :  :- SortMergeJoin LeftSemi (18)
               :        :     :  :  :- * Sort (5)
               :        :     :  :  :  +- Exchange (4)
               :        :     :  :  :     +- * Filter (3)
               :        :     :  :  :        +- * ColumnarToRow (2)
               :        :     :  :  :           +- Scan parquet default.customer (1)
               :        :     :  :  +- * Sort (17)
               :        :     :  :     +- Exchange (16)
               :        :     :  :        +- * Project (15)
               :        :     :  :           +- * BroadcastHashJoin Inner BuildRight (14)
               :        :     :  :              :- * Filter (8)
               :        :     :  :              :  +- * ColumnarToRow (7)
               :        :     :  :              :     +- Scan parquet default.store_sales (6)
               :        :     :  :              +- BroadcastExchange (13)
               :        :     :  :                 +- * Project (12)
               :        :     :  :                    +- * Filter (11)
               :        :     :  :                       +- * ColumnarToRow (10)
               :        :     :  :                          +- Scan parquet default.date_dim (9)
               :        :     :  +- * Sort (26)
               :        :     :     +- Exchange (25)
               :        :     :        +- * Project (24)
               :        :     :           +- * BroadcastHashJoin Inner BuildRight (23)
               :        :     :              :- * Filter (21)
               :        :     :              :  +- * ColumnarToRow (20)
               :        :     :              :     +- Scan parquet default.web_sales (19)
               :        :     :              +- ReusedExchange (22)
               :        :     +- * Sort (35)
               :        :        +- Exchange (34)
               :        :           +- * Project (33)
               :        :              +- * BroadcastHashJoin Inner BuildRight (32)
               :        :                 :- * Filter (30)
               :        :                 :  +- * ColumnarToRow (29)
               :        :                 :     +- Scan parquet default.catalog_sales (28)
               :        :                 +- ReusedExchange (31)
               :        +- BroadcastExchange (42)
               :           +- * Project (41)
               :              +- * Filter (40)
               :                 +- * ColumnarToRow (39)
               :                    +- Scan parquet default.customer_address (38)
               +- * Filter (48)
                  +- * ColumnarToRow (47)
                     +- Scan parquet default.customer_demographics (46)


(1) Scan parquet default.customer
Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_cdemo_sk:int,c_current_addr_sk:int>

(2) ColumnarToRow [codegen id : 1]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]

(3) Filter [codegen id : 1]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2))

(4) Exchange
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#4]

(5) Sort [codegen id : 2]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0

(6) Scan parquet default.store_sales
Output [2]: [ss_sold_date_sk#5, ss_customer_sk#6]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_sold_date_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_customer_sk:int>

(7) ColumnarToRow [codegen id : 4]
Input [2]: [ss_sold_date_sk#5, ss_customer_sk#6]

(8) Filter [codegen id : 4]
Input [2]: [ss_sold_date_sk#5, ss_customer_sk#6]
Condition : isnotnull(ss_sold_date_sk#5)

(9) Scan parquet default.date_dim
Output [3]: [d_date_sk#7, d_year#8, d_moy#9]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,6), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(10) ColumnarToRow [codegen id : 3]
Input [3]: [d_date_sk#7, d_year#8, d_moy#9]

(11) Filter [codegen id : 3]
Input [3]: [d_date_sk#7, d_year#8, d_moy#9]
Condition : (((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2001)) AND (d_moy#9 >= 4)) AND (d_moy#9 <= 6)) AND isnotnull(d_date_sk#7))

(12) Project [codegen id : 3]
Output [1]: [d_date_sk#7]
Input [3]: [d_date_sk#7, d_year#8, d_moy#9]

(13) BroadcastExchange
Input [1]: [d_date_sk#7]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10]

(14) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [ss_sold_date_sk#5]
Right keys [1]: [d_date_sk#7]
Join condition: None

(15) Project [codegen id : 4]
Output [1]: [ss_customer_sk#6]
Input [3]: [ss_sold_date_sk#5, ss_customer_sk#6, d_date_sk#7]

(16) Exchange
Input [1]: [ss_customer_sk#6]
Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#11]

(17) Sort [codegen id : 5]
Input [1]: [ss_customer_sk#6]
Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0

(18) SortMergeJoin
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [ss_customer_sk#6]
Join condition: None

(19) Scan parquet default.web_sales
Output [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
PushedFilters: [IsNotNull(ws_sold_date_sk)]
ReadSchema: struct<ws_sold_date_sk:int,ws_bill_customer_sk:int>

(20) ColumnarToRow [codegen id : 7]
Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13]

(21) Filter [codegen id : 7]
Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13]
Condition : isnotnull(ws_sold_date_sk#12)

(22) ReusedExchange [Reuses operator id: 13]
Output [1]: [d_date_sk#7]

(23) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [ws_sold_date_sk#12]
Right keys [1]: [d_date_sk#7]
Join condition: None

(24) Project [codegen id : 7]
Output [1]: [ws_bill_customer_sk#13]
Input [3]: [ws_sold_date_sk#12, ws_bill_customer_sk#13, d_date_sk#7]

(25) Exchange
Input [1]: [ws_bill_customer_sk#13]
Arguments: hashpartitioning(ws_bill_customer_sk#13, 5), true, [id=#14]

(26) Sort [codegen id : 8]
Input [1]: [ws_bill_customer_sk#13]
Arguments: [ws_bill_customer_sk#13 ASC NULLS FIRST], false, 0

(27) SortMergeJoin
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [ws_bill_customer_sk#13]
Join condition: None

(28) Scan parquet default.catalog_sales
Output [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_sales]
PushedFilters: [IsNotNull(cs_sold_date_sk)]
ReadSchema: struct<cs_sold_date_sk:int,cs_ship_customer_sk:int>

(29) ColumnarToRow [codegen id : 10]
Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16]

(30) Filter [codegen id : 10]
Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16]
Condition : isnotnull(cs_sold_date_sk#15)

(31) ReusedExchange [Reuses operator id: 13]
Output [1]: [d_date_sk#7]

(32) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [cs_sold_date_sk#15]
Right keys [1]: [d_date_sk#7]
Join condition: None

(33) Project [codegen id : 10]
Output [1]: [cs_ship_customer_sk#16]
Input [3]: [cs_sold_date_sk#15, cs_ship_customer_sk#16, d_date_sk#7]

(34) Exchange
Input [1]: [cs_ship_customer_sk#16]
Arguments: hashpartitioning(cs_ship_customer_sk#16, 5), true, [id=#17]

(35) Sort [codegen id : 11]
Input [1]: [cs_ship_customer_sk#16]
Arguments: [cs_ship_customer_sk#16 ASC NULLS FIRST], false, 0

(36) SortMergeJoin
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [cs_ship_customer_sk#16]
Join condition: None

(37) Project [codegen id : 13]
Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]

(38) Scan parquet default.customer_address
Output [2]: [ca_address_sk#18, ca_state#19]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_state, [KY,GA,NM]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string>

(39) ColumnarToRow [codegen id : 12]
Input [2]: [ca_address_sk#18, ca_state#19]

(40) Filter [codegen id : 12]
Input [2]: [ca_address_sk#18, ca_state#19]
Condition : (ca_state#19 IN (KY,GA,NM) AND isnotnull(ca_address_sk#18))

(41) Project [codegen id : 12]
Output [1]: [ca_address_sk#18]
Input [2]: [ca_address_sk#18, ca_state#19]

(42) BroadcastExchange
Input [1]: [ca_address_sk#18]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20]

(43) BroadcastHashJoin [codegen id : 13]
Left keys [1]: [c_current_addr_sk#3]
Right keys [1]: [ca_address_sk#18]
Join condition: None

(44) Project [codegen id : 13]
Output [1]: [c_current_cdemo_sk#2]
Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#18]

(45) BroadcastExchange
Input [1]: [c_current_cdemo_sk#2]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21]

(46) Scan parquet default.customer_demographics
Output [6]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_demographics]
PushedFilters: [IsNotNull(cd_demo_sk)]
ReadSchema: struct<cd_demo_sk:int,cd_gender:string,cd_marital_status:string,cd_education_status:string,cd_purchase_estimate:int,cd_credit_rating:string>

(47) ColumnarToRow
Input [6]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27]

(48) Filter
Input [6]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27]
Condition : isnotnull(cd_demo_sk#22)

(49) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [c_current_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#22]
Join condition: None

(50) Project [codegen id : 14]
Output [5]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27]
Input [7]: [c_current_cdemo_sk#2, cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27]

(51) HashAggregate [codegen id : 14]
Input [5]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27]
Keys [5]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#28]
Results [6]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, count#29]

(52) Exchange
Input [6]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, count#29]
Arguments: hashpartitioning(cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, 5), true, [id=#30]

(53) HashAggregate [codegen id : 15]
Input [6]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, count#29]
Keys [5]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#31]
Results [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, count(1)#31 AS cnt1#32, cd_purchase_estimate#26, count(1)#31 AS cnt2#33, cd_credit_rating#27, count(1)#31 AS cnt3#34]

(54) TakeOrderedAndProject
Input [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#32, cd_purchase_estimate#26, cnt2#33, cd_credit_rating#27, cnt3#34]
Arguments: 100, [cd_gender#23 ASC NULLS FIRST, cd_marital_status#24 ASC NULLS FIRST, cd_education_status#25 ASC NULLS FIRST, cd_purchase_estimate#26 ASC NULLS FIRST, cd_credit_rating#27 ASC NULLS FIRST], [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#32, cd_purchase_estimate#26, cnt2#33, cd_credit_rating#27, cnt3#34]

