== 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#64637L]
Arguments: Range (1000000, 2000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#64637L % 250000) AS customer_id#64639L, concat(segment-, cast(cast((id#64637L % 12) as int) as string)) AS segment#64643, cast((id#64637L % 14) as int) AS processing_day#64645, ((cast(((id#64637L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#64647, cast((((id#64637L * 29) % 7) + 1) as int) AS events#64649]
Input [1]: [id#64637L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#64639L, segment#64643, processing_day#64645, amount#64647, events#64649, (amount#64647 * cast(events#64649 as double)) AS weighted_amount#64651]
Input [5]: [customer_id#64639L, segment#64643, processing_day#64645, amount#64647, events#64649]
(4) HashAggregate
Input [6]: [customer_id#64639L, segment#64643, processing_day#64645, amount#64647, events#64649, weighted_amount#64651]
Keys [2]: [segment#64643, processing_day#64645]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#64639L, 0.05, 0, 0), partial_sum(events#64649), partial_sum(weighted_amount#64651), partial_avg(amount#64647)]
Aggregate Attributes [57]: [count#64870L, MS[0]#64658L, MS[1]#64659L, MS[2]#64660L, MS[3]#64661L, MS[4]#64662L, MS[5]#64663L, MS[6]#64664L, MS[7]#64665L, MS[8]#64666L, MS[9]#64667L, MS[10]#64668L, MS[11]#64669L, MS[12]#64670L, MS[13]#64671L, MS[14]#64672L, MS[15]#64673L, MS[16]#64674L, MS[17]#64675L, MS[18]#64676L, MS[19]#64677L, MS[20]#64678L, MS[21]#64679L, MS[22]#64680L, MS[23]#64681L, MS[24]#64682L, MS[25]#64683L, MS[26]#64684L, MS[27]#64685L, MS[28]#64686L, MS[29]#64687L, MS[30]#64688L, MS[31]#64689L, MS[32]#64690L, MS[33]#64691L, MS[34]#64692L, MS[35]#64693L, MS[36]#64694L, MS[37]#64695L, MS[38]#64696L, MS[39]#64697L, MS[40]#64698L, MS[41]#64699L, MS[42]#64700L, MS[43]#64701L, MS[44]#64702L, MS[45]#64703L, MS[46]#64704L, MS[47]#64705L, MS[48]#64706L, MS[49]#64707L, MS[50]#64708L, MS[51]#64709L, sum#64871L, sum#64872, sum#64873, count#64874L]
Results [59]: [segment#64643, processing_day#64645, count#64875L, MS[0]#64710L, MS[1]#64711L, MS[2]#64712L, MS[3]#64713L, MS[4]#64714L, MS[5]#64715L, MS[6]#64716L, MS[7]#64717L, MS[8]#64718L, MS[9]#64719L, MS[10]#64720L, MS[11]#64721L, MS[12]#64722L, MS[13]#64723L, MS[14]#64724L, MS[15]#64725L, MS[16]#64726L, MS[17]#64727L, MS[18]#64728L, MS[19]#64729L, MS[20]#64730L, MS[21]#64731L, MS[22]#64732L, MS[23]#64733L, MS[24]#64734L, MS[25]#64735L, MS[26]#64736L, MS[27]#64737L, MS[28]#64738L, MS[29]#64739L, MS[30]#64740L, MS[31]#64741L, MS[32]#64742L, MS[33]#64743L, MS[34]#64744L, MS[35]#64745L, MS[36]#64746L, MS[37]#64747L, MS[38]#64748L, MS[39]#64749L, MS[40]#64750L, MS[41]#64751L, MS[42]#64752L, MS[43]#64753L, MS[44]#64754L, MS[45]#64755L, MS[46]#64756L, MS[47]#64757L, MS[48]#64758L, MS[49]#64759L, MS[50]#64760L, MS[51]#64761L, sum#64876L, sum#64877, sum#64878, count#64879L]
(5) Exchange
Input [59]: [segment#64643, processing_day#64645, count#64875L, MS[0]#64710L, MS[1]#64711L, MS[2]#64712L, MS[3]#64713L, MS[4]#64714L, MS[5]#64715L, MS[6]#64716L, MS[7]#64717L, MS[8]#64718L, MS[9]#64719L, MS[10]#64720L, MS[11]#64721L, MS[12]#64722L, MS[13]#64723L, MS[14]#64724L, MS[15]#64725L, MS[16]#64726L, MS[17]#64727L, MS[18]#64728L, MS[19]#64729L, MS[20]#64730L, MS[21]#64731L, MS[22]#64732L, MS[23]#64733L, MS[24]#64734L, MS[25]#64735L, MS[26]#64736L, MS[27]#64737L, MS[28]#64738L, MS[29]#64739L, MS[30]#64740L, MS[31]#64741L, MS[32]#64742L, MS[33]#64743L, MS[34]#64744L, MS[35]#64745L, MS[36]#64746L, MS[37]#64747L, MS[38]#64748L, MS[39]#64749L, MS[40]#64750L, MS[41]#64751L, MS[42]#64752L, MS[43]#64753L, MS[44]#64754L, MS[45]#64755L, MS[46]#64756L, MS[47]#64757L, MS[48]#64758L, MS[49]#64759L, MS[50]#64760L, MS[51]#64761L, sum#64876L, sum#64877, sum#64878, count#64879L]
Arguments: hashpartitioning(segment#64643, processing_day#64645, 200), ENSURE_REQUIREMENTS, [plan_id=6120]
(6) ShuffleQueryStage
Output [59]: [segment#64643, processing_day#64645, count#64875L, MS[0]#64710L, MS[1]#64711L, MS[2]#64712L, MS[3]#64713L, MS[4]#64714L, MS[5]#64715L, MS[6]#64716L, MS[7]#64717L, MS[8]#64718L, MS[9]#64719L, MS[10]#64720L, MS[11]#64721L, MS[12]#64722L, MS[13]#64723L, MS[14]#64724L, MS[15]#64725L, MS[16]#64726L, MS[17]#64727L, MS[18]#64728L, MS[19]#64729L, MS[20]#64730L, MS[21]#64731L, MS[22]#64732L, MS[23]#64733L, MS[24]#64734L, MS[25]#64735L, MS[26]#64736L, MS[27]#64737L, MS[28]#64738L, MS[29]#64739L, MS[30]#64740L, MS[31]#64741L, MS[32]#64742L, MS[33]#64743L, MS[34]#64744L, MS[35]#64745L, MS[36]#64746L, MS[37]#64747L, MS[38]#64748L, MS[39]#64749L, MS[40]#64750L, MS[41]#64751L, MS[42]#64752L, MS[43]#64753L, MS[44]#64754L, MS[45]#64755L, MS[46]#64756L, MS[47]#64757L, MS[48]#64758L, MS[49]#64759L, MS[50]#64760L, MS[51]#64761L, sum#64876L, sum#64877, sum#64878, count#64879L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#64643, processing_day#64645, count#64875L, MS[0]#64710L, MS[1]#64711L, MS[2]#64712L, MS[3]#64713L, MS[4]#64714L, MS[5]#64715L, MS[6]#64716L, MS[7]#64717L, MS[8]#64718L, MS[9]#64719L, MS[10]#64720L, MS[11]#64721L, MS[12]#64722L, MS[13]#64723L, MS[14]#64724L, MS[15]#64725L, MS[16]#64726L, MS[17]#64727L, MS[18]#64728L, MS[19]#64729L, MS[20]#64730L, MS[21]#64731L, MS[22]#64732L, MS[23]#64733L, MS[24]#64734L, MS[25]#64735L, MS[26]#64736L, MS[27]#64737L, MS[28]#64738L, MS[29]#64739L, MS[30]#64740L, MS[31]#64741L, MS[32]#64742L, MS[33]#64743L, MS[34]#64744L, MS[35]#64745L, MS[36]#64746L, MS[37]#64747L, MS[38]#64748L, MS[39]#64749L, MS[40]#64750L, MS[41]#64751L, MS[42]#64752L, MS[43]#64753L, MS[44]#64754L, MS[45]#64755L, MS[46]#64756L, MS[47]#64757L, MS[48]#64758L, MS[49]#64759L, MS[50]#64760L, MS[51]#64761L, sum#64876L, sum#64877, sum#64878, count#64879L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#64643, processing_day#64645, count#64875L, MS[0]#64710L, MS[1]#64711L, MS[2]#64712L, MS[3]#64713L, MS[4]#64714L, MS[5]#64715L, MS[6]#64716L, MS[7]#64717L, MS[8]#64718L, MS[9]#64719L, MS[10]#64720L, MS[11]#64721L, MS[12]#64722L, MS[13]#64723L, MS[14]#64724L, MS[15]#64725L, MS[16]#64726L, MS[17]#64727L, MS[18]#64728L, MS[19]#64729L, MS[20]#64730L, MS[21]#64731L, MS[22]#64732L, MS[23]#64733L, MS[24]#64734L, MS[25]#64735L, MS[26]#64736L, MS[27]#64737L, MS[28]#64738L, MS[29]#64739L, MS[30]#64740L, MS[31]#64741L, MS[32]#64742L, MS[33]#64743L, MS[34]#64744L, MS[35]#64745L, MS[36]#64746L, MS[37]#64747L, MS[38]#64748L, MS[39]#64749L, MS[40]#64750L, MS[41]#64751L, MS[42]#64752L, MS[43]#64753L, MS[44]#64754L, MS[45]#64755L, MS[46]#64756L, MS[47]#64757L, MS[48]#64758L, MS[49]#64759L, MS[50]#64760L, MS[51]#64761L, sum#64876L, sum#64877, sum#64878, count#64879L]
Keys [2]: [segment#64643, processing_day#64645]
Functions [5]: [count(1), approx_count_distinct(customer_id#64639L, 0.05, 0, 0), sum(events#64649), sum(weighted_amount#64651), avg(amount#64647)]
Aggregate Attributes [5]: [count(1)#64657L, approx_count_distinct(customer_id#64639L, 0.05, 0, 0)#64762L, sum(events#64649)#64763L, sum(weighted_amount#64651)#64764, avg(amount#64647)#64765]
Results [7]: [segment#64643, processing_day#64645, count(1)#64657L AS row_count#64652L, approx_count_distinct(customer_id#64639L, 0.05, 0, 0)#64762L AS unique_customers#64653L, sum(events#64649)#64763L AS event_sum#64654L, sum(weighted_amount#64651)#64764 AS weighted_amount_sum#64655, avg(amount#64647)#64765 AS avg_amount#64656]
(9) Exchange
Input [7]: [segment#64643, processing_day#64645, row_count#64652L, unique_customers#64653L, event_sum#64654L, weighted_amount_sum#64655, avg_amount#64656]
Arguments: rangepartitioning(segment#64643 ASC NULLS FIRST, processing_day#64645 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=6142]
(10) ShuffleQueryStage
Output [7]: [segment#64643, processing_day#64645, row_count#64652L, unique_customers#64653L, event_sum#64654L, weighted_amount_sum#64655, avg_amount#64656]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#64643, processing_day#64645, row_count#64652L, unique_customers#64653L, event_sum#64654L, weighted_amount_sum#64655, avg_amount#64656]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#64643, processing_day#64645, row_count#64652L, unique_customers#64653L, event_sum#64654L, weighted_amount_sum#64655, avg_amount#64656]
Arguments: [segment#64643 ASC NULLS FIRST, processing_day#64645 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#64643, processing_day#64645, row_count#64652L, unique_customers#64653L, event_sum#64654L, weighted_amount_sum#64655, avg_amount#64656]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#64639L, segment#64643, processing_day#64645, amount#64647, events#64649, weighted_amount#64651]
Keys [2]: [segment#64643, processing_day#64645]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#64639L, 0.05, 0, 0), partial_sum(events#64649), partial_sum(weighted_amount#64651), partial_avg(amount#64647)]
Aggregate Attributes [57]: [count#64870L, MS[0]#64658L, MS[1]#64659L, MS[2]#64660L, MS[3]#64661L, MS[4]#64662L, MS[5]#64663L, MS[6]#64664L, MS[7]#64665L, MS[8]#64666L, MS[9]#64667L, MS[10]#64668L, MS[11]#64669L, MS[12]#64670L, MS[13]#64671L, MS[14]#64672L, MS[15]#64673L, MS[16]#64674L, MS[17]#64675L, MS[18]#64676L, MS[19]#64677L, MS[20]#64678L, MS[21]#64679L, MS[22]#64680L, MS[23]#64681L, MS[24]#64682L, MS[25]#64683L, MS[26]#64684L, MS[27]#64685L, MS[28]#64686L, MS[29]#64687L, MS[30]#64688L, MS[31]#64689L, MS[32]#64690L, MS[33]#64691L, MS[34]#64692L, MS[35]#64693L, MS[36]#64694L, MS[37]#64695L, MS[38]#64696L, MS[39]#64697L, MS[40]#64698L, MS[41]#64699L, MS[42]#64700L, MS[43]#64701L, MS[44]#64702L, MS[45]#64703L, MS[46]#64704L, MS[47]#64705L, MS[48]#64706L, MS[49]#64707L, MS[50]#64708L, MS[51]#64709L, sum#64871L, sum#64872, sum#64873, count#64874L]
Results [59]: [segment#64643, processing_day#64645, count#64875L, MS[0]#64710L, MS[1]#64711L, MS[2]#64712L, MS[3]#64713L, MS[4]#64714L, MS[5]#64715L, MS[6]#64716L, MS[7]#64717L, MS[8]#64718L, MS[9]#64719L, MS[10]#64720L, MS[11]#64721L, MS[12]#64722L, MS[13]#64723L, MS[14]#64724L, MS[15]#64725L, MS[16]#64726L, MS[17]#64727L, MS[18]#64728L, MS[19]#64729L, MS[20]#64730L, MS[21]#64731L, MS[22]#64732L, MS[23]#64733L, MS[24]#64734L, MS[25]#64735L, MS[26]#64736L, MS[27]#64737L, MS[28]#64738L, MS[29]#64739L, MS[30]#64740L, MS[31]#64741L, MS[32]#64742L, MS[33]#64743L, MS[34]#64744L, MS[35]#64745L, MS[36]#64746L, MS[37]#64747L, MS[38]#64748L, MS[39]#64749L, MS[40]#64750L, MS[41]#64751L, MS[42]#64752L, MS[43]#64753L, MS[44]#64754L, MS[45]#64755L, MS[46]#64756L, MS[47]#64757L, MS[48]#64758L, MS[49]#64759L, MS[50]#64760L, MS[51]#64761L, sum#64876L, sum#64877, sum#64878, count#64879L]
(15) Exchange
Input [59]: [segment#64643, processing_day#64645, count#64875L, MS[0]#64710L, MS[1]#64711L, MS[2]#64712L, MS[3]#64713L, MS[4]#64714L, MS[5]#64715L, MS[6]#64716L, MS[7]#64717L, MS[8]#64718L, MS[9]#64719L, MS[10]#64720L, MS[11]#64721L, MS[12]#64722L, MS[13]#64723L, MS[14]#64724L, MS[15]#64725L, MS[16]#64726L, MS[17]#64727L, MS[18]#64728L, MS[19]#64729L, MS[20]#64730L, MS[21]#64731L, MS[22]#64732L, MS[23]#64733L, MS[24]#64734L, MS[25]#64735L, MS[26]#64736L, MS[27]#64737L, MS[28]#64738L, MS[29]#64739L, MS[30]#64740L, MS[31]#64741L, MS[32]#64742L, MS[33]#64743L, MS[34]#64744L, MS[35]#64745L, MS[36]#64746L, MS[37]#64747L, MS[38]#64748L, MS[39]#64749L, MS[40]#64750L, MS[41]#64751L, MS[42]#64752L, MS[43]#64753L, MS[44]#64754L, MS[45]#64755L, MS[46]#64756L, MS[47]#64757L, MS[48]#64758L, MS[49]#64759L, MS[50]#64760L, MS[51]#64761L, sum#64876L, sum#64877, sum#64878, count#64879L]
Arguments: hashpartitioning(segment#64643, processing_day#64645, 200), ENSURE_REQUIREMENTS, [plan_id=6100]
(16) HashAggregate
Input [59]: [segment#64643, processing_day#64645, count#64875L, MS[0]#64710L, MS[1]#64711L, MS[2]#64712L, MS[3]#64713L, MS[4]#64714L, MS[5]#64715L, MS[6]#64716L, MS[7]#64717L, MS[8]#64718L, MS[9]#64719L, MS[10]#64720L, MS[11]#64721L, MS[12]#64722L, MS[13]#64723L, MS[14]#64724L, MS[15]#64725L, MS[16]#64726L, MS[17]#64727L, MS[18]#64728L, MS[19]#64729L, MS[20]#64730L, MS[21]#64731L, MS[22]#64732L, MS[23]#64733L, MS[24]#64734L, MS[25]#64735L, MS[26]#64736L, MS[27]#64737L, MS[28]#64738L, MS[29]#64739L, MS[30]#64740L, MS[31]#64741L, MS[32]#64742L, MS[33]#64743L, MS[34]#64744L, MS[35]#64745L, MS[36]#64746L, MS[37]#64747L, MS[38]#64748L, MS[39]#64749L, MS[40]#64750L, MS[41]#64751L, MS[42]#64752L, MS[43]#64753L, MS[44]#64754L, MS[45]#64755L, MS[46]#64756L, MS[47]#64757L, MS[48]#64758L, MS[49]#64759L, MS[50]#64760L, MS[51]#64761L, sum#64876L, sum#64877, sum#64878, count#64879L]
Keys [2]: [segment#64643, processing_day#64645]
Functions [5]: [count(1), approx_count_distinct(customer_id#64639L, 0.05, 0, 0), sum(events#64649), sum(weighted_amount#64651), avg(amount#64647)]
Aggregate Attributes [5]: [count(1)#64657L, approx_count_distinct(customer_id#64639L, 0.05, 0, 0)#64762L, sum(events#64649)#64763L, sum(weighted_amount#64651)#64764, avg(amount#64647)#64765]
Results [7]: [segment#64643, processing_day#64645, count(1)#64657L AS row_count#64652L, approx_count_distinct(customer_id#64639L, 0.05, 0, 0)#64762L AS unique_customers#64653L, sum(events#64649)#64763L AS event_sum#64654L, sum(weighted_amount#64651)#64764 AS weighted_amount_sum#64655, avg(amount#64647)#64765 AS avg_amount#64656]
(17) Exchange
Input [7]: [segment#64643, processing_day#64645, row_count#64652L, unique_customers#64653L, event_sum#64654L, weighted_amount_sum#64655, avg_amount#64656]
Arguments: rangepartitioning(segment#64643 ASC NULLS FIRST, processing_day#64645 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=6103]
(18) Sort
Input [7]: [segment#64643, processing_day#64645, row_count#64652L, unique_customers#64653L, event_sum#64654L, weighted_amount_sum#64655, avg_amount#64656]
Arguments: [segment#64643 ASC NULLS FIRST, processing_day#64645 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#64643, processing_day#64645, row_count#64652L, unique_customers#64653L, event_sum#64654L, weighted_amount_sum#64655, avg_amount#64656]
Arguments: isFinalPlan=true