== Physical Plan ==
AdaptiveSparkPlan (19)
+- == Final Plan ==
ResultQueryStage (13), Statistics(sizeInBytes=8.0 EiB)
+- * Sort (12)
+- AQEShuffleRead (11)
+- ShuffleQueryStage (10), Statistics(sizeInBytes=6.6 KiB, rowCount=84)
+- Exchange (9)
+- HashAggregate (8)
+- AQEShuffleRead (7)
+- ShuffleQueryStage (6), Statistics(sizeInBytes=976.5 KiB, rowCount=2.02E+3)
+- Exchange (5)
+- HashAggregate (4)
+- * Project (3)
+- * Project (2)
+- * Range (1)
+- == Initial Plan ==
Sort (18)
+- Exchange (17)
+- HashAggregate (16)
+- Exchange (15)
+- HashAggregate (14)
+- Project (3)
+- Project (2)
+- Range (1)
(1) Range [codegen id : 1]
Output [1]: [id#24789L]
Arguments: Range (4000000, 5000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#24789L % 250000) AS customer_id#24791L, concat(segment-, cast(cast((id#24789L % 12) as int) as string)) AS segment#24795, cast((id#24789L % 14) as int) AS processing_day#24797, ((cast(((id#24789L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#24799, cast((((id#24789L * 29) % 7) + 1) as int) AS events#24801]
Input [1]: [id#24789L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#24791L, segment#24795, processing_day#24797, amount#24799, events#24801, (amount#24799 * cast(events#24801 as double)) AS weighted_amount#24803]
Input [5]: [customer_id#24791L, segment#24795, processing_day#24797, amount#24799, events#24801]
(4) HashAggregate
Input [6]: [customer_id#24791L, segment#24795, processing_day#24797, amount#24799, events#24801, weighted_amount#24803]
Keys [2]: [segment#24795, processing_day#24797]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#24791L, 0.05, 0, 0), partial_sum(events#24801), partial_sum(weighted_amount#24803), partial_avg(amount#24799)]
Aggregate Attributes [57]: [count#25022L, MS[0]#24810L, MS[1]#24811L, MS[2]#24812L, MS[3]#24813L, MS[4]#24814L, MS[5]#24815L, MS[6]#24816L, MS[7]#24817L, MS[8]#24818L, MS[9]#24819L, MS[10]#24820L, MS[11]#24821L, MS[12]#24822L, MS[13]#24823L, MS[14]#24824L, MS[15]#24825L, MS[16]#24826L, MS[17]#24827L, MS[18]#24828L, MS[19]#24829L, MS[20]#24830L, MS[21]#24831L, MS[22]#24832L, MS[23]#24833L, MS[24]#24834L, MS[25]#24835L, MS[26]#24836L, MS[27]#24837L, MS[28]#24838L, MS[29]#24839L, MS[30]#24840L, MS[31]#24841L, MS[32]#24842L, MS[33]#24843L, MS[34]#24844L, MS[35]#24845L, MS[36]#24846L, MS[37]#24847L, MS[38]#24848L, MS[39]#24849L, MS[40]#24850L, MS[41]#24851L, MS[42]#24852L, MS[43]#24853L, MS[44]#24854L, MS[45]#24855L, MS[46]#24856L, MS[47]#24857L, MS[48]#24858L, MS[49]#24859L, MS[50]#24860L, MS[51]#24861L, sum#25023L, sum#25024, sum#25025, count#25026L]
Results [59]: [segment#24795, processing_day#24797, count#25027L, MS[0]#24862L, MS[1]#24863L, MS[2]#24864L, MS[3]#24865L, MS[4]#24866L, MS[5]#24867L, MS[6]#24868L, MS[7]#24869L, MS[8]#24870L, MS[9]#24871L, MS[10]#24872L, MS[11]#24873L, MS[12]#24874L, MS[13]#24875L, MS[14]#24876L, MS[15]#24877L, MS[16]#24878L, MS[17]#24879L, MS[18]#24880L, MS[19]#24881L, MS[20]#24882L, MS[21]#24883L, MS[22]#24884L, MS[23]#24885L, MS[24]#24886L, MS[25]#24887L, MS[26]#24888L, MS[27]#24889L, MS[28]#24890L, MS[29]#24891L, MS[30]#24892L, MS[31]#24893L, MS[32]#24894L, MS[33]#24895L, MS[34]#24896L, MS[35]#24897L, MS[36]#24898L, MS[37]#24899L, MS[38]#24900L, MS[39]#24901L, MS[40]#24902L, MS[41]#24903L, MS[42]#24904L, MS[43]#24905L, MS[44]#24906L, MS[45]#24907L, MS[46]#24908L, MS[47]#24909L, MS[48]#24910L, MS[49]#24911L, MS[50]#24912L, MS[51]#24913L, sum#25028L, sum#25029, sum#25030, count#25031L]
(5) Exchange
Input [59]: [segment#24795, processing_day#24797, count#25027L, MS[0]#24862L, MS[1]#24863L, MS[2]#24864L, MS[3]#24865L, MS[4]#24866L, MS[5]#24867L, MS[6]#24868L, MS[7]#24869L, MS[8]#24870L, MS[9]#24871L, MS[10]#24872L, MS[11]#24873L, MS[12]#24874L, MS[13]#24875L, MS[14]#24876L, MS[15]#24877L, MS[16]#24878L, MS[17]#24879L, MS[18]#24880L, MS[19]#24881L, MS[20]#24882L, MS[21]#24883L, MS[22]#24884L, MS[23]#24885L, MS[24]#24886L, MS[25]#24887L, MS[26]#24888L, MS[27]#24889L, MS[28]#24890L, MS[29]#24891L, MS[30]#24892L, MS[31]#24893L, MS[32]#24894L, MS[33]#24895L, MS[34]#24896L, MS[35]#24897L, MS[36]#24898L, MS[37]#24899L, MS[38]#24900L, MS[39]#24901L, MS[40]#24902L, MS[41]#24903L, MS[42]#24904L, MS[43]#24905L, MS[44]#24906L, MS[45]#24907L, MS[46]#24908L, MS[47]#24909L, MS[48]#24910L, MS[49]#24911L, MS[50]#24912L, MS[51]#24913L, sum#25028L, sum#25029, sum#25030, count#25031L]
Arguments: hashpartitioning(segment#24795, processing_day#24797, 200), ENSURE_REQUIREMENTS, [plan_id=2373]
(6) ShuffleQueryStage
Output [59]: [segment#24795, processing_day#24797, count#25027L, MS[0]#24862L, MS[1]#24863L, MS[2]#24864L, MS[3]#24865L, MS[4]#24866L, MS[5]#24867L, MS[6]#24868L, MS[7]#24869L, MS[8]#24870L, MS[9]#24871L, MS[10]#24872L, MS[11]#24873L, MS[12]#24874L, MS[13]#24875L, MS[14]#24876L, MS[15]#24877L, MS[16]#24878L, MS[17]#24879L, MS[18]#24880L, MS[19]#24881L, MS[20]#24882L, MS[21]#24883L, MS[22]#24884L, MS[23]#24885L, MS[24]#24886L, MS[25]#24887L, MS[26]#24888L, MS[27]#24889L, MS[28]#24890L, MS[29]#24891L, MS[30]#24892L, MS[31]#24893L, MS[32]#24894L, MS[33]#24895L, MS[34]#24896L, MS[35]#24897L, MS[36]#24898L, MS[37]#24899L, MS[38]#24900L, MS[39]#24901L, MS[40]#24902L, MS[41]#24903L, MS[42]#24904L, MS[43]#24905L, MS[44]#24906L, MS[45]#24907L, MS[46]#24908L, MS[47]#24909L, MS[48]#24910L, MS[49]#24911L, MS[50]#24912L, MS[51]#24913L, sum#25028L, sum#25029, sum#25030, count#25031L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#24795, processing_day#24797, count#25027L, MS[0]#24862L, MS[1]#24863L, MS[2]#24864L, MS[3]#24865L, MS[4]#24866L, MS[5]#24867L, MS[6]#24868L, MS[7]#24869L, MS[8]#24870L, MS[9]#24871L, MS[10]#24872L, MS[11]#24873L, MS[12]#24874L, MS[13]#24875L, MS[14]#24876L, MS[15]#24877L, MS[16]#24878L, MS[17]#24879L, MS[18]#24880L, MS[19]#24881L, MS[20]#24882L, MS[21]#24883L, MS[22]#24884L, MS[23]#24885L, MS[24]#24886L, MS[25]#24887L, MS[26]#24888L, MS[27]#24889L, MS[28]#24890L, MS[29]#24891L, MS[30]#24892L, MS[31]#24893L, MS[32]#24894L, MS[33]#24895L, MS[34]#24896L, MS[35]#24897L, MS[36]#24898L, MS[37]#24899L, MS[38]#24900L, MS[39]#24901L, MS[40]#24902L, MS[41]#24903L, MS[42]#24904L, MS[43]#24905L, MS[44]#24906L, MS[45]#24907L, MS[46]#24908L, MS[47]#24909L, MS[48]#24910L, MS[49]#24911L, MS[50]#24912L, MS[51]#24913L, sum#25028L, sum#25029, sum#25030, count#25031L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#24795, processing_day#24797, count#25027L, MS[0]#24862L, MS[1]#24863L, MS[2]#24864L, MS[3]#24865L, MS[4]#24866L, MS[5]#24867L, MS[6]#24868L, MS[7]#24869L, MS[8]#24870L, MS[9]#24871L, MS[10]#24872L, MS[11]#24873L, MS[12]#24874L, MS[13]#24875L, MS[14]#24876L, MS[15]#24877L, MS[16]#24878L, MS[17]#24879L, MS[18]#24880L, MS[19]#24881L, MS[20]#24882L, MS[21]#24883L, MS[22]#24884L, MS[23]#24885L, MS[24]#24886L, MS[25]#24887L, MS[26]#24888L, MS[27]#24889L, MS[28]#24890L, MS[29]#24891L, MS[30]#24892L, MS[31]#24893L, MS[32]#24894L, MS[33]#24895L, MS[34]#24896L, MS[35]#24897L, MS[36]#24898L, MS[37]#24899L, MS[38]#24900L, MS[39]#24901L, MS[40]#24902L, MS[41]#24903L, MS[42]#24904L, MS[43]#24905L, MS[44]#24906L, MS[45]#24907L, MS[46]#24908L, MS[47]#24909L, MS[48]#24910L, MS[49]#24911L, MS[50]#24912L, MS[51]#24913L, sum#25028L, sum#25029, sum#25030, count#25031L]
Keys [2]: [segment#24795, processing_day#24797]
Functions [5]: [count(1), approx_count_distinct(customer_id#24791L, 0.05, 0, 0), sum(events#24801), sum(weighted_amount#24803), avg(amount#24799)]
Aggregate Attributes [5]: [count(1)#24809L, approx_count_distinct(customer_id#24791L, 0.05, 0, 0)#24914L, sum(events#24801)#24915L, sum(weighted_amount#24803)#24916, avg(amount#24799)#24917]
Results [7]: [segment#24795, processing_day#24797, count(1)#24809L AS row_count#24804L, approx_count_distinct(customer_id#24791L, 0.05, 0, 0)#24914L AS unique_customers#24805L, sum(events#24801)#24915L AS event_sum#24806L, sum(weighted_amount#24803)#24916 AS weighted_amount_sum#24807, avg(amount#24799)#24917 AS avg_amount#24808]
(9) Exchange
Input [7]: [segment#24795, processing_day#24797, row_count#24804L, unique_customers#24805L, event_sum#24806L, weighted_amount_sum#24807, avg_amount#24808]
Arguments: rangepartitioning(segment#24795 ASC NULLS FIRST, processing_day#24797 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2395]
(10) ShuffleQueryStage
Output [7]: [segment#24795, processing_day#24797, row_count#24804L, unique_customers#24805L, event_sum#24806L, weighted_amount_sum#24807, avg_amount#24808]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#24795, processing_day#24797, row_count#24804L, unique_customers#24805L, event_sum#24806L, weighted_amount_sum#24807, avg_amount#24808]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#24795, processing_day#24797, row_count#24804L, unique_customers#24805L, event_sum#24806L, weighted_amount_sum#24807, avg_amount#24808]
Arguments: [segment#24795 ASC NULLS FIRST, processing_day#24797 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#24795, processing_day#24797, row_count#24804L, unique_customers#24805L, event_sum#24806L, weighted_amount_sum#24807, avg_amount#24808]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#24791L, segment#24795, processing_day#24797, amount#24799, events#24801, weighted_amount#24803]
Keys [2]: [segment#24795, processing_day#24797]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#24791L, 0.05, 0, 0), partial_sum(events#24801), partial_sum(weighted_amount#24803), partial_avg(amount#24799)]
Aggregate Attributes [57]: [count#25022L, MS[0]#24810L, MS[1]#24811L, MS[2]#24812L, MS[3]#24813L, MS[4]#24814L, MS[5]#24815L, MS[6]#24816L, MS[7]#24817L, MS[8]#24818L, MS[9]#24819L, MS[10]#24820L, MS[11]#24821L, MS[12]#24822L, MS[13]#24823L, MS[14]#24824L, MS[15]#24825L, MS[16]#24826L, MS[17]#24827L, MS[18]#24828L, MS[19]#24829L, MS[20]#24830L, MS[21]#24831L, MS[22]#24832L, MS[23]#24833L, MS[24]#24834L, MS[25]#24835L, MS[26]#24836L, MS[27]#24837L, MS[28]#24838L, MS[29]#24839L, MS[30]#24840L, MS[31]#24841L, MS[32]#24842L, MS[33]#24843L, MS[34]#24844L, MS[35]#24845L, MS[36]#24846L, MS[37]#24847L, MS[38]#24848L, MS[39]#24849L, MS[40]#24850L, MS[41]#24851L, MS[42]#24852L, MS[43]#24853L, MS[44]#24854L, MS[45]#24855L, MS[46]#24856L, MS[47]#24857L, MS[48]#24858L, MS[49]#24859L, MS[50]#24860L, MS[51]#24861L, sum#25023L, sum#25024, sum#25025, count#25026L]
Results [59]: [segment#24795, processing_day#24797, count#25027L, MS[0]#24862L, MS[1]#24863L, MS[2]#24864L, MS[3]#24865L, MS[4]#24866L, MS[5]#24867L, MS[6]#24868L, MS[7]#24869L, MS[8]#24870L, MS[9]#24871L, MS[10]#24872L, MS[11]#24873L, MS[12]#24874L, MS[13]#24875L, MS[14]#24876L, MS[15]#24877L, MS[16]#24878L, MS[17]#24879L, MS[18]#24880L, MS[19]#24881L, MS[20]#24882L, MS[21]#24883L, MS[22]#24884L, MS[23]#24885L, MS[24]#24886L, MS[25]#24887L, MS[26]#24888L, MS[27]#24889L, MS[28]#24890L, MS[29]#24891L, MS[30]#24892L, MS[31]#24893L, MS[32]#24894L, MS[33]#24895L, MS[34]#24896L, MS[35]#24897L, MS[36]#24898L, MS[37]#24899L, MS[38]#24900L, MS[39]#24901L, MS[40]#24902L, MS[41]#24903L, MS[42]#24904L, MS[43]#24905L, MS[44]#24906L, MS[45]#24907L, MS[46]#24908L, MS[47]#24909L, MS[48]#24910L, MS[49]#24911L, MS[50]#24912L, MS[51]#24913L, sum#25028L, sum#25029, sum#25030, count#25031L]
(15) Exchange
Input [59]: [segment#24795, processing_day#24797, count#25027L, MS[0]#24862L, MS[1]#24863L, MS[2]#24864L, MS[3]#24865L, MS[4]#24866L, MS[5]#24867L, MS[6]#24868L, MS[7]#24869L, MS[8]#24870L, MS[9]#24871L, MS[10]#24872L, MS[11]#24873L, MS[12]#24874L, MS[13]#24875L, MS[14]#24876L, MS[15]#24877L, MS[16]#24878L, MS[17]#24879L, MS[18]#24880L, MS[19]#24881L, MS[20]#24882L, MS[21]#24883L, MS[22]#24884L, MS[23]#24885L, MS[24]#24886L, MS[25]#24887L, MS[26]#24888L, MS[27]#24889L, MS[28]#24890L, MS[29]#24891L, MS[30]#24892L, MS[31]#24893L, MS[32]#24894L, MS[33]#24895L, MS[34]#24896L, MS[35]#24897L, MS[36]#24898L, MS[37]#24899L, MS[38]#24900L, MS[39]#24901L, MS[40]#24902L, MS[41]#24903L, MS[42]#24904L, MS[43]#24905L, MS[44]#24906L, MS[45]#24907L, MS[46]#24908L, MS[47]#24909L, MS[48]#24910L, MS[49]#24911L, MS[50]#24912L, MS[51]#24913L, sum#25028L, sum#25029, sum#25030, count#25031L]
Arguments: hashpartitioning(segment#24795, processing_day#24797, 200), ENSURE_REQUIREMENTS, [plan_id=2353]
(16) HashAggregate
Input [59]: [segment#24795, processing_day#24797, count#25027L, MS[0]#24862L, MS[1]#24863L, MS[2]#24864L, MS[3]#24865L, MS[4]#24866L, MS[5]#24867L, MS[6]#24868L, MS[7]#24869L, MS[8]#24870L, MS[9]#24871L, MS[10]#24872L, MS[11]#24873L, MS[12]#24874L, MS[13]#24875L, MS[14]#24876L, MS[15]#24877L, MS[16]#24878L, MS[17]#24879L, MS[18]#24880L, MS[19]#24881L, MS[20]#24882L, MS[21]#24883L, MS[22]#24884L, MS[23]#24885L, MS[24]#24886L, MS[25]#24887L, MS[26]#24888L, MS[27]#24889L, MS[28]#24890L, MS[29]#24891L, MS[30]#24892L, MS[31]#24893L, MS[32]#24894L, MS[33]#24895L, MS[34]#24896L, MS[35]#24897L, MS[36]#24898L, MS[37]#24899L, MS[38]#24900L, MS[39]#24901L, MS[40]#24902L, MS[41]#24903L, MS[42]#24904L, MS[43]#24905L, MS[44]#24906L, MS[45]#24907L, MS[46]#24908L, MS[47]#24909L, MS[48]#24910L, MS[49]#24911L, MS[50]#24912L, MS[51]#24913L, sum#25028L, sum#25029, sum#25030, count#25031L]
Keys [2]: [segment#24795, processing_day#24797]
Functions [5]: [count(1), approx_count_distinct(customer_id#24791L, 0.05, 0, 0), sum(events#24801), sum(weighted_amount#24803), avg(amount#24799)]
Aggregate Attributes [5]: [count(1)#24809L, approx_count_distinct(customer_id#24791L, 0.05, 0, 0)#24914L, sum(events#24801)#24915L, sum(weighted_amount#24803)#24916, avg(amount#24799)#24917]
Results [7]: [segment#24795, processing_day#24797, count(1)#24809L AS row_count#24804L, approx_count_distinct(customer_id#24791L, 0.05, 0, 0)#24914L AS unique_customers#24805L, sum(events#24801)#24915L AS event_sum#24806L, sum(weighted_amount#24803)#24916 AS weighted_amount_sum#24807, avg(amount#24799)#24917 AS avg_amount#24808]
(17) Exchange
Input [7]: [segment#24795, processing_day#24797, row_count#24804L, unique_customers#24805L, event_sum#24806L, weighted_amount_sum#24807, avg_amount#24808]
Arguments: rangepartitioning(segment#24795 ASC NULLS FIRST, processing_day#24797 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2356]
(18) Sort
Input [7]: [segment#24795, processing_day#24797, row_count#24804L, unique_customers#24805L, event_sum#24806L, weighted_amount_sum#24807, avg_amount#24808]
Arguments: [segment#24795 ASC NULLS FIRST, processing_day#24797 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#24795, processing_day#24797, row_count#24804L, unique_customers#24805L, event_sum#24806L, weighted_amount_sum#24807, avg_amount#24808]
Arguments: isFinalPlan=true