== 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#90307L]
Arguments: Range (6000000, 7000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#90307L % 250000) AS customer_id#90309L, concat(segment-, cast(cast((id#90307L % 12) as int) as string)) AS segment#90313, cast((id#90307L % 14) as int) AS processing_day#90315, ((cast(((id#90307L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#90317, cast((((id#90307L * 29) % 7) + 1) as int) AS events#90319]
Input [1]: [id#90307L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#90309L, segment#90313, processing_day#90315, amount#90317, events#90319, (amount#90317 * cast(events#90319 as double)) AS weighted_amount#90321]
Input [5]: [customer_id#90309L, segment#90313, processing_day#90315, amount#90317, events#90319]
(4) HashAggregate
Input [6]: [customer_id#90309L, segment#90313, processing_day#90315, amount#90317, events#90319, weighted_amount#90321]
Keys [2]: [segment#90313, processing_day#90315]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#90309L, 0.05, 0, 0), partial_sum(events#90319), partial_sum(weighted_amount#90321), partial_avg(amount#90317)]
Aggregate Attributes [57]: [count#90540L, MS[0]#90328L, MS[1]#90329L, MS[2]#90330L, MS[3]#90331L, MS[4]#90332L, MS[5]#90333L, MS[6]#90334L, MS[7]#90335L, MS[8]#90336L, MS[9]#90337L, MS[10]#90338L, MS[11]#90339L, MS[12]#90340L, MS[13]#90341L, MS[14]#90342L, MS[15]#90343L, MS[16]#90344L, MS[17]#90345L, MS[18]#90346L, MS[19]#90347L, MS[20]#90348L, MS[21]#90349L, MS[22]#90350L, MS[23]#90351L, MS[24]#90352L, MS[25]#90353L, MS[26]#90354L, MS[27]#90355L, MS[28]#90356L, MS[29]#90357L, MS[30]#90358L, MS[31]#90359L, MS[32]#90360L, MS[33]#90361L, MS[34]#90362L, MS[35]#90363L, MS[36]#90364L, MS[37]#90365L, MS[38]#90366L, MS[39]#90367L, MS[40]#90368L, MS[41]#90369L, MS[42]#90370L, MS[43]#90371L, MS[44]#90372L, MS[45]#90373L, MS[46]#90374L, MS[47]#90375L, MS[48]#90376L, MS[49]#90377L, MS[50]#90378L, MS[51]#90379L, sum#90541L, sum#90542, sum#90543, count#90544L]
Results [59]: [segment#90313, processing_day#90315, count#90545L, MS[0]#90380L, MS[1]#90381L, MS[2]#90382L, MS[3]#90383L, MS[4]#90384L, MS[5]#90385L, MS[6]#90386L, MS[7]#90387L, MS[8]#90388L, MS[9]#90389L, MS[10]#90390L, MS[11]#90391L, MS[12]#90392L, MS[13]#90393L, MS[14]#90394L, MS[15]#90395L, MS[16]#90396L, MS[17]#90397L, MS[18]#90398L, MS[19]#90399L, MS[20]#90400L, MS[21]#90401L, MS[22]#90402L, MS[23]#90403L, MS[24]#90404L, MS[25]#90405L, MS[26]#90406L, MS[27]#90407L, MS[28]#90408L, MS[29]#90409L, MS[30]#90410L, MS[31]#90411L, MS[32]#90412L, MS[33]#90413L, MS[34]#90414L, MS[35]#90415L, MS[36]#90416L, MS[37]#90417L, MS[38]#90418L, MS[39]#90419L, MS[40]#90420L, MS[41]#90421L, MS[42]#90422L, MS[43]#90423L, MS[44]#90424L, MS[45]#90425L, MS[46]#90426L, MS[47]#90427L, MS[48]#90428L, MS[49]#90429L, MS[50]#90430L, MS[51]#90431L, sum#90546L, sum#90547, sum#90548, count#90549L]
(5) Exchange
Input [59]: [segment#90313, processing_day#90315, count#90545L, MS[0]#90380L, MS[1]#90381L, MS[2]#90382L, MS[3]#90383L, MS[4]#90384L, MS[5]#90385L, MS[6]#90386L, MS[7]#90387L, MS[8]#90388L, MS[9]#90389L, MS[10]#90390L, MS[11]#90391L, MS[12]#90392L, MS[13]#90393L, MS[14]#90394L, MS[15]#90395L, MS[16]#90396L, MS[17]#90397L, MS[18]#90398L, MS[19]#90399L, MS[20]#90400L, MS[21]#90401L, MS[22]#90402L, MS[23]#90403L, MS[24]#90404L, MS[25]#90405L, MS[26]#90406L, MS[27]#90407L, MS[28]#90408L, MS[29]#90409L, MS[30]#90410L, MS[31]#90411L, MS[32]#90412L, MS[33]#90413L, MS[34]#90414L, MS[35]#90415L, MS[36]#90416L, MS[37]#90417L, MS[38]#90418L, MS[39]#90419L, MS[40]#90420L, MS[41]#90421L, MS[42]#90422L, MS[43]#90423L, MS[44]#90424L, MS[45]#90425L, MS[46]#90426L, MS[47]#90427L, MS[48]#90428L, MS[49]#90429L, MS[50]#90430L, MS[51]#90431L, sum#90546L, sum#90547, sum#90548, count#90549L]
Arguments: hashpartitioning(segment#90313, processing_day#90315, 200), ENSURE_REQUIREMENTS, [plan_id=8533]
(6) ShuffleQueryStage
Output [59]: [segment#90313, processing_day#90315, count#90545L, MS[0]#90380L, MS[1]#90381L, MS[2]#90382L, MS[3]#90383L, MS[4]#90384L, MS[5]#90385L, MS[6]#90386L, MS[7]#90387L, MS[8]#90388L, MS[9]#90389L, MS[10]#90390L, MS[11]#90391L, MS[12]#90392L, MS[13]#90393L, MS[14]#90394L, MS[15]#90395L, MS[16]#90396L, MS[17]#90397L, MS[18]#90398L, MS[19]#90399L, MS[20]#90400L, MS[21]#90401L, MS[22]#90402L, MS[23]#90403L, MS[24]#90404L, MS[25]#90405L, MS[26]#90406L, MS[27]#90407L, MS[28]#90408L, MS[29]#90409L, MS[30]#90410L, MS[31]#90411L, MS[32]#90412L, MS[33]#90413L, MS[34]#90414L, MS[35]#90415L, MS[36]#90416L, MS[37]#90417L, MS[38]#90418L, MS[39]#90419L, MS[40]#90420L, MS[41]#90421L, MS[42]#90422L, MS[43]#90423L, MS[44]#90424L, MS[45]#90425L, MS[46]#90426L, MS[47]#90427L, MS[48]#90428L, MS[49]#90429L, MS[50]#90430L, MS[51]#90431L, sum#90546L, sum#90547, sum#90548, count#90549L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#90313, processing_day#90315, count#90545L, MS[0]#90380L, MS[1]#90381L, MS[2]#90382L, MS[3]#90383L, MS[4]#90384L, MS[5]#90385L, MS[6]#90386L, MS[7]#90387L, MS[8]#90388L, MS[9]#90389L, MS[10]#90390L, MS[11]#90391L, MS[12]#90392L, MS[13]#90393L, MS[14]#90394L, MS[15]#90395L, MS[16]#90396L, MS[17]#90397L, MS[18]#90398L, MS[19]#90399L, MS[20]#90400L, MS[21]#90401L, MS[22]#90402L, MS[23]#90403L, MS[24]#90404L, MS[25]#90405L, MS[26]#90406L, MS[27]#90407L, MS[28]#90408L, MS[29]#90409L, MS[30]#90410L, MS[31]#90411L, MS[32]#90412L, MS[33]#90413L, MS[34]#90414L, MS[35]#90415L, MS[36]#90416L, MS[37]#90417L, MS[38]#90418L, MS[39]#90419L, MS[40]#90420L, MS[41]#90421L, MS[42]#90422L, MS[43]#90423L, MS[44]#90424L, MS[45]#90425L, MS[46]#90426L, MS[47]#90427L, MS[48]#90428L, MS[49]#90429L, MS[50]#90430L, MS[51]#90431L, sum#90546L, sum#90547, sum#90548, count#90549L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#90313, processing_day#90315, count#90545L, MS[0]#90380L, MS[1]#90381L, MS[2]#90382L, MS[3]#90383L, MS[4]#90384L, MS[5]#90385L, MS[6]#90386L, MS[7]#90387L, MS[8]#90388L, MS[9]#90389L, MS[10]#90390L, MS[11]#90391L, MS[12]#90392L, MS[13]#90393L, MS[14]#90394L, MS[15]#90395L, MS[16]#90396L, MS[17]#90397L, MS[18]#90398L, MS[19]#90399L, MS[20]#90400L, MS[21]#90401L, MS[22]#90402L, MS[23]#90403L, MS[24]#90404L, MS[25]#90405L, MS[26]#90406L, MS[27]#90407L, MS[28]#90408L, MS[29]#90409L, MS[30]#90410L, MS[31]#90411L, MS[32]#90412L, MS[33]#90413L, MS[34]#90414L, MS[35]#90415L, MS[36]#90416L, MS[37]#90417L, MS[38]#90418L, MS[39]#90419L, MS[40]#90420L, MS[41]#90421L, MS[42]#90422L, MS[43]#90423L, MS[44]#90424L, MS[45]#90425L, MS[46]#90426L, MS[47]#90427L, MS[48]#90428L, MS[49]#90429L, MS[50]#90430L, MS[51]#90431L, sum#90546L, sum#90547, sum#90548, count#90549L]
Keys [2]: [segment#90313, processing_day#90315]
Functions [5]: [count(1), approx_count_distinct(customer_id#90309L, 0.05, 0, 0), sum(events#90319), sum(weighted_amount#90321), avg(amount#90317)]
Aggregate Attributes [5]: [count(1)#90327L, approx_count_distinct(customer_id#90309L, 0.05, 0, 0)#90432L, sum(events#90319)#90433L, sum(weighted_amount#90321)#90434, avg(amount#90317)#90435]
Results [7]: [segment#90313, processing_day#90315, count(1)#90327L AS row_count#90322L, approx_count_distinct(customer_id#90309L, 0.05, 0, 0)#90432L AS unique_customers#90323L, sum(events#90319)#90433L AS event_sum#90324L, sum(weighted_amount#90321)#90434 AS weighted_amount_sum#90325, avg(amount#90317)#90435 AS avg_amount#90326]
(9) Exchange
Input [7]: [segment#90313, processing_day#90315, row_count#90322L, unique_customers#90323L, event_sum#90324L, weighted_amount_sum#90325, avg_amount#90326]
Arguments: rangepartitioning(segment#90313 ASC NULLS FIRST, processing_day#90315 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8555]
(10) ShuffleQueryStage
Output [7]: [segment#90313, processing_day#90315, row_count#90322L, unique_customers#90323L, event_sum#90324L, weighted_amount_sum#90325, avg_amount#90326]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#90313, processing_day#90315, row_count#90322L, unique_customers#90323L, event_sum#90324L, weighted_amount_sum#90325, avg_amount#90326]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#90313, processing_day#90315, row_count#90322L, unique_customers#90323L, event_sum#90324L, weighted_amount_sum#90325, avg_amount#90326]
Arguments: [segment#90313 ASC NULLS FIRST, processing_day#90315 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#90313, processing_day#90315, row_count#90322L, unique_customers#90323L, event_sum#90324L, weighted_amount_sum#90325, avg_amount#90326]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#90309L, segment#90313, processing_day#90315, amount#90317, events#90319, weighted_amount#90321]
Keys [2]: [segment#90313, processing_day#90315]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#90309L, 0.05, 0, 0), partial_sum(events#90319), partial_sum(weighted_amount#90321), partial_avg(amount#90317)]
Aggregate Attributes [57]: [count#90540L, MS[0]#90328L, MS[1]#90329L, MS[2]#90330L, MS[3]#90331L, MS[4]#90332L, MS[5]#90333L, MS[6]#90334L, MS[7]#90335L, MS[8]#90336L, MS[9]#90337L, MS[10]#90338L, MS[11]#90339L, MS[12]#90340L, MS[13]#90341L, MS[14]#90342L, MS[15]#90343L, MS[16]#90344L, MS[17]#90345L, MS[18]#90346L, MS[19]#90347L, MS[20]#90348L, MS[21]#90349L, MS[22]#90350L, MS[23]#90351L, MS[24]#90352L, MS[25]#90353L, MS[26]#90354L, MS[27]#90355L, MS[28]#90356L, MS[29]#90357L, MS[30]#90358L, MS[31]#90359L, MS[32]#90360L, MS[33]#90361L, MS[34]#90362L, MS[35]#90363L, MS[36]#90364L, MS[37]#90365L, MS[38]#90366L, MS[39]#90367L, MS[40]#90368L, MS[41]#90369L, MS[42]#90370L, MS[43]#90371L, MS[44]#90372L, MS[45]#90373L, MS[46]#90374L, MS[47]#90375L, MS[48]#90376L, MS[49]#90377L, MS[50]#90378L, MS[51]#90379L, sum#90541L, sum#90542, sum#90543, count#90544L]
Results [59]: [segment#90313, processing_day#90315, count#90545L, MS[0]#90380L, MS[1]#90381L, MS[2]#90382L, MS[3]#90383L, MS[4]#90384L, MS[5]#90385L, MS[6]#90386L, MS[7]#90387L, MS[8]#90388L, MS[9]#90389L, MS[10]#90390L, MS[11]#90391L, MS[12]#90392L, MS[13]#90393L, MS[14]#90394L, MS[15]#90395L, MS[16]#90396L, MS[17]#90397L, MS[18]#90398L, MS[19]#90399L, MS[20]#90400L, MS[21]#90401L, MS[22]#90402L, MS[23]#90403L, MS[24]#90404L, MS[25]#90405L, MS[26]#90406L, MS[27]#90407L, MS[28]#90408L, MS[29]#90409L, MS[30]#90410L, MS[31]#90411L, MS[32]#90412L, MS[33]#90413L, MS[34]#90414L, MS[35]#90415L, MS[36]#90416L, MS[37]#90417L, MS[38]#90418L, MS[39]#90419L, MS[40]#90420L, MS[41]#90421L, MS[42]#90422L, MS[43]#90423L, MS[44]#90424L, MS[45]#90425L, MS[46]#90426L, MS[47]#90427L, MS[48]#90428L, MS[49]#90429L, MS[50]#90430L, MS[51]#90431L, sum#90546L, sum#90547, sum#90548, count#90549L]
(15) Exchange
Input [59]: [segment#90313, processing_day#90315, count#90545L, MS[0]#90380L, MS[1]#90381L, MS[2]#90382L, MS[3]#90383L, MS[4]#90384L, MS[5]#90385L, MS[6]#90386L, MS[7]#90387L, MS[8]#90388L, MS[9]#90389L, MS[10]#90390L, MS[11]#90391L, MS[12]#90392L, MS[13]#90393L, MS[14]#90394L, MS[15]#90395L, MS[16]#90396L, MS[17]#90397L, MS[18]#90398L, MS[19]#90399L, MS[20]#90400L, MS[21]#90401L, MS[22]#90402L, MS[23]#90403L, MS[24]#90404L, MS[25]#90405L, MS[26]#90406L, MS[27]#90407L, MS[28]#90408L, MS[29]#90409L, MS[30]#90410L, MS[31]#90411L, MS[32]#90412L, MS[33]#90413L, MS[34]#90414L, MS[35]#90415L, MS[36]#90416L, MS[37]#90417L, MS[38]#90418L, MS[39]#90419L, MS[40]#90420L, MS[41]#90421L, MS[42]#90422L, MS[43]#90423L, MS[44]#90424L, MS[45]#90425L, MS[46]#90426L, MS[47]#90427L, MS[48]#90428L, MS[49]#90429L, MS[50]#90430L, MS[51]#90431L, sum#90546L, sum#90547, sum#90548, count#90549L]
Arguments: hashpartitioning(segment#90313, processing_day#90315, 200), ENSURE_REQUIREMENTS, [plan_id=8513]
(16) HashAggregate
Input [59]: [segment#90313, processing_day#90315, count#90545L, MS[0]#90380L, MS[1]#90381L, MS[2]#90382L, MS[3]#90383L, MS[4]#90384L, MS[5]#90385L, MS[6]#90386L, MS[7]#90387L, MS[8]#90388L, MS[9]#90389L, MS[10]#90390L, MS[11]#90391L, MS[12]#90392L, MS[13]#90393L, MS[14]#90394L, MS[15]#90395L, MS[16]#90396L, MS[17]#90397L, MS[18]#90398L, MS[19]#90399L, MS[20]#90400L, MS[21]#90401L, MS[22]#90402L, MS[23]#90403L, MS[24]#90404L, MS[25]#90405L, MS[26]#90406L, MS[27]#90407L, MS[28]#90408L, MS[29]#90409L, MS[30]#90410L, MS[31]#90411L, MS[32]#90412L, MS[33]#90413L, MS[34]#90414L, MS[35]#90415L, MS[36]#90416L, MS[37]#90417L, MS[38]#90418L, MS[39]#90419L, MS[40]#90420L, MS[41]#90421L, MS[42]#90422L, MS[43]#90423L, MS[44]#90424L, MS[45]#90425L, MS[46]#90426L, MS[47]#90427L, MS[48]#90428L, MS[49]#90429L, MS[50]#90430L, MS[51]#90431L, sum#90546L, sum#90547, sum#90548, count#90549L]
Keys [2]: [segment#90313, processing_day#90315]
Functions [5]: [count(1), approx_count_distinct(customer_id#90309L, 0.05, 0, 0), sum(events#90319), sum(weighted_amount#90321), avg(amount#90317)]
Aggregate Attributes [5]: [count(1)#90327L, approx_count_distinct(customer_id#90309L, 0.05, 0, 0)#90432L, sum(events#90319)#90433L, sum(weighted_amount#90321)#90434, avg(amount#90317)#90435]
Results [7]: [segment#90313, processing_day#90315, count(1)#90327L AS row_count#90322L, approx_count_distinct(customer_id#90309L, 0.05, 0, 0)#90432L AS unique_customers#90323L, sum(events#90319)#90433L AS event_sum#90324L, sum(weighted_amount#90321)#90434 AS weighted_amount_sum#90325, avg(amount#90317)#90435 AS avg_amount#90326]
(17) Exchange
Input [7]: [segment#90313, processing_day#90315, row_count#90322L, unique_customers#90323L, event_sum#90324L, weighted_amount_sum#90325, avg_amount#90326]
Arguments: rangepartitioning(segment#90313 ASC NULLS FIRST, processing_day#90315 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8516]
(18) Sort
Input [7]: [segment#90313, processing_day#90315, row_count#90322L, unique_customers#90323L, event_sum#90324L, weighted_amount_sum#90325, avg_amount#90326]
Arguments: [segment#90313 ASC NULLS FIRST, processing_day#90315 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#90313, processing_day#90315, row_count#90322L, unique_customers#90323L, event_sum#90324L, weighted_amount_sum#90325, avg_amount#90326]
Arguments: isFinalPlan=true