== 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#10609L]
Arguments: Range (12000000, 13000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#10609L % 250000) AS customer_id#10611L, concat(segment-, cast(cast((id#10609L % 12) as int) as string)) AS segment#10615, cast((id#10609L % 14) as int) AS processing_day#10617, ((cast(((id#10609L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#10619, cast((((id#10609L * 29) % 7) + 1) as int) AS events#10621]
Input [1]: [id#10609L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#10611L, segment#10615, processing_day#10617, amount#10619, events#10621, (amount#10619 * cast(events#10621 as double)) AS weighted_amount#10623]
Input [5]: [customer_id#10611L, segment#10615, processing_day#10617, amount#10619, events#10621]
(4) HashAggregate
Input [6]: [customer_id#10611L, segment#10615, processing_day#10617, amount#10619, events#10621, weighted_amount#10623]
Keys [2]: [segment#10615, processing_day#10617]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#10611L, 0.05, 0, 0), partial_sum(events#10621), partial_sum(weighted_amount#10623), partial_avg(amount#10619)]
Aggregate Attributes [57]: [count#10842L, MS[0]#10630L, MS[1]#10631L, MS[2]#10632L, MS[3]#10633L, MS[4]#10634L, MS[5]#10635L, MS[6]#10636L, MS[7]#10637L, MS[8]#10638L, MS[9]#10639L, MS[10]#10640L, MS[11]#10641L, MS[12]#10642L, MS[13]#10643L, MS[14]#10644L, MS[15]#10645L, MS[16]#10646L, MS[17]#10647L, MS[18]#10648L, MS[19]#10649L, MS[20]#10650L, MS[21]#10651L, MS[22]#10652L, MS[23]#10653L, MS[24]#10654L, MS[25]#10655L, MS[26]#10656L, MS[27]#10657L, MS[28]#10658L, MS[29]#10659L, MS[30]#10660L, MS[31]#10661L, MS[32]#10662L, MS[33]#10663L, MS[34]#10664L, MS[35]#10665L, MS[36]#10666L, MS[37]#10667L, MS[38]#10668L, MS[39]#10669L, MS[40]#10670L, MS[41]#10671L, MS[42]#10672L, MS[43]#10673L, MS[44]#10674L, MS[45]#10675L, MS[46]#10676L, MS[47]#10677L, MS[48]#10678L, MS[49]#10679L, MS[50]#10680L, MS[51]#10681L, sum#10843L, sum#10844, sum#10845, count#10846L]
Results [59]: [segment#10615, processing_day#10617, count#10847L, MS[0]#10682L, MS[1]#10683L, MS[2]#10684L, MS[3]#10685L, MS[4]#10686L, MS[5]#10687L, MS[6]#10688L, MS[7]#10689L, MS[8]#10690L, MS[9]#10691L, MS[10]#10692L, MS[11]#10693L, MS[12]#10694L, MS[13]#10695L, MS[14]#10696L, MS[15]#10697L, MS[16]#10698L, MS[17]#10699L, MS[18]#10700L, MS[19]#10701L, MS[20]#10702L, MS[21]#10703L, MS[22]#10704L, MS[23]#10705L, MS[24]#10706L, MS[25]#10707L, MS[26]#10708L, MS[27]#10709L, MS[28]#10710L, MS[29]#10711L, MS[30]#10712L, MS[31]#10713L, MS[32]#10714L, MS[33]#10715L, MS[34]#10716L, MS[35]#10717L, MS[36]#10718L, MS[37]#10719L, MS[38]#10720L, MS[39]#10721L, MS[40]#10722L, MS[41]#10723L, MS[42]#10724L, MS[43]#10725L, MS[44]#10726L, MS[45]#10727L, MS[46]#10728L, MS[47]#10729L, MS[48]#10730L, MS[49]#10731L, MS[50]#10732L, MS[51]#10733L, sum#10848L, sum#10849, sum#10850, count#10851L]
(5) Exchange
Input [59]: [segment#10615, processing_day#10617, count#10847L, MS[0]#10682L, MS[1]#10683L, MS[2]#10684L, MS[3]#10685L, MS[4]#10686L, MS[5]#10687L, MS[6]#10688L, MS[7]#10689L, MS[8]#10690L, MS[9]#10691L, MS[10]#10692L, MS[11]#10693L, MS[12]#10694L, MS[13]#10695L, MS[14]#10696L, MS[15]#10697L, MS[16]#10698L, MS[17]#10699L, MS[18]#10700L, MS[19]#10701L, MS[20]#10702L, MS[21]#10703L, MS[22]#10704L, MS[23]#10705L, MS[24]#10706L, MS[25]#10707L, MS[26]#10708L, MS[27]#10709L, MS[28]#10710L, MS[29]#10711L, MS[30]#10712L, MS[31]#10713L, MS[32]#10714L, MS[33]#10715L, MS[34]#10716L, MS[35]#10717L, MS[36]#10718L, MS[37]#10719L, MS[38]#10720L, MS[39]#10721L, MS[40]#10722L, MS[41]#10723L, MS[42]#10724L, MS[43]#10725L, MS[44]#10726L, MS[45]#10727L, MS[46]#10728L, MS[47]#10729L, MS[48]#10730L, MS[49]#10731L, MS[50]#10732L, MS[51]#10733L, sum#10848L, sum#10849, sum#10850, count#10851L]
Arguments: hashpartitioning(segment#10615, processing_day#10617, 200), ENSURE_REQUIREMENTS, [plan_id=1039]
(6) ShuffleQueryStage
Output [59]: [segment#10615, processing_day#10617, count#10847L, MS[0]#10682L, MS[1]#10683L, MS[2]#10684L, MS[3]#10685L, MS[4]#10686L, MS[5]#10687L, MS[6]#10688L, MS[7]#10689L, MS[8]#10690L, MS[9]#10691L, MS[10]#10692L, MS[11]#10693L, MS[12]#10694L, MS[13]#10695L, MS[14]#10696L, MS[15]#10697L, MS[16]#10698L, MS[17]#10699L, MS[18]#10700L, MS[19]#10701L, MS[20]#10702L, MS[21]#10703L, MS[22]#10704L, MS[23]#10705L, MS[24]#10706L, MS[25]#10707L, MS[26]#10708L, MS[27]#10709L, MS[28]#10710L, MS[29]#10711L, MS[30]#10712L, MS[31]#10713L, MS[32]#10714L, MS[33]#10715L, MS[34]#10716L, MS[35]#10717L, MS[36]#10718L, MS[37]#10719L, MS[38]#10720L, MS[39]#10721L, MS[40]#10722L, MS[41]#10723L, MS[42]#10724L, MS[43]#10725L, MS[44]#10726L, MS[45]#10727L, MS[46]#10728L, MS[47]#10729L, MS[48]#10730L, MS[49]#10731L, MS[50]#10732L, MS[51]#10733L, sum#10848L, sum#10849, sum#10850, count#10851L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#10615, processing_day#10617, count#10847L, MS[0]#10682L, MS[1]#10683L, MS[2]#10684L, MS[3]#10685L, MS[4]#10686L, MS[5]#10687L, MS[6]#10688L, MS[7]#10689L, MS[8]#10690L, MS[9]#10691L, MS[10]#10692L, MS[11]#10693L, MS[12]#10694L, MS[13]#10695L, MS[14]#10696L, MS[15]#10697L, MS[16]#10698L, MS[17]#10699L, MS[18]#10700L, MS[19]#10701L, MS[20]#10702L, MS[21]#10703L, MS[22]#10704L, MS[23]#10705L, MS[24]#10706L, MS[25]#10707L, MS[26]#10708L, MS[27]#10709L, MS[28]#10710L, MS[29]#10711L, MS[30]#10712L, MS[31]#10713L, MS[32]#10714L, MS[33]#10715L, MS[34]#10716L, MS[35]#10717L, MS[36]#10718L, MS[37]#10719L, MS[38]#10720L, MS[39]#10721L, MS[40]#10722L, MS[41]#10723L, MS[42]#10724L, MS[43]#10725L, MS[44]#10726L, MS[45]#10727L, MS[46]#10728L, MS[47]#10729L, MS[48]#10730L, MS[49]#10731L, MS[50]#10732L, MS[51]#10733L, sum#10848L, sum#10849, sum#10850, count#10851L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#10615, processing_day#10617, count#10847L, MS[0]#10682L, MS[1]#10683L, MS[2]#10684L, MS[3]#10685L, MS[4]#10686L, MS[5]#10687L, MS[6]#10688L, MS[7]#10689L, MS[8]#10690L, MS[9]#10691L, MS[10]#10692L, MS[11]#10693L, MS[12]#10694L, MS[13]#10695L, MS[14]#10696L, MS[15]#10697L, MS[16]#10698L, MS[17]#10699L, MS[18]#10700L, MS[19]#10701L, MS[20]#10702L, MS[21]#10703L, MS[22]#10704L, MS[23]#10705L, MS[24]#10706L, MS[25]#10707L, MS[26]#10708L, MS[27]#10709L, MS[28]#10710L, MS[29]#10711L, MS[30]#10712L, MS[31]#10713L, MS[32]#10714L, MS[33]#10715L, MS[34]#10716L, MS[35]#10717L, MS[36]#10718L, MS[37]#10719L, MS[38]#10720L, MS[39]#10721L, MS[40]#10722L, MS[41]#10723L, MS[42]#10724L, MS[43]#10725L, MS[44]#10726L, MS[45]#10727L, MS[46]#10728L, MS[47]#10729L, MS[48]#10730L, MS[49]#10731L, MS[50]#10732L, MS[51]#10733L, sum#10848L, sum#10849, sum#10850, count#10851L]
Keys [2]: [segment#10615, processing_day#10617]
Functions [5]: [count(1), approx_count_distinct(customer_id#10611L, 0.05, 0, 0), sum(events#10621), sum(weighted_amount#10623), avg(amount#10619)]
Aggregate Attributes [5]: [count(1)#10629L, approx_count_distinct(customer_id#10611L, 0.05, 0, 0)#10734L, sum(events#10621)#10735L, sum(weighted_amount#10623)#10736, avg(amount#10619)#10737]
Results [7]: [segment#10615, processing_day#10617, count(1)#10629L AS row_count#10624L, approx_count_distinct(customer_id#10611L, 0.05, 0, 0)#10734L AS unique_customers#10625L, sum(events#10621)#10735L AS event_sum#10626L, sum(weighted_amount#10623)#10736 AS weighted_amount_sum#10627, avg(amount#10619)#10737 AS avg_amount#10628]
(9) Exchange
Input [7]: [segment#10615, processing_day#10617, row_count#10624L, unique_customers#10625L, event_sum#10626L, weighted_amount_sum#10627, avg_amount#10628]
Arguments: rangepartitioning(segment#10615 ASC NULLS FIRST, processing_day#10617 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1061]
(10) ShuffleQueryStage
Output [7]: [segment#10615, processing_day#10617, row_count#10624L, unique_customers#10625L, event_sum#10626L, weighted_amount_sum#10627, avg_amount#10628]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#10615, processing_day#10617, row_count#10624L, unique_customers#10625L, event_sum#10626L, weighted_amount_sum#10627, avg_amount#10628]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#10615, processing_day#10617, row_count#10624L, unique_customers#10625L, event_sum#10626L, weighted_amount_sum#10627, avg_amount#10628]
Arguments: [segment#10615 ASC NULLS FIRST, processing_day#10617 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#10615, processing_day#10617, row_count#10624L, unique_customers#10625L, event_sum#10626L, weighted_amount_sum#10627, avg_amount#10628]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#10611L, segment#10615, processing_day#10617, amount#10619, events#10621, weighted_amount#10623]
Keys [2]: [segment#10615, processing_day#10617]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#10611L, 0.05, 0, 0), partial_sum(events#10621), partial_sum(weighted_amount#10623), partial_avg(amount#10619)]
Aggregate Attributes [57]: [count#10842L, MS[0]#10630L, MS[1]#10631L, MS[2]#10632L, MS[3]#10633L, MS[4]#10634L, MS[5]#10635L, MS[6]#10636L, MS[7]#10637L, MS[8]#10638L, MS[9]#10639L, MS[10]#10640L, MS[11]#10641L, MS[12]#10642L, MS[13]#10643L, MS[14]#10644L, MS[15]#10645L, MS[16]#10646L, MS[17]#10647L, MS[18]#10648L, MS[19]#10649L, MS[20]#10650L, MS[21]#10651L, MS[22]#10652L, MS[23]#10653L, MS[24]#10654L, MS[25]#10655L, MS[26]#10656L, MS[27]#10657L, MS[28]#10658L, MS[29]#10659L, MS[30]#10660L, MS[31]#10661L, MS[32]#10662L, MS[33]#10663L, MS[34]#10664L, MS[35]#10665L, MS[36]#10666L, MS[37]#10667L, MS[38]#10668L, MS[39]#10669L, MS[40]#10670L, MS[41]#10671L, MS[42]#10672L, MS[43]#10673L, MS[44]#10674L, MS[45]#10675L, MS[46]#10676L, MS[47]#10677L, MS[48]#10678L, MS[49]#10679L, MS[50]#10680L, MS[51]#10681L, sum#10843L, sum#10844, sum#10845, count#10846L]
Results [59]: [segment#10615, processing_day#10617, count#10847L, MS[0]#10682L, MS[1]#10683L, MS[2]#10684L, MS[3]#10685L, MS[4]#10686L, MS[5]#10687L, MS[6]#10688L, MS[7]#10689L, MS[8]#10690L, MS[9]#10691L, MS[10]#10692L, MS[11]#10693L, MS[12]#10694L, MS[13]#10695L, MS[14]#10696L, MS[15]#10697L, MS[16]#10698L, MS[17]#10699L, MS[18]#10700L, MS[19]#10701L, MS[20]#10702L, MS[21]#10703L, MS[22]#10704L, MS[23]#10705L, MS[24]#10706L, MS[25]#10707L, MS[26]#10708L, MS[27]#10709L, MS[28]#10710L, MS[29]#10711L, MS[30]#10712L, MS[31]#10713L, MS[32]#10714L, MS[33]#10715L, MS[34]#10716L, MS[35]#10717L, MS[36]#10718L, MS[37]#10719L, MS[38]#10720L, MS[39]#10721L, MS[40]#10722L, MS[41]#10723L, MS[42]#10724L, MS[43]#10725L, MS[44]#10726L, MS[45]#10727L, MS[46]#10728L, MS[47]#10729L, MS[48]#10730L, MS[49]#10731L, MS[50]#10732L, MS[51]#10733L, sum#10848L, sum#10849, sum#10850, count#10851L]
(15) Exchange
Input [59]: [segment#10615, processing_day#10617, count#10847L, MS[0]#10682L, MS[1]#10683L, MS[2]#10684L, MS[3]#10685L, MS[4]#10686L, MS[5]#10687L, MS[6]#10688L, MS[7]#10689L, MS[8]#10690L, MS[9]#10691L, MS[10]#10692L, MS[11]#10693L, MS[12]#10694L, MS[13]#10695L, MS[14]#10696L, MS[15]#10697L, MS[16]#10698L, MS[17]#10699L, MS[18]#10700L, MS[19]#10701L, MS[20]#10702L, MS[21]#10703L, MS[22]#10704L, MS[23]#10705L, MS[24]#10706L, MS[25]#10707L, MS[26]#10708L, MS[27]#10709L, MS[28]#10710L, MS[29]#10711L, MS[30]#10712L, MS[31]#10713L, MS[32]#10714L, MS[33]#10715L, MS[34]#10716L, MS[35]#10717L, MS[36]#10718L, MS[37]#10719L, MS[38]#10720L, MS[39]#10721L, MS[40]#10722L, MS[41]#10723L, MS[42]#10724L, MS[43]#10725L, MS[44]#10726L, MS[45]#10727L, MS[46]#10728L, MS[47]#10729L, MS[48]#10730L, MS[49]#10731L, MS[50]#10732L, MS[51]#10733L, sum#10848L, sum#10849, sum#10850, count#10851L]
Arguments: hashpartitioning(segment#10615, processing_day#10617, 200), ENSURE_REQUIREMENTS, [plan_id=1019]
(16) HashAggregate
Input [59]: [segment#10615, processing_day#10617, count#10847L, MS[0]#10682L, MS[1]#10683L, MS[2]#10684L, MS[3]#10685L, MS[4]#10686L, MS[5]#10687L, MS[6]#10688L, MS[7]#10689L, MS[8]#10690L, MS[9]#10691L, MS[10]#10692L, MS[11]#10693L, MS[12]#10694L, MS[13]#10695L, MS[14]#10696L, MS[15]#10697L, MS[16]#10698L, MS[17]#10699L, MS[18]#10700L, MS[19]#10701L, MS[20]#10702L, MS[21]#10703L, MS[22]#10704L, MS[23]#10705L, MS[24]#10706L, MS[25]#10707L, MS[26]#10708L, MS[27]#10709L, MS[28]#10710L, MS[29]#10711L, MS[30]#10712L, MS[31]#10713L, MS[32]#10714L, MS[33]#10715L, MS[34]#10716L, MS[35]#10717L, MS[36]#10718L, MS[37]#10719L, MS[38]#10720L, MS[39]#10721L, MS[40]#10722L, MS[41]#10723L, MS[42]#10724L, MS[43]#10725L, MS[44]#10726L, MS[45]#10727L, MS[46]#10728L, MS[47]#10729L, MS[48]#10730L, MS[49]#10731L, MS[50]#10732L, MS[51]#10733L, sum#10848L, sum#10849, sum#10850, count#10851L]
Keys [2]: [segment#10615, processing_day#10617]
Functions [5]: [count(1), approx_count_distinct(customer_id#10611L, 0.05, 0, 0), sum(events#10621), sum(weighted_amount#10623), avg(amount#10619)]
Aggregate Attributes [5]: [count(1)#10629L, approx_count_distinct(customer_id#10611L, 0.05, 0, 0)#10734L, sum(events#10621)#10735L, sum(weighted_amount#10623)#10736, avg(amount#10619)#10737]
Results [7]: [segment#10615, processing_day#10617, count(1)#10629L AS row_count#10624L, approx_count_distinct(customer_id#10611L, 0.05, 0, 0)#10734L AS unique_customers#10625L, sum(events#10621)#10735L AS event_sum#10626L, sum(weighted_amount#10623)#10736 AS weighted_amount_sum#10627, avg(amount#10619)#10737 AS avg_amount#10628]
(17) Exchange
Input [7]: [segment#10615, processing_day#10617, row_count#10624L, unique_customers#10625L, event_sum#10626L, weighted_amount_sum#10627, avg_amount#10628]
Arguments: rangepartitioning(segment#10615 ASC NULLS FIRST, processing_day#10617 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1022]
(18) Sort
Input [7]: [segment#10615, processing_day#10617, row_count#10624L, unique_customers#10625L, event_sum#10626L, weighted_amount_sum#10627, avg_amount#10628]
Arguments: [segment#10615 ASC NULLS FIRST, processing_day#10617 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#10615, processing_day#10617, row_count#10624L, unique_customers#10625L, event_sum#10626L, weighted_amount_sum#10627, avg_amount#10628]
Arguments: isFinalPlan=true