== 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#9725L]
Arguments: Range (11000000, 12000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#9725L % 250000) AS customer_id#9727L, concat(segment-, cast(cast((id#9725L % 12) as int) as string)) AS segment#9731, cast((id#9725L % 14) as int) AS processing_day#9733, ((cast(((id#9725L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#9735, cast((((id#9725L * 29) % 7) + 1) as int) AS events#9737]
Input [1]: [id#9725L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#9727L, segment#9731, processing_day#9733, amount#9735, events#9737, (amount#9735 * cast(events#9737 as double)) AS weighted_amount#9739]
Input [5]: [customer_id#9727L, segment#9731, processing_day#9733, amount#9735, events#9737]
(4) HashAggregate
Input [6]: [customer_id#9727L, segment#9731, processing_day#9733, amount#9735, events#9737, weighted_amount#9739]
Keys [2]: [segment#9731, processing_day#9733]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#9727L, 0.05, 0, 0), partial_sum(events#9737), partial_sum(weighted_amount#9739), partial_avg(amount#9735)]
Aggregate Attributes [57]: [count#9958L, MS[0]#9746L, MS[1]#9747L, MS[2]#9748L, MS[3]#9749L, MS[4]#9750L, MS[5]#9751L, MS[6]#9752L, MS[7]#9753L, MS[8]#9754L, MS[9]#9755L, MS[10]#9756L, MS[11]#9757L, MS[12]#9758L, MS[13]#9759L, MS[14]#9760L, MS[15]#9761L, MS[16]#9762L, MS[17]#9763L, MS[18]#9764L, MS[19]#9765L, MS[20]#9766L, MS[21]#9767L, MS[22]#9768L, MS[23]#9769L, MS[24]#9770L, MS[25]#9771L, MS[26]#9772L, MS[27]#9773L, MS[28]#9774L, MS[29]#9775L, MS[30]#9776L, MS[31]#9777L, MS[32]#9778L, MS[33]#9779L, MS[34]#9780L, MS[35]#9781L, MS[36]#9782L, MS[37]#9783L, MS[38]#9784L, MS[39]#9785L, MS[40]#9786L, MS[41]#9787L, MS[42]#9788L, MS[43]#9789L, MS[44]#9790L, MS[45]#9791L, MS[46]#9792L, MS[47]#9793L, MS[48]#9794L, MS[49]#9795L, MS[50]#9796L, MS[51]#9797L, sum#9959L, sum#9960, sum#9961, count#9962L]
Results [59]: [segment#9731, processing_day#9733, count#9963L, MS[0]#9798L, MS[1]#9799L, MS[2]#9800L, MS[3]#9801L, MS[4]#9802L, MS[5]#9803L, MS[6]#9804L, MS[7]#9805L, MS[8]#9806L, MS[9]#9807L, MS[10]#9808L, MS[11]#9809L, MS[12]#9810L, MS[13]#9811L, MS[14]#9812L, MS[15]#9813L, MS[16]#9814L, MS[17]#9815L, MS[18]#9816L, MS[19]#9817L, MS[20]#9818L, MS[21]#9819L, MS[22]#9820L, MS[23]#9821L, MS[24]#9822L, MS[25]#9823L, MS[26]#9824L, MS[27]#9825L, MS[28]#9826L, MS[29]#9827L, MS[30]#9828L, MS[31]#9829L, MS[32]#9830L, MS[33]#9831L, MS[34]#9832L, MS[35]#9833L, MS[36]#9834L, MS[37]#9835L, MS[38]#9836L, MS[39]#9837L, MS[40]#9838L, MS[41]#9839L, MS[42]#9840L, MS[43]#9841L, MS[44]#9842L, MS[45]#9843L, MS[46]#9844L, MS[47]#9845L, MS[48]#9846L, MS[49]#9847L, MS[50]#9848L, MS[51]#9849L, sum#9964L, sum#9965, sum#9966, count#9967L]
(5) Exchange
Input [59]: [segment#9731, processing_day#9733, count#9963L, MS[0]#9798L, MS[1]#9799L, MS[2]#9800L, MS[3]#9801L, MS[4]#9802L, MS[5]#9803L, MS[6]#9804L, MS[7]#9805L, MS[8]#9806L, MS[9]#9807L, MS[10]#9808L, MS[11]#9809L, MS[12]#9810L, MS[13]#9811L, MS[14]#9812L, MS[15]#9813L, MS[16]#9814L, MS[17]#9815L, MS[18]#9816L, MS[19]#9817L, MS[20]#9818L, MS[21]#9819L, MS[22]#9820L, MS[23]#9821L, MS[24]#9822L, MS[25]#9823L, MS[26]#9824L, MS[27]#9825L, MS[28]#9826L, MS[29]#9827L, MS[30]#9828L, MS[31]#9829L, MS[32]#9830L, MS[33]#9831L, MS[34]#9832L, MS[35]#9833L, MS[36]#9834L, MS[37]#9835L, MS[38]#9836L, MS[39]#9837L, MS[40]#9838L, MS[41]#9839L, MS[42]#9840L, MS[43]#9841L, MS[44]#9842L, MS[45]#9843L, MS[46]#9844L, MS[47]#9845L, MS[48]#9846L, MS[49]#9847L, MS[50]#9848L, MS[51]#9849L, sum#9964L, sum#9965, sum#9966, count#9967L]
Arguments: hashpartitioning(segment#9731, processing_day#9733, 200), ENSURE_REQUIREMENTS, [plan_id=956]
(6) ShuffleQueryStage
Output [59]: [segment#9731, processing_day#9733, count#9963L, MS[0]#9798L, MS[1]#9799L, MS[2]#9800L, MS[3]#9801L, MS[4]#9802L, MS[5]#9803L, MS[6]#9804L, MS[7]#9805L, MS[8]#9806L, MS[9]#9807L, MS[10]#9808L, MS[11]#9809L, MS[12]#9810L, MS[13]#9811L, MS[14]#9812L, MS[15]#9813L, MS[16]#9814L, MS[17]#9815L, MS[18]#9816L, MS[19]#9817L, MS[20]#9818L, MS[21]#9819L, MS[22]#9820L, MS[23]#9821L, MS[24]#9822L, MS[25]#9823L, MS[26]#9824L, MS[27]#9825L, MS[28]#9826L, MS[29]#9827L, MS[30]#9828L, MS[31]#9829L, MS[32]#9830L, MS[33]#9831L, MS[34]#9832L, MS[35]#9833L, MS[36]#9834L, MS[37]#9835L, MS[38]#9836L, MS[39]#9837L, MS[40]#9838L, MS[41]#9839L, MS[42]#9840L, MS[43]#9841L, MS[44]#9842L, MS[45]#9843L, MS[46]#9844L, MS[47]#9845L, MS[48]#9846L, MS[49]#9847L, MS[50]#9848L, MS[51]#9849L, sum#9964L, sum#9965, sum#9966, count#9967L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#9731, processing_day#9733, count#9963L, MS[0]#9798L, MS[1]#9799L, MS[2]#9800L, MS[3]#9801L, MS[4]#9802L, MS[5]#9803L, MS[6]#9804L, MS[7]#9805L, MS[8]#9806L, MS[9]#9807L, MS[10]#9808L, MS[11]#9809L, MS[12]#9810L, MS[13]#9811L, MS[14]#9812L, MS[15]#9813L, MS[16]#9814L, MS[17]#9815L, MS[18]#9816L, MS[19]#9817L, MS[20]#9818L, MS[21]#9819L, MS[22]#9820L, MS[23]#9821L, MS[24]#9822L, MS[25]#9823L, MS[26]#9824L, MS[27]#9825L, MS[28]#9826L, MS[29]#9827L, MS[30]#9828L, MS[31]#9829L, MS[32]#9830L, MS[33]#9831L, MS[34]#9832L, MS[35]#9833L, MS[36]#9834L, MS[37]#9835L, MS[38]#9836L, MS[39]#9837L, MS[40]#9838L, MS[41]#9839L, MS[42]#9840L, MS[43]#9841L, MS[44]#9842L, MS[45]#9843L, MS[46]#9844L, MS[47]#9845L, MS[48]#9846L, MS[49]#9847L, MS[50]#9848L, MS[51]#9849L, sum#9964L, sum#9965, sum#9966, count#9967L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#9731, processing_day#9733, count#9963L, MS[0]#9798L, MS[1]#9799L, MS[2]#9800L, MS[3]#9801L, MS[4]#9802L, MS[5]#9803L, MS[6]#9804L, MS[7]#9805L, MS[8]#9806L, MS[9]#9807L, MS[10]#9808L, MS[11]#9809L, MS[12]#9810L, MS[13]#9811L, MS[14]#9812L, MS[15]#9813L, MS[16]#9814L, MS[17]#9815L, MS[18]#9816L, MS[19]#9817L, MS[20]#9818L, MS[21]#9819L, MS[22]#9820L, MS[23]#9821L, MS[24]#9822L, MS[25]#9823L, MS[26]#9824L, MS[27]#9825L, MS[28]#9826L, MS[29]#9827L, MS[30]#9828L, MS[31]#9829L, MS[32]#9830L, MS[33]#9831L, MS[34]#9832L, MS[35]#9833L, MS[36]#9834L, MS[37]#9835L, MS[38]#9836L, MS[39]#9837L, MS[40]#9838L, MS[41]#9839L, MS[42]#9840L, MS[43]#9841L, MS[44]#9842L, MS[45]#9843L, MS[46]#9844L, MS[47]#9845L, MS[48]#9846L, MS[49]#9847L, MS[50]#9848L, MS[51]#9849L, sum#9964L, sum#9965, sum#9966, count#9967L]
Keys [2]: [segment#9731, processing_day#9733]
Functions [5]: [count(1), approx_count_distinct(customer_id#9727L, 0.05, 0, 0), sum(events#9737), sum(weighted_amount#9739), avg(amount#9735)]
Aggregate Attributes [5]: [count(1)#9745L, approx_count_distinct(customer_id#9727L, 0.05, 0, 0)#9850L, sum(events#9737)#9851L, sum(weighted_amount#9739)#9852, avg(amount#9735)#9853]
Results [7]: [segment#9731, processing_day#9733, count(1)#9745L AS row_count#9740L, approx_count_distinct(customer_id#9727L, 0.05, 0, 0)#9850L AS unique_customers#9741L, sum(events#9737)#9851L AS event_sum#9742L, sum(weighted_amount#9739)#9852 AS weighted_amount_sum#9743, avg(amount#9735)#9853 AS avg_amount#9744]
(9) Exchange
Input [7]: [segment#9731, processing_day#9733, row_count#9740L, unique_customers#9741L, event_sum#9742L, weighted_amount_sum#9743, avg_amount#9744]
Arguments: rangepartitioning(segment#9731 ASC NULLS FIRST, processing_day#9733 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=978]
(10) ShuffleQueryStage
Output [7]: [segment#9731, processing_day#9733, row_count#9740L, unique_customers#9741L, event_sum#9742L, weighted_amount_sum#9743, avg_amount#9744]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#9731, processing_day#9733, row_count#9740L, unique_customers#9741L, event_sum#9742L, weighted_amount_sum#9743, avg_amount#9744]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#9731, processing_day#9733, row_count#9740L, unique_customers#9741L, event_sum#9742L, weighted_amount_sum#9743, avg_amount#9744]
Arguments: [segment#9731 ASC NULLS FIRST, processing_day#9733 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#9731, processing_day#9733, row_count#9740L, unique_customers#9741L, event_sum#9742L, weighted_amount_sum#9743, avg_amount#9744]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#9727L, segment#9731, processing_day#9733, amount#9735, events#9737, weighted_amount#9739]
Keys [2]: [segment#9731, processing_day#9733]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#9727L, 0.05, 0, 0), partial_sum(events#9737), partial_sum(weighted_amount#9739), partial_avg(amount#9735)]
Aggregate Attributes [57]: [count#9958L, MS[0]#9746L, MS[1]#9747L, MS[2]#9748L, MS[3]#9749L, MS[4]#9750L, MS[5]#9751L, MS[6]#9752L, MS[7]#9753L, MS[8]#9754L, MS[9]#9755L, MS[10]#9756L, MS[11]#9757L, MS[12]#9758L, MS[13]#9759L, MS[14]#9760L, MS[15]#9761L, MS[16]#9762L, MS[17]#9763L, MS[18]#9764L, MS[19]#9765L, MS[20]#9766L, MS[21]#9767L, MS[22]#9768L, MS[23]#9769L, MS[24]#9770L, MS[25]#9771L, MS[26]#9772L, MS[27]#9773L, MS[28]#9774L, MS[29]#9775L, MS[30]#9776L, MS[31]#9777L, MS[32]#9778L, MS[33]#9779L, MS[34]#9780L, MS[35]#9781L, MS[36]#9782L, MS[37]#9783L, MS[38]#9784L, MS[39]#9785L, MS[40]#9786L, MS[41]#9787L, MS[42]#9788L, MS[43]#9789L, MS[44]#9790L, MS[45]#9791L, MS[46]#9792L, MS[47]#9793L, MS[48]#9794L, MS[49]#9795L, MS[50]#9796L, MS[51]#9797L, sum#9959L, sum#9960, sum#9961, count#9962L]
Results [59]: [segment#9731, processing_day#9733, count#9963L, MS[0]#9798L, MS[1]#9799L, MS[2]#9800L, MS[3]#9801L, MS[4]#9802L, MS[5]#9803L, MS[6]#9804L, MS[7]#9805L, MS[8]#9806L, MS[9]#9807L, MS[10]#9808L, MS[11]#9809L, MS[12]#9810L, MS[13]#9811L, MS[14]#9812L, MS[15]#9813L, MS[16]#9814L, MS[17]#9815L, MS[18]#9816L, MS[19]#9817L, MS[20]#9818L, MS[21]#9819L, MS[22]#9820L, MS[23]#9821L, MS[24]#9822L, MS[25]#9823L, MS[26]#9824L, MS[27]#9825L, MS[28]#9826L, MS[29]#9827L, MS[30]#9828L, MS[31]#9829L, MS[32]#9830L, MS[33]#9831L, MS[34]#9832L, MS[35]#9833L, MS[36]#9834L, MS[37]#9835L, MS[38]#9836L, MS[39]#9837L, MS[40]#9838L, MS[41]#9839L, MS[42]#9840L, MS[43]#9841L, MS[44]#9842L, MS[45]#9843L, MS[46]#9844L, MS[47]#9845L, MS[48]#9846L, MS[49]#9847L, MS[50]#9848L, MS[51]#9849L, sum#9964L, sum#9965, sum#9966, count#9967L]
(15) Exchange
Input [59]: [segment#9731, processing_day#9733, count#9963L, MS[0]#9798L, MS[1]#9799L, MS[2]#9800L, MS[3]#9801L, MS[4]#9802L, MS[5]#9803L, MS[6]#9804L, MS[7]#9805L, MS[8]#9806L, MS[9]#9807L, MS[10]#9808L, MS[11]#9809L, MS[12]#9810L, MS[13]#9811L, MS[14]#9812L, MS[15]#9813L, MS[16]#9814L, MS[17]#9815L, MS[18]#9816L, MS[19]#9817L, MS[20]#9818L, MS[21]#9819L, MS[22]#9820L, MS[23]#9821L, MS[24]#9822L, MS[25]#9823L, MS[26]#9824L, MS[27]#9825L, MS[28]#9826L, MS[29]#9827L, MS[30]#9828L, MS[31]#9829L, MS[32]#9830L, MS[33]#9831L, MS[34]#9832L, MS[35]#9833L, MS[36]#9834L, MS[37]#9835L, MS[38]#9836L, MS[39]#9837L, MS[40]#9838L, MS[41]#9839L, MS[42]#9840L, MS[43]#9841L, MS[44]#9842L, MS[45]#9843L, MS[46]#9844L, MS[47]#9845L, MS[48]#9846L, MS[49]#9847L, MS[50]#9848L, MS[51]#9849L, sum#9964L, sum#9965, sum#9966, count#9967L]
Arguments: hashpartitioning(segment#9731, processing_day#9733, 200), ENSURE_REQUIREMENTS, [plan_id=936]
(16) HashAggregate
Input [59]: [segment#9731, processing_day#9733, count#9963L, MS[0]#9798L, MS[1]#9799L, MS[2]#9800L, MS[3]#9801L, MS[4]#9802L, MS[5]#9803L, MS[6]#9804L, MS[7]#9805L, MS[8]#9806L, MS[9]#9807L, MS[10]#9808L, MS[11]#9809L, MS[12]#9810L, MS[13]#9811L, MS[14]#9812L, MS[15]#9813L, MS[16]#9814L, MS[17]#9815L, MS[18]#9816L, MS[19]#9817L, MS[20]#9818L, MS[21]#9819L, MS[22]#9820L, MS[23]#9821L, MS[24]#9822L, MS[25]#9823L, MS[26]#9824L, MS[27]#9825L, MS[28]#9826L, MS[29]#9827L, MS[30]#9828L, MS[31]#9829L, MS[32]#9830L, MS[33]#9831L, MS[34]#9832L, MS[35]#9833L, MS[36]#9834L, MS[37]#9835L, MS[38]#9836L, MS[39]#9837L, MS[40]#9838L, MS[41]#9839L, MS[42]#9840L, MS[43]#9841L, MS[44]#9842L, MS[45]#9843L, MS[46]#9844L, MS[47]#9845L, MS[48]#9846L, MS[49]#9847L, MS[50]#9848L, MS[51]#9849L, sum#9964L, sum#9965, sum#9966, count#9967L]
Keys [2]: [segment#9731, processing_day#9733]
Functions [5]: [count(1), approx_count_distinct(customer_id#9727L, 0.05, 0, 0), sum(events#9737), sum(weighted_amount#9739), avg(amount#9735)]
Aggregate Attributes [5]: [count(1)#9745L, approx_count_distinct(customer_id#9727L, 0.05, 0, 0)#9850L, sum(events#9737)#9851L, sum(weighted_amount#9739)#9852, avg(amount#9735)#9853]
Results [7]: [segment#9731, processing_day#9733, count(1)#9745L AS row_count#9740L, approx_count_distinct(customer_id#9727L, 0.05, 0, 0)#9850L AS unique_customers#9741L, sum(events#9737)#9851L AS event_sum#9742L, sum(weighted_amount#9739)#9852 AS weighted_amount_sum#9743, avg(amount#9735)#9853 AS avg_amount#9744]
(17) Exchange
Input [7]: [segment#9731, processing_day#9733, row_count#9740L, unique_customers#9741L, event_sum#9742L, weighted_amount_sum#9743, avg_amount#9744]
Arguments: rangepartitioning(segment#9731 ASC NULLS FIRST, processing_day#9733 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=939]
(18) Sort
Input [7]: [segment#9731, processing_day#9733, row_count#9740L, unique_customers#9741L, event_sum#9742L, weighted_amount_sum#9743, avg_amount#9744]
Arguments: [segment#9731 ASC NULLS FIRST, processing_day#9733 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#9731, processing_day#9733, row_count#9740L, unique_customers#9741L, event_sum#9742L, weighted_amount_sum#9743, avg_amount#9744]
Arguments: isFinalPlan=true