== 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#88539L]
Arguments: Range (4000000, 5000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#88539L % 250000) AS customer_id#88541L, concat(segment-, cast(cast((id#88539L % 12) as int) as string)) AS segment#88545, cast((id#88539L % 14) as int) AS processing_day#88547, ((cast(((id#88539L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#88549, cast((((id#88539L * 29) % 7) + 1) as int) AS events#88551]
Input [1]: [id#88539L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#88541L, segment#88545, processing_day#88547, amount#88549, events#88551, (amount#88549 * cast(events#88551 as double)) AS weighted_amount#88553]
Input [5]: [customer_id#88541L, segment#88545, processing_day#88547, amount#88549, events#88551]
(4) HashAggregate
Input [6]: [customer_id#88541L, segment#88545, processing_day#88547, amount#88549, events#88551, weighted_amount#88553]
Keys [2]: [segment#88545, processing_day#88547]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#88541L, 0.05, 0, 0), partial_sum(events#88551), partial_sum(weighted_amount#88553), partial_avg(amount#88549)]
Aggregate Attributes [57]: [count#88772L, MS[0]#88560L, MS[1]#88561L, MS[2]#88562L, MS[3]#88563L, MS[4]#88564L, MS[5]#88565L, MS[6]#88566L, MS[7]#88567L, MS[8]#88568L, MS[9]#88569L, MS[10]#88570L, MS[11]#88571L, MS[12]#88572L, MS[13]#88573L, MS[14]#88574L, MS[15]#88575L, MS[16]#88576L, MS[17]#88577L, MS[18]#88578L, MS[19]#88579L, MS[20]#88580L, MS[21]#88581L, MS[22]#88582L, MS[23]#88583L, MS[24]#88584L, MS[25]#88585L, MS[26]#88586L, MS[27]#88587L, MS[28]#88588L, MS[29]#88589L, MS[30]#88590L, MS[31]#88591L, MS[32]#88592L, MS[33]#88593L, MS[34]#88594L, MS[35]#88595L, MS[36]#88596L, MS[37]#88597L, MS[38]#88598L, MS[39]#88599L, MS[40]#88600L, MS[41]#88601L, MS[42]#88602L, MS[43]#88603L, MS[44]#88604L, MS[45]#88605L, MS[46]#88606L, MS[47]#88607L, MS[48]#88608L, MS[49]#88609L, MS[50]#88610L, MS[51]#88611L, sum#88773L, sum#88774, sum#88775, count#88776L]
Results [59]: [segment#88545, processing_day#88547, count#88777L, MS[0]#88612L, MS[1]#88613L, MS[2]#88614L, MS[3]#88615L, MS[4]#88616L, MS[5]#88617L, MS[6]#88618L, MS[7]#88619L, MS[8]#88620L, MS[9]#88621L, MS[10]#88622L, MS[11]#88623L, MS[12]#88624L, MS[13]#88625L, MS[14]#88626L, MS[15]#88627L, MS[16]#88628L, MS[17]#88629L, MS[18]#88630L, MS[19]#88631L, MS[20]#88632L, MS[21]#88633L, MS[22]#88634L, MS[23]#88635L, MS[24]#88636L, MS[25]#88637L, MS[26]#88638L, MS[27]#88639L, MS[28]#88640L, MS[29]#88641L, MS[30]#88642L, MS[31]#88643L, MS[32]#88644L, MS[33]#88645L, MS[34]#88646L, MS[35]#88647L, MS[36]#88648L, MS[37]#88649L, MS[38]#88650L, MS[39]#88651L, MS[40]#88652L, MS[41]#88653L, MS[42]#88654L, MS[43]#88655L, MS[44]#88656L, MS[45]#88657L, MS[46]#88658L, MS[47]#88659L, MS[48]#88660L, MS[49]#88661L, MS[50]#88662L, MS[51]#88663L, sum#88778L, sum#88779, sum#88780, count#88781L]
(5) Exchange
Input [59]: [segment#88545, processing_day#88547, count#88777L, MS[0]#88612L, MS[1]#88613L, MS[2]#88614L, MS[3]#88615L, MS[4]#88616L, MS[5]#88617L, MS[6]#88618L, MS[7]#88619L, MS[8]#88620L, MS[9]#88621L, MS[10]#88622L, MS[11]#88623L, MS[12]#88624L, MS[13]#88625L, MS[14]#88626L, MS[15]#88627L, MS[16]#88628L, MS[17]#88629L, MS[18]#88630L, MS[19]#88631L, MS[20]#88632L, MS[21]#88633L, MS[22]#88634L, MS[23]#88635L, MS[24]#88636L, MS[25]#88637L, MS[26]#88638L, MS[27]#88639L, MS[28]#88640L, MS[29]#88641L, MS[30]#88642L, MS[31]#88643L, MS[32]#88644L, MS[33]#88645L, MS[34]#88646L, MS[35]#88647L, MS[36]#88648L, MS[37]#88649L, MS[38]#88650L, MS[39]#88651L, MS[40]#88652L, MS[41]#88653L, MS[42]#88654L, MS[43]#88655L, MS[44]#88656L, MS[45]#88657L, MS[46]#88658L, MS[47]#88659L, MS[48]#88660L, MS[49]#88661L, MS[50]#88662L, MS[51]#88663L, sum#88778L, sum#88779, sum#88780, count#88781L]
Arguments: hashpartitioning(segment#88545, processing_day#88547, 200), ENSURE_REQUIREMENTS, [plan_id=8367]
(6) ShuffleQueryStage
Output [59]: [segment#88545, processing_day#88547, count#88777L, MS[0]#88612L, MS[1]#88613L, MS[2]#88614L, MS[3]#88615L, MS[4]#88616L, MS[5]#88617L, MS[6]#88618L, MS[7]#88619L, MS[8]#88620L, MS[9]#88621L, MS[10]#88622L, MS[11]#88623L, MS[12]#88624L, MS[13]#88625L, MS[14]#88626L, MS[15]#88627L, MS[16]#88628L, MS[17]#88629L, MS[18]#88630L, MS[19]#88631L, MS[20]#88632L, MS[21]#88633L, MS[22]#88634L, MS[23]#88635L, MS[24]#88636L, MS[25]#88637L, MS[26]#88638L, MS[27]#88639L, MS[28]#88640L, MS[29]#88641L, MS[30]#88642L, MS[31]#88643L, MS[32]#88644L, MS[33]#88645L, MS[34]#88646L, MS[35]#88647L, MS[36]#88648L, MS[37]#88649L, MS[38]#88650L, MS[39]#88651L, MS[40]#88652L, MS[41]#88653L, MS[42]#88654L, MS[43]#88655L, MS[44]#88656L, MS[45]#88657L, MS[46]#88658L, MS[47]#88659L, MS[48]#88660L, MS[49]#88661L, MS[50]#88662L, MS[51]#88663L, sum#88778L, sum#88779, sum#88780, count#88781L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#88545, processing_day#88547, count#88777L, MS[0]#88612L, MS[1]#88613L, MS[2]#88614L, MS[3]#88615L, MS[4]#88616L, MS[5]#88617L, MS[6]#88618L, MS[7]#88619L, MS[8]#88620L, MS[9]#88621L, MS[10]#88622L, MS[11]#88623L, MS[12]#88624L, MS[13]#88625L, MS[14]#88626L, MS[15]#88627L, MS[16]#88628L, MS[17]#88629L, MS[18]#88630L, MS[19]#88631L, MS[20]#88632L, MS[21]#88633L, MS[22]#88634L, MS[23]#88635L, MS[24]#88636L, MS[25]#88637L, MS[26]#88638L, MS[27]#88639L, MS[28]#88640L, MS[29]#88641L, MS[30]#88642L, MS[31]#88643L, MS[32]#88644L, MS[33]#88645L, MS[34]#88646L, MS[35]#88647L, MS[36]#88648L, MS[37]#88649L, MS[38]#88650L, MS[39]#88651L, MS[40]#88652L, MS[41]#88653L, MS[42]#88654L, MS[43]#88655L, MS[44]#88656L, MS[45]#88657L, MS[46]#88658L, MS[47]#88659L, MS[48]#88660L, MS[49]#88661L, MS[50]#88662L, MS[51]#88663L, sum#88778L, sum#88779, sum#88780, count#88781L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#88545, processing_day#88547, count#88777L, MS[0]#88612L, MS[1]#88613L, MS[2]#88614L, MS[3]#88615L, MS[4]#88616L, MS[5]#88617L, MS[6]#88618L, MS[7]#88619L, MS[8]#88620L, MS[9]#88621L, MS[10]#88622L, MS[11]#88623L, MS[12]#88624L, MS[13]#88625L, MS[14]#88626L, MS[15]#88627L, MS[16]#88628L, MS[17]#88629L, MS[18]#88630L, MS[19]#88631L, MS[20]#88632L, MS[21]#88633L, MS[22]#88634L, MS[23]#88635L, MS[24]#88636L, MS[25]#88637L, MS[26]#88638L, MS[27]#88639L, MS[28]#88640L, MS[29]#88641L, MS[30]#88642L, MS[31]#88643L, MS[32]#88644L, MS[33]#88645L, MS[34]#88646L, MS[35]#88647L, MS[36]#88648L, MS[37]#88649L, MS[38]#88650L, MS[39]#88651L, MS[40]#88652L, MS[41]#88653L, MS[42]#88654L, MS[43]#88655L, MS[44]#88656L, MS[45]#88657L, MS[46]#88658L, MS[47]#88659L, MS[48]#88660L, MS[49]#88661L, MS[50]#88662L, MS[51]#88663L, sum#88778L, sum#88779, sum#88780, count#88781L]
Keys [2]: [segment#88545, processing_day#88547]
Functions [5]: [count(1), approx_count_distinct(customer_id#88541L, 0.05, 0, 0), sum(events#88551), sum(weighted_amount#88553), avg(amount#88549)]
Aggregate Attributes [5]: [count(1)#88559L, approx_count_distinct(customer_id#88541L, 0.05, 0, 0)#88664L, sum(events#88551)#88665L, sum(weighted_amount#88553)#88666, avg(amount#88549)#88667]
Results [7]: [segment#88545, processing_day#88547, count(1)#88559L AS row_count#88554L, approx_count_distinct(customer_id#88541L, 0.05, 0, 0)#88664L AS unique_customers#88555L, sum(events#88551)#88665L AS event_sum#88556L, sum(weighted_amount#88553)#88666 AS weighted_amount_sum#88557, avg(amount#88549)#88667 AS avg_amount#88558]
(9) Exchange
Input [7]: [segment#88545, processing_day#88547, row_count#88554L, unique_customers#88555L, event_sum#88556L, weighted_amount_sum#88557, avg_amount#88558]
Arguments: rangepartitioning(segment#88545 ASC NULLS FIRST, processing_day#88547 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8389]
(10) ShuffleQueryStage
Output [7]: [segment#88545, processing_day#88547, row_count#88554L, unique_customers#88555L, event_sum#88556L, weighted_amount_sum#88557, avg_amount#88558]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#88545, processing_day#88547, row_count#88554L, unique_customers#88555L, event_sum#88556L, weighted_amount_sum#88557, avg_amount#88558]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#88545, processing_day#88547, row_count#88554L, unique_customers#88555L, event_sum#88556L, weighted_amount_sum#88557, avg_amount#88558]
Arguments: [segment#88545 ASC NULLS FIRST, processing_day#88547 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#88545, processing_day#88547, row_count#88554L, unique_customers#88555L, event_sum#88556L, weighted_amount_sum#88557, avg_amount#88558]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#88541L, segment#88545, processing_day#88547, amount#88549, events#88551, weighted_amount#88553]
Keys [2]: [segment#88545, processing_day#88547]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#88541L, 0.05, 0, 0), partial_sum(events#88551), partial_sum(weighted_amount#88553), partial_avg(amount#88549)]
Aggregate Attributes [57]: [count#88772L, MS[0]#88560L, MS[1]#88561L, MS[2]#88562L, MS[3]#88563L, MS[4]#88564L, MS[5]#88565L, MS[6]#88566L, MS[7]#88567L, MS[8]#88568L, MS[9]#88569L, MS[10]#88570L, MS[11]#88571L, MS[12]#88572L, MS[13]#88573L, MS[14]#88574L, MS[15]#88575L, MS[16]#88576L, MS[17]#88577L, MS[18]#88578L, MS[19]#88579L, MS[20]#88580L, MS[21]#88581L, MS[22]#88582L, MS[23]#88583L, MS[24]#88584L, MS[25]#88585L, MS[26]#88586L, MS[27]#88587L, MS[28]#88588L, MS[29]#88589L, MS[30]#88590L, MS[31]#88591L, MS[32]#88592L, MS[33]#88593L, MS[34]#88594L, MS[35]#88595L, MS[36]#88596L, MS[37]#88597L, MS[38]#88598L, MS[39]#88599L, MS[40]#88600L, MS[41]#88601L, MS[42]#88602L, MS[43]#88603L, MS[44]#88604L, MS[45]#88605L, MS[46]#88606L, MS[47]#88607L, MS[48]#88608L, MS[49]#88609L, MS[50]#88610L, MS[51]#88611L, sum#88773L, sum#88774, sum#88775, count#88776L]
Results [59]: [segment#88545, processing_day#88547, count#88777L, MS[0]#88612L, MS[1]#88613L, MS[2]#88614L, MS[3]#88615L, MS[4]#88616L, MS[5]#88617L, MS[6]#88618L, MS[7]#88619L, MS[8]#88620L, MS[9]#88621L, MS[10]#88622L, MS[11]#88623L, MS[12]#88624L, MS[13]#88625L, MS[14]#88626L, MS[15]#88627L, MS[16]#88628L, MS[17]#88629L, MS[18]#88630L, MS[19]#88631L, MS[20]#88632L, MS[21]#88633L, MS[22]#88634L, MS[23]#88635L, MS[24]#88636L, MS[25]#88637L, MS[26]#88638L, MS[27]#88639L, MS[28]#88640L, MS[29]#88641L, MS[30]#88642L, MS[31]#88643L, MS[32]#88644L, MS[33]#88645L, MS[34]#88646L, MS[35]#88647L, MS[36]#88648L, MS[37]#88649L, MS[38]#88650L, MS[39]#88651L, MS[40]#88652L, MS[41]#88653L, MS[42]#88654L, MS[43]#88655L, MS[44]#88656L, MS[45]#88657L, MS[46]#88658L, MS[47]#88659L, MS[48]#88660L, MS[49]#88661L, MS[50]#88662L, MS[51]#88663L, sum#88778L, sum#88779, sum#88780, count#88781L]
(15) Exchange
Input [59]: [segment#88545, processing_day#88547, count#88777L, MS[0]#88612L, MS[1]#88613L, MS[2]#88614L, MS[3]#88615L, MS[4]#88616L, MS[5]#88617L, MS[6]#88618L, MS[7]#88619L, MS[8]#88620L, MS[9]#88621L, MS[10]#88622L, MS[11]#88623L, MS[12]#88624L, MS[13]#88625L, MS[14]#88626L, MS[15]#88627L, MS[16]#88628L, MS[17]#88629L, MS[18]#88630L, MS[19]#88631L, MS[20]#88632L, MS[21]#88633L, MS[22]#88634L, MS[23]#88635L, MS[24]#88636L, MS[25]#88637L, MS[26]#88638L, MS[27]#88639L, MS[28]#88640L, MS[29]#88641L, MS[30]#88642L, MS[31]#88643L, MS[32]#88644L, MS[33]#88645L, MS[34]#88646L, MS[35]#88647L, MS[36]#88648L, MS[37]#88649L, MS[38]#88650L, MS[39]#88651L, MS[40]#88652L, MS[41]#88653L, MS[42]#88654L, MS[43]#88655L, MS[44]#88656L, MS[45]#88657L, MS[46]#88658L, MS[47]#88659L, MS[48]#88660L, MS[49]#88661L, MS[50]#88662L, MS[51]#88663L, sum#88778L, sum#88779, sum#88780, count#88781L]
Arguments: hashpartitioning(segment#88545, processing_day#88547, 200), ENSURE_REQUIREMENTS, [plan_id=8347]
(16) HashAggregate
Input [59]: [segment#88545, processing_day#88547, count#88777L, MS[0]#88612L, MS[1]#88613L, MS[2]#88614L, MS[3]#88615L, MS[4]#88616L, MS[5]#88617L, MS[6]#88618L, MS[7]#88619L, MS[8]#88620L, MS[9]#88621L, MS[10]#88622L, MS[11]#88623L, MS[12]#88624L, MS[13]#88625L, MS[14]#88626L, MS[15]#88627L, MS[16]#88628L, MS[17]#88629L, MS[18]#88630L, MS[19]#88631L, MS[20]#88632L, MS[21]#88633L, MS[22]#88634L, MS[23]#88635L, MS[24]#88636L, MS[25]#88637L, MS[26]#88638L, MS[27]#88639L, MS[28]#88640L, MS[29]#88641L, MS[30]#88642L, MS[31]#88643L, MS[32]#88644L, MS[33]#88645L, MS[34]#88646L, MS[35]#88647L, MS[36]#88648L, MS[37]#88649L, MS[38]#88650L, MS[39]#88651L, MS[40]#88652L, MS[41]#88653L, MS[42]#88654L, MS[43]#88655L, MS[44]#88656L, MS[45]#88657L, MS[46]#88658L, MS[47]#88659L, MS[48]#88660L, MS[49]#88661L, MS[50]#88662L, MS[51]#88663L, sum#88778L, sum#88779, sum#88780, count#88781L]
Keys [2]: [segment#88545, processing_day#88547]
Functions [5]: [count(1), approx_count_distinct(customer_id#88541L, 0.05, 0, 0), sum(events#88551), sum(weighted_amount#88553), avg(amount#88549)]
Aggregate Attributes [5]: [count(1)#88559L, approx_count_distinct(customer_id#88541L, 0.05, 0, 0)#88664L, sum(events#88551)#88665L, sum(weighted_amount#88553)#88666, avg(amount#88549)#88667]
Results [7]: [segment#88545, processing_day#88547, count(1)#88559L AS row_count#88554L, approx_count_distinct(customer_id#88541L, 0.05, 0, 0)#88664L AS unique_customers#88555L, sum(events#88551)#88665L AS event_sum#88556L, sum(weighted_amount#88553)#88666 AS weighted_amount_sum#88557, avg(amount#88549)#88667 AS avg_amount#88558]
(17) Exchange
Input [7]: [segment#88545, processing_day#88547, row_count#88554L, unique_customers#88555L, event_sum#88556L, weighted_amount_sum#88557, avg_amount#88558]
Arguments: rangepartitioning(segment#88545 ASC NULLS FIRST, processing_day#88547 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8350]
(18) Sort
Input [7]: [segment#88545, processing_day#88547, row_count#88554L, unique_customers#88555L, event_sum#88556L, weighted_amount_sum#88557, avg_amount#88558]
Arguments: [segment#88545 ASC NULLS FIRST, processing_day#88547 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#88545, processing_day#88547, row_count#88554L, unique_customers#88555L, event_sum#88556L, weighted_amount_sum#88557, avg_amount#88558]
Arguments: isFinalPlan=true