== 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#18565L]
Arguments: Range (21000000, 22000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#18565L % 250000) AS customer_id#18567L, concat(segment-, cast(cast((id#18565L % 12) as int) as string)) AS segment#18571, cast((id#18565L % 14) as int) AS processing_day#18573, ((cast(((id#18565L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#18575, cast((((id#18565L * 29) % 7) + 1) as int) AS events#18577]
Input [1]: [id#18565L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#18567L, segment#18571, processing_day#18573, amount#18575, events#18577, (amount#18575 * cast(events#18577 as double)) AS weighted_amount#18579]
Input [5]: [customer_id#18567L, segment#18571, processing_day#18573, amount#18575, events#18577]
(4) HashAggregate
Input [6]: [customer_id#18567L, segment#18571, processing_day#18573, amount#18575, events#18577, weighted_amount#18579]
Keys [2]: [segment#18571, processing_day#18573]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#18567L, 0.05, 0, 0), partial_sum(events#18577), partial_sum(weighted_amount#18579), partial_avg(amount#18575)]
Aggregate Attributes [57]: [count#18798L, MS[0]#18586L, MS[1]#18587L, MS[2]#18588L, MS[3]#18589L, MS[4]#18590L, MS[5]#18591L, MS[6]#18592L, MS[7]#18593L, MS[8]#18594L, MS[9]#18595L, MS[10]#18596L, MS[11]#18597L, MS[12]#18598L, MS[13]#18599L, MS[14]#18600L, MS[15]#18601L, MS[16]#18602L, MS[17]#18603L, MS[18]#18604L, MS[19]#18605L, MS[20]#18606L, MS[21]#18607L, MS[22]#18608L, MS[23]#18609L, MS[24]#18610L, MS[25]#18611L, MS[26]#18612L, MS[27]#18613L, MS[28]#18614L, MS[29]#18615L, MS[30]#18616L, MS[31]#18617L, MS[32]#18618L, MS[33]#18619L, MS[34]#18620L, MS[35]#18621L, MS[36]#18622L, MS[37]#18623L, MS[38]#18624L, MS[39]#18625L, MS[40]#18626L, MS[41]#18627L, MS[42]#18628L, MS[43]#18629L, MS[44]#18630L, MS[45]#18631L, MS[46]#18632L, MS[47]#18633L, MS[48]#18634L, MS[49]#18635L, MS[50]#18636L, MS[51]#18637L, sum#18799L, sum#18800, sum#18801, count#18802L]
Results [59]: [segment#18571, processing_day#18573, count#18803L, MS[0]#18638L, MS[1]#18639L, MS[2]#18640L, MS[3]#18641L, MS[4]#18642L, MS[5]#18643L, MS[6]#18644L, MS[7]#18645L, MS[8]#18646L, MS[9]#18647L, MS[10]#18648L, MS[11]#18649L, MS[12]#18650L, MS[13]#18651L, MS[14]#18652L, MS[15]#18653L, MS[16]#18654L, MS[17]#18655L, MS[18]#18656L, MS[19]#18657L, MS[20]#18658L, MS[21]#18659L, MS[22]#18660L, MS[23]#18661L, MS[24]#18662L, MS[25]#18663L, MS[26]#18664L, MS[27]#18665L, MS[28]#18666L, MS[29]#18667L, MS[30]#18668L, MS[31]#18669L, MS[32]#18670L, MS[33]#18671L, MS[34]#18672L, MS[35]#18673L, MS[36]#18674L, MS[37]#18675L, MS[38]#18676L, MS[39]#18677L, MS[40]#18678L, MS[41]#18679L, MS[42]#18680L, MS[43]#18681L, MS[44]#18682L, MS[45]#18683L, MS[46]#18684L, MS[47]#18685L, MS[48]#18686L, MS[49]#18687L, MS[50]#18688L, MS[51]#18689L, sum#18804L, sum#18805, sum#18806, count#18807L]
(5) Exchange
Input [59]: [segment#18571, processing_day#18573, count#18803L, MS[0]#18638L, MS[1]#18639L, MS[2]#18640L, MS[3]#18641L, MS[4]#18642L, MS[5]#18643L, MS[6]#18644L, MS[7]#18645L, MS[8]#18646L, MS[9]#18647L, MS[10]#18648L, MS[11]#18649L, MS[12]#18650L, MS[13]#18651L, MS[14]#18652L, MS[15]#18653L, MS[16]#18654L, MS[17]#18655L, MS[18]#18656L, MS[19]#18657L, MS[20]#18658L, MS[21]#18659L, MS[22]#18660L, MS[23]#18661L, MS[24]#18662L, MS[25]#18663L, MS[26]#18664L, MS[27]#18665L, MS[28]#18666L, MS[29]#18667L, MS[30]#18668L, MS[31]#18669L, MS[32]#18670L, MS[33]#18671L, MS[34]#18672L, MS[35]#18673L, MS[36]#18674L, MS[37]#18675L, MS[38]#18676L, MS[39]#18677L, MS[40]#18678L, MS[41]#18679L, MS[42]#18680L, MS[43]#18681L, MS[44]#18682L, MS[45]#18683L, MS[46]#18684L, MS[47]#18685L, MS[48]#18686L, MS[49]#18687L, MS[50]#18688L, MS[51]#18689L, sum#18804L, sum#18805, sum#18806, count#18807L]
Arguments: hashpartitioning(segment#18571, processing_day#18573, 200), ENSURE_REQUIREMENTS, [plan_id=1786]
(6) ShuffleQueryStage
Output [59]: [segment#18571, processing_day#18573, count#18803L, MS[0]#18638L, MS[1]#18639L, MS[2]#18640L, MS[3]#18641L, MS[4]#18642L, MS[5]#18643L, MS[6]#18644L, MS[7]#18645L, MS[8]#18646L, MS[9]#18647L, MS[10]#18648L, MS[11]#18649L, MS[12]#18650L, MS[13]#18651L, MS[14]#18652L, MS[15]#18653L, MS[16]#18654L, MS[17]#18655L, MS[18]#18656L, MS[19]#18657L, MS[20]#18658L, MS[21]#18659L, MS[22]#18660L, MS[23]#18661L, MS[24]#18662L, MS[25]#18663L, MS[26]#18664L, MS[27]#18665L, MS[28]#18666L, MS[29]#18667L, MS[30]#18668L, MS[31]#18669L, MS[32]#18670L, MS[33]#18671L, MS[34]#18672L, MS[35]#18673L, MS[36]#18674L, MS[37]#18675L, MS[38]#18676L, MS[39]#18677L, MS[40]#18678L, MS[41]#18679L, MS[42]#18680L, MS[43]#18681L, MS[44]#18682L, MS[45]#18683L, MS[46]#18684L, MS[47]#18685L, MS[48]#18686L, MS[49]#18687L, MS[50]#18688L, MS[51]#18689L, sum#18804L, sum#18805, sum#18806, count#18807L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#18571, processing_day#18573, count#18803L, MS[0]#18638L, MS[1]#18639L, MS[2]#18640L, MS[3]#18641L, MS[4]#18642L, MS[5]#18643L, MS[6]#18644L, MS[7]#18645L, MS[8]#18646L, MS[9]#18647L, MS[10]#18648L, MS[11]#18649L, MS[12]#18650L, MS[13]#18651L, MS[14]#18652L, MS[15]#18653L, MS[16]#18654L, MS[17]#18655L, MS[18]#18656L, MS[19]#18657L, MS[20]#18658L, MS[21]#18659L, MS[22]#18660L, MS[23]#18661L, MS[24]#18662L, MS[25]#18663L, MS[26]#18664L, MS[27]#18665L, MS[28]#18666L, MS[29]#18667L, MS[30]#18668L, MS[31]#18669L, MS[32]#18670L, MS[33]#18671L, MS[34]#18672L, MS[35]#18673L, MS[36]#18674L, MS[37]#18675L, MS[38]#18676L, MS[39]#18677L, MS[40]#18678L, MS[41]#18679L, MS[42]#18680L, MS[43]#18681L, MS[44]#18682L, MS[45]#18683L, MS[46]#18684L, MS[47]#18685L, MS[48]#18686L, MS[49]#18687L, MS[50]#18688L, MS[51]#18689L, sum#18804L, sum#18805, sum#18806, count#18807L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#18571, processing_day#18573, count#18803L, MS[0]#18638L, MS[1]#18639L, MS[2]#18640L, MS[3]#18641L, MS[4]#18642L, MS[5]#18643L, MS[6]#18644L, MS[7]#18645L, MS[8]#18646L, MS[9]#18647L, MS[10]#18648L, MS[11]#18649L, MS[12]#18650L, MS[13]#18651L, MS[14]#18652L, MS[15]#18653L, MS[16]#18654L, MS[17]#18655L, MS[18]#18656L, MS[19]#18657L, MS[20]#18658L, MS[21]#18659L, MS[22]#18660L, MS[23]#18661L, MS[24]#18662L, MS[25]#18663L, MS[26]#18664L, MS[27]#18665L, MS[28]#18666L, MS[29]#18667L, MS[30]#18668L, MS[31]#18669L, MS[32]#18670L, MS[33]#18671L, MS[34]#18672L, MS[35]#18673L, MS[36]#18674L, MS[37]#18675L, MS[38]#18676L, MS[39]#18677L, MS[40]#18678L, MS[41]#18679L, MS[42]#18680L, MS[43]#18681L, MS[44]#18682L, MS[45]#18683L, MS[46]#18684L, MS[47]#18685L, MS[48]#18686L, MS[49]#18687L, MS[50]#18688L, MS[51]#18689L, sum#18804L, sum#18805, sum#18806, count#18807L]
Keys [2]: [segment#18571, processing_day#18573]
Functions [5]: [count(1), approx_count_distinct(customer_id#18567L, 0.05, 0, 0), sum(events#18577), sum(weighted_amount#18579), avg(amount#18575)]
Aggregate Attributes [5]: [count(1)#18585L, approx_count_distinct(customer_id#18567L, 0.05, 0, 0)#18690L, sum(events#18577)#18691L, sum(weighted_amount#18579)#18692, avg(amount#18575)#18693]
Results [7]: [segment#18571, processing_day#18573, count(1)#18585L AS row_count#18580L, approx_count_distinct(customer_id#18567L, 0.05, 0, 0)#18690L AS unique_customers#18581L, sum(events#18577)#18691L AS event_sum#18582L, sum(weighted_amount#18579)#18692 AS weighted_amount_sum#18583, avg(amount#18575)#18693 AS avg_amount#18584]
(9) Exchange
Input [7]: [segment#18571, processing_day#18573, row_count#18580L, unique_customers#18581L, event_sum#18582L, weighted_amount_sum#18583, avg_amount#18584]
Arguments: rangepartitioning(segment#18571 ASC NULLS FIRST, processing_day#18573 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1808]
(10) ShuffleQueryStage
Output [7]: [segment#18571, processing_day#18573, row_count#18580L, unique_customers#18581L, event_sum#18582L, weighted_amount_sum#18583, avg_amount#18584]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#18571, processing_day#18573, row_count#18580L, unique_customers#18581L, event_sum#18582L, weighted_amount_sum#18583, avg_amount#18584]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#18571, processing_day#18573, row_count#18580L, unique_customers#18581L, event_sum#18582L, weighted_amount_sum#18583, avg_amount#18584]
Arguments: [segment#18571 ASC NULLS FIRST, processing_day#18573 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#18571, processing_day#18573, row_count#18580L, unique_customers#18581L, event_sum#18582L, weighted_amount_sum#18583, avg_amount#18584]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#18567L, segment#18571, processing_day#18573, amount#18575, events#18577, weighted_amount#18579]
Keys [2]: [segment#18571, processing_day#18573]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#18567L, 0.05, 0, 0), partial_sum(events#18577), partial_sum(weighted_amount#18579), partial_avg(amount#18575)]
Aggregate Attributes [57]: [count#18798L, MS[0]#18586L, MS[1]#18587L, MS[2]#18588L, MS[3]#18589L, MS[4]#18590L, MS[5]#18591L, MS[6]#18592L, MS[7]#18593L, MS[8]#18594L, MS[9]#18595L, MS[10]#18596L, MS[11]#18597L, MS[12]#18598L, MS[13]#18599L, MS[14]#18600L, MS[15]#18601L, MS[16]#18602L, MS[17]#18603L, MS[18]#18604L, MS[19]#18605L, MS[20]#18606L, MS[21]#18607L, MS[22]#18608L, MS[23]#18609L, MS[24]#18610L, MS[25]#18611L, MS[26]#18612L, MS[27]#18613L, MS[28]#18614L, MS[29]#18615L, MS[30]#18616L, MS[31]#18617L, MS[32]#18618L, MS[33]#18619L, MS[34]#18620L, MS[35]#18621L, MS[36]#18622L, MS[37]#18623L, MS[38]#18624L, MS[39]#18625L, MS[40]#18626L, MS[41]#18627L, MS[42]#18628L, MS[43]#18629L, MS[44]#18630L, MS[45]#18631L, MS[46]#18632L, MS[47]#18633L, MS[48]#18634L, MS[49]#18635L, MS[50]#18636L, MS[51]#18637L, sum#18799L, sum#18800, sum#18801, count#18802L]
Results [59]: [segment#18571, processing_day#18573, count#18803L, MS[0]#18638L, MS[1]#18639L, MS[2]#18640L, MS[3]#18641L, MS[4]#18642L, MS[5]#18643L, MS[6]#18644L, MS[7]#18645L, MS[8]#18646L, MS[9]#18647L, MS[10]#18648L, MS[11]#18649L, MS[12]#18650L, MS[13]#18651L, MS[14]#18652L, MS[15]#18653L, MS[16]#18654L, MS[17]#18655L, MS[18]#18656L, MS[19]#18657L, MS[20]#18658L, MS[21]#18659L, MS[22]#18660L, MS[23]#18661L, MS[24]#18662L, MS[25]#18663L, MS[26]#18664L, MS[27]#18665L, MS[28]#18666L, MS[29]#18667L, MS[30]#18668L, MS[31]#18669L, MS[32]#18670L, MS[33]#18671L, MS[34]#18672L, MS[35]#18673L, MS[36]#18674L, MS[37]#18675L, MS[38]#18676L, MS[39]#18677L, MS[40]#18678L, MS[41]#18679L, MS[42]#18680L, MS[43]#18681L, MS[44]#18682L, MS[45]#18683L, MS[46]#18684L, MS[47]#18685L, MS[48]#18686L, MS[49]#18687L, MS[50]#18688L, MS[51]#18689L, sum#18804L, sum#18805, sum#18806, count#18807L]
(15) Exchange
Input [59]: [segment#18571, processing_day#18573, count#18803L, MS[0]#18638L, MS[1]#18639L, MS[2]#18640L, MS[3]#18641L, MS[4]#18642L, MS[5]#18643L, MS[6]#18644L, MS[7]#18645L, MS[8]#18646L, MS[9]#18647L, MS[10]#18648L, MS[11]#18649L, MS[12]#18650L, MS[13]#18651L, MS[14]#18652L, MS[15]#18653L, MS[16]#18654L, MS[17]#18655L, MS[18]#18656L, MS[19]#18657L, MS[20]#18658L, MS[21]#18659L, MS[22]#18660L, MS[23]#18661L, MS[24]#18662L, MS[25]#18663L, MS[26]#18664L, MS[27]#18665L, MS[28]#18666L, MS[29]#18667L, MS[30]#18668L, MS[31]#18669L, MS[32]#18670L, MS[33]#18671L, MS[34]#18672L, MS[35]#18673L, MS[36]#18674L, MS[37]#18675L, MS[38]#18676L, MS[39]#18677L, MS[40]#18678L, MS[41]#18679L, MS[42]#18680L, MS[43]#18681L, MS[44]#18682L, MS[45]#18683L, MS[46]#18684L, MS[47]#18685L, MS[48]#18686L, MS[49]#18687L, MS[50]#18688L, MS[51]#18689L, sum#18804L, sum#18805, sum#18806, count#18807L]
Arguments: hashpartitioning(segment#18571, processing_day#18573, 200), ENSURE_REQUIREMENTS, [plan_id=1766]
(16) HashAggregate
Input [59]: [segment#18571, processing_day#18573, count#18803L, MS[0]#18638L, MS[1]#18639L, MS[2]#18640L, MS[3]#18641L, MS[4]#18642L, MS[5]#18643L, MS[6]#18644L, MS[7]#18645L, MS[8]#18646L, MS[9]#18647L, MS[10]#18648L, MS[11]#18649L, MS[12]#18650L, MS[13]#18651L, MS[14]#18652L, MS[15]#18653L, MS[16]#18654L, MS[17]#18655L, MS[18]#18656L, MS[19]#18657L, MS[20]#18658L, MS[21]#18659L, MS[22]#18660L, MS[23]#18661L, MS[24]#18662L, MS[25]#18663L, MS[26]#18664L, MS[27]#18665L, MS[28]#18666L, MS[29]#18667L, MS[30]#18668L, MS[31]#18669L, MS[32]#18670L, MS[33]#18671L, MS[34]#18672L, MS[35]#18673L, MS[36]#18674L, MS[37]#18675L, MS[38]#18676L, MS[39]#18677L, MS[40]#18678L, MS[41]#18679L, MS[42]#18680L, MS[43]#18681L, MS[44]#18682L, MS[45]#18683L, MS[46]#18684L, MS[47]#18685L, MS[48]#18686L, MS[49]#18687L, MS[50]#18688L, MS[51]#18689L, sum#18804L, sum#18805, sum#18806, count#18807L]
Keys [2]: [segment#18571, processing_day#18573]
Functions [5]: [count(1), approx_count_distinct(customer_id#18567L, 0.05, 0, 0), sum(events#18577), sum(weighted_amount#18579), avg(amount#18575)]
Aggregate Attributes [5]: [count(1)#18585L, approx_count_distinct(customer_id#18567L, 0.05, 0, 0)#18690L, sum(events#18577)#18691L, sum(weighted_amount#18579)#18692, avg(amount#18575)#18693]
Results [7]: [segment#18571, processing_day#18573, count(1)#18585L AS row_count#18580L, approx_count_distinct(customer_id#18567L, 0.05, 0, 0)#18690L AS unique_customers#18581L, sum(events#18577)#18691L AS event_sum#18582L, sum(weighted_amount#18579)#18692 AS weighted_amount_sum#18583, avg(amount#18575)#18693 AS avg_amount#18584]
(17) Exchange
Input [7]: [segment#18571, processing_day#18573, row_count#18580L, unique_customers#18581L, event_sum#18582L, weighted_amount_sum#18583, avg_amount#18584]
Arguments: rangepartitioning(segment#18571 ASC NULLS FIRST, processing_day#18573 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1769]
(18) Sort
Input [7]: [segment#18571, processing_day#18573, row_count#18580L, unique_customers#18581L, event_sum#18582L, weighted_amount_sum#18583, avg_amount#18584]
Arguments: [segment#18571 ASC NULLS FIRST, processing_day#18573 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#18571, processing_day#18573, row_count#18580L, unique_customers#18581L, event_sum#18582L, weighted_amount_sum#18583, avg_amount#18584]
Arguments: isFinalPlan=true