== 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#30093L]
Arguments: Range (10000000, 11000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#30093L % 250000) AS customer_id#30095L, concat(segment-, cast(cast((id#30093L % 12) as int) as string)) AS segment#30099, cast((id#30093L % 14) as int) AS processing_day#30101, ((cast(((id#30093L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#30103, cast((((id#30093L * 29) % 7) + 1) as int) AS events#30105]
Input [1]: [id#30093L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#30095L, segment#30099, processing_day#30101, amount#30103, events#30105, (amount#30103 * cast(events#30105 as double)) AS weighted_amount#30107]
Input [5]: [customer_id#30095L, segment#30099, processing_day#30101, amount#30103, events#30105]
(4) HashAggregate
Input [6]: [customer_id#30095L, segment#30099, processing_day#30101, amount#30103, events#30105, weighted_amount#30107]
Keys [2]: [segment#30099, processing_day#30101]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#30095L, 0.05, 0, 0), partial_sum(events#30105), partial_sum(weighted_amount#30107), partial_avg(amount#30103)]
Aggregate Attributes [57]: [count#30326L, MS[0]#30114L, MS[1]#30115L, MS[2]#30116L, MS[3]#30117L, MS[4]#30118L, MS[5]#30119L, MS[6]#30120L, MS[7]#30121L, MS[8]#30122L, MS[9]#30123L, MS[10]#30124L, MS[11]#30125L, MS[12]#30126L, MS[13]#30127L, MS[14]#30128L, MS[15]#30129L, MS[16]#30130L, MS[17]#30131L, MS[18]#30132L, MS[19]#30133L, MS[20]#30134L, MS[21]#30135L, MS[22]#30136L, MS[23]#30137L, MS[24]#30138L, MS[25]#30139L, MS[26]#30140L, MS[27]#30141L, MS[28]#30142L, MS[29]#30143L, MS[30]#30144L, MS[31]#30145L, MS[32]#30146L, MS[33]#30147L, MS[34]#30148L, MS[35]#30149L, MS[36]#30150L, MS[37]#30151L, MS[38]#30152L, MS[39]#30153L, MS[40]#30154L, MS[41]#30155L, MS[42]#30156L, MS[43]#30157L, MS[44]#30158L, MS[45]#30159L, MS[46]#30160L, MS[47]#30161L, MS[48]#30162L, MS[49]#30163L, MS[50]#30164L, MS[51]#30165L, sum#30327L, sum#30328, sum#30329, count#30330L]
Results [59]: [segment#30099, processing_day#30101, count#30331L, MS[0]#30166L, MS[1]#30167L, MS[2]#30168L, MS[3]#30169L, MS[4]#30170L, MS[5]#30171L, MS[6]#30172L, MS[7]#30173L, MS[8]#30174L, MS[9]#30175L, MS[10]#30176L, MS[11]#30177L, MS[12]#30178L, MS[13]#30179L, MS[14]#30180L, MS[15]#30181L, MS[16]#30182L, MS[17]#30183L, MS[18]#30184L, MS[19]#30185L, MS[20]#30186L, MS[21]#30187L, MS[22]#30188L, MS[23]#30189L, MS[24]#30190L, MS[25]#30191L, MS[26]#30192L, MS[27]#30193L, MS[28]#30194L, MS[29]#30195L, MS[30]#30196L, MS[31]#30197L, MS[32]#30198L, MS[33]#30199L, MS[34]#30200L, MS[35]#30201L, MS[36]#30202L, MS[37]#30203L, MS[38]#30204L, MS[39]#30205L, MS[40]#30206L, MS[41]#30207L, MS[42]#30208L, MS[43]#30209L, MS[44]#30210L, MS[45]#30211L, MS[46]#30212L, MS[47]#30213L, MS[48]#30214L, MS[49]#30215L, MS[50]#30216L, MS[51]#30217L, sum#30332L, sum#30333, sum#30334, count#30335L]
(5) Exchange
Input [59]: [segment#30099, processing_day#30101, count#30331L, MS[0]#30166L, MS[1]#30167L, MS[2]#30168L, MS[3]#30169L, MS[4]#30170L, MS[5]#30171L, MS[6]#30172L, MS[7]#30173L, MS[8]#30174L, MS[9]#30175L, MS[10]#30176L, MS[11]#30177L, MS[12]#30178L, MS[13]#30179L, MS[14]#30180L, MS[15]#30181L, MS[16]#30182L, MS[17]#30183L, MS[18]#30184L, MS[19]#30185L, MS[20]#30186L, MS[21]#30187L, MS[22]#30188L, MS[23]#30189L, MS[24]#30190L, MS[25]#30191L, MS[26]#30192L, MS[27]#30193L, MS[28]#30194L, MS[29]#30195L, MS[30]#30196L, MS[31]#30197L, MS[32]#30198L, MS[33]#30199L, MS[34]#30200L, MS[35]#30201L, MS[36]#30202L, MS[37]#30203L, MS[38]#30204L, MS[39]#30205L, MS[40]#30206L, MS[41]#30207L, MS[42]#30208L, MS[43]#30209L, MS[44]#30210L, MS[45]#30211L, MS[46]#30212L, MS[47]#30213L, MS[48]#30214L, MS[49]#30215L, MS[50]#30216L, MS[51]#30217L, sum#30332L, sum#30333, sum#30334, count#30335L]
Arguments: hashpartitioning(segment#30099, processing_day#30101, 200), ENSURE_REQUIREMENTS, [plan_id=2871]
(6) ShuffleQueryStage
Output [59]: [segment#30099, processing_day#30101, count#30331L, MS[0]#30166L, MS[1]#30167L, MS[2]#30168L, MS[3]#30169L, MS[4]#30170L, MS[5]#30171L, MS[6]#30172L, MS[7]#30173L, MS[8]#30174L, MS[9]#30175L, MS[10]#30176L, MS[11]#30177L, MS[12]#30178L, MS[13]#30179L, MS[14]#30180L, MS[15]#30181L, MS[16]#30182L, MS[17]#30183L, MS[18]#30184L, MS[19]#30185L, MS[20]#30186L, MS[21]#30187L, MS[22]#30188L, MS[23]#30189L, MS[24]#30190L, MS[25]#30191L, MS[26]#30192L, MS[27]#30193L, MS[28]#30194L, MS[29]#30195L, MS[30]#30196L, MS[31]#30197L, MS[32]#30198L, MS[33]#30199L, MS[34]#30200L, MS[35]#30201L, MS[36]#30202L, MS[37]#30203L, MS[38]#30204L, MS[39]#30205L, MS[40]#30206L, MS[41]#30207L, MS[42]#30208L, MS[43]#30209L, MS[44]#30210L, MS[45]#30211L, MS[46]#30212L, MS[47]#30213L, MS[48]#30214L, MS[49]#30215L, MS[50]#30216L, MS[51]#30217L, sum#30332L, sum#30333, sum#30334, count#30335L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#30099, processing_day#30101, count#30331L, MS[0]#30166L, MS[1]#30167L, MS[2]#30168L, MS[3]#30169L, MS[4]#30170L, MS[5]#30171L, MS[6]#30172L, MS[7]#30173L, MS[8]#30174L, MS[9]#30175L, MS[10]#30176L, MS[11]#30177L, MS[12]#30178L, MS[13]#30179L, MS[14]#30180L, MS[15]#30181L, MS[16]#30182L, MS[17]#30183L, MS[18]#30184L, MS[19]#30185L, MS[20]#30186L, MS[21]#30187L, MS[22]#30188L, MS[23]#30189L, MS[24]#30190L, MS[25]#30191L, MS[26]#30192L, MS[27]#30193L, MS[28]#30194L, MS[29]#30195L, MS[30]#30196L, MS[31]#30197L, MS[32]#30198L, MS[33]#30199L, MS[34]#30200L, MS[35]#30201L, MS[36]#30202L, MS[37]#30203L, MS[38]#30204L, MS[39]#30205L, MS[40]#30206L, MS[41]#30207L, MS[42]#30208L, MS[43]#30209L, MS[44]#30210L, MS[45]#30211L, MS[46]#30212L, MS[47]#30213L, MS[48]#30214L, MS[49]#30215L, MS[50]#30216L, MS[51]#30217L, sum#30332L, sum#30333, sum#30334, count#30335L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#30099, processing_day#30101, count#30331L, MS[0]#30166L, MS[1]#30167L, MS[2]#30168L, MS[3]#30169L, MS[4]#30170L, MS[5]#30171L, MS[6]#30172L, MS[7]#30173L, MS[8]#30174L, MS[9]#30175L, MS[10]#30176L, MS[11]#30177L, MS[12]#30178L, MS[13]#30179L, MS[14]#30180L, MS[15]#30181L, MS[16]#30182L, MS[17]#30183L, MS[18]#30184L, MS[19]#30185L, MS[20]#30186L, MS[21]#30187L, MS[22]#30188L, MS[23]#30189L, MS[24]#30190L, MS[25]#30191L, MS[26]#30192L, MS[27]#30193L, MS[28]#30194L, MS[29]#30195L, MS[30]#30196L, MS[31]#30197L, MS[32]#30198L, MS[33]#30199L, MS[34]#30200L, MS[35]#30201L, MS[36]#30202L, MS[37]#30203L, MS[38]#30204L, MS[39]#30205L, MS[40]#30206L, MS[41]#30207L, MS[42]#30208L, MS[43]#30209L, MS[44]#30210L, MS[45]#30211L, MS[46]#30212L, MS[47]#30213L, MS[48]#30214L, MS[49]#30215L, MS[50]#30216L, MS[51]#30217L, sum#30332L, sum#30333, sum#30334, count#30335L]
Keys [2]: [segment#30099, processing_day#30101]
Functions [5]: [count(1), approx_count_distinct(customer_id#30095L, 0.05, 0, 0), sum(events#30105), sum(weighted_amount#30107), avg(amount#30103)]
Aggregate Attributes [5]: [count(1)#30113L, approx_count_distinct(customer_id#30095L, 0.05, 0, 0)#30218L, sum(events#30105)#30219L, sum(weighted_amount#30107)#30220, avg(amount#30103)#30221]
Results [7]: [segment#30099, processing_day#30101, count(1)#30113L AS row_count#30108L, approx_count_distinct(customer_id#30095L, 0.05, 0, 0)#30218L AS unique_customers#30109L, sum(events#30105)#30219L AS event_sum#30110L, sum(weighted_amount#30107)#30220 AS weighted_amount_sum#30111, avg(amount#30103)#30221 AS avg_amount#30112]
(9) Exchange
Input [7]: [segment#30099, processing_day#30101, row_count#30108L, unique_customers#30109L, event_sum#30110L, weighted_amount_sum#30111, avg_amount#30112]
Arguments: rangepartitioning(segment#30099 ASC NULLS FIRST, processing_day#30101 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2893]
(10) ShuffleQueryStage
Output [7]: [segment#30099, processing_day#30101, row_count#30108L, unique_customers#30109L, event_sum#30110L, weighted_amount_sum#30111, avg_amount#30112]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#30099, processing_day#30101, row_count#30108L, unique_customers#30109L, event_sum#30110L, weighted_amount_sum#30111, avg_amount#30112]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#30099, processing_day#30101, row_count#30108L, unique_customers#30109L, event_sum#30110L, weighted_amount_sum#30111, avg_amount#30112]
Arguments: [segment#30099 ASC NULLS FIRST, processing_day#30101 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#30099, processing_day#30101, row_count#30108L, unique_customers#30109L, event_sum#30110L, weighted_amount_sum#30111, avg_amount#30112]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#30095L, segment#30099, processing_day#30101, amount#30103, events#30105, weighted_amount#30107]
Keys [2]: [segment#30099, processing_day#30101]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#30095L, 0.05, 0, 0), partial_sum(events#30105), partial_sum(weighted_amount#30107), partial_avg(amount#30103)]
Aggregate Attributes [57]: [count#30326L, MS[0]#30114L, MS[1]#30115L, MS[2]#30116L, MS[3]#30117L, MS[4]#30118L, MS[5]#30119L, MS[6]#30120L, MS[7]#30121L, MS[8]#30122L, MS[9]#30123L, MS[10]#30124L, MS[11]#30125L, MS[12]#30126L, MS[13]#30127L, MS[14]#30128L, MS[15]#30129L, MS[16]#30130L, MS[17]#30131L, MS[18]#30132L, MS[19]#30133L, MS[20]#30134L, MS[21]#30135L, MS[22]#30136L, MS[23]#30137L, MS[24]#30138L, MS[25]#30139L, MS[26]#30140L, MS[27]#30141L, MS[28]#30142L, MS[29]#30143L, MS[30]#30144L, MS[31]#30145L, MS[32]#30146L, MS[33]#30147L, MS[34]#30148L, MS[35]#30149L, MS[36]#30150L, MS[37]#30151L, MS[38]#30152L, MS[39]#30153L, MS[40]#30154L, MS[41]#30155L, MS[42]#30156L, MS[43]#30157L, MS[44]#30158L, MS[45]#30159L, MS[46]#30160L, MS[47]#30161L, MS[48]#30162L, MS[49]#30163L, MS[50]#30164L, MS[51]#30165L, sum#30327L, sum#30328, sum#30329, count#30330L]
Results [59]: [segment#30099, processing_day#30101, count#30331L, MS[0]#30166L, MS[1]#30167L, MS[2]#30168L, MS[3]#30169L, MS[4]#30170L, MS[5]#30171L, MS[6]#30172L, MS[7]#30173L, MS[8]#30174L, MS[9]#30175L, MS[10]#30176L, MS[11]#30177L, MS[12]#30178L, MS[13]#30179L, MS[14]#30180L, MS[15]#30181L, MS[16]#30182L, MS[17]#30183L, MS[18]#30184L, MS[19]#30185L, MS[20]#30186L, MS[21]#30187L, MS[22]#30188L, MS[23]#30189L, MS[24]#30190L, MS[25]#30191L, MS[26]#30192L, MS[27]#30193L, MS[28]#30194L, MS[29]#30195L, MS[30]#30196L, MS[31]#30197L, MS[32]#30198L, MS[33]#30199L, MS[34]#30200L, MS[35]#30201L, MS[36]#30202L, MS[37]#30203L, MS[38]#30204L, MS[39]#30205L, MS[40]#30206L, MS[41]#30207L, MS[42]#30208L, MS[43]#30209L, MS[44]#30210L, MS[45]#30211L, MS[46]#30212L, MS[47]#30213L, MS[48]#30214L, MS[49]#30215L, MS[50]#30216L, MS[51]#30217L, sum#30332L, sum#30333, sum#30334, count#30335L]
(15) Exchange
Input [59]: [segment#30099, processing_day#30101, count#30331L, MS[0]#30166L, MS[1]#30167L, MS[2]#30168L, MS[3]#30169L, MS[4]#30170L, MS[5]#30171L, MS[6]#30172L, MS[7]#30173L, MS[8]#30174L, MS[9]#30175L, MS[10]#30176L, MS[11]#30177L, MS[12]#30178L, MS[13]#30179L, MS[14]#30180L, MS[15]#30181L, MS[16]#30182L, MS[17]#30183L, MS[18]#30184L, MS[19]#30185L, MS[20]#30186L, MS[21]#30187L, MS[22]#30188L, MS[23]#30189L, MS[24]#30190L, MS[25]#30191L, MS[26]#30192L, MS[27]#30193L, MS[28]#30194L, MS[29]#30195L, MS[30]#30196L, MS[31]#30197L, MS[32]#30198L, MS[33]#30199L, MS[34]#30200L, MS[35]#30201L, MS[36]#30202L, MS[37]#30203L, MS[38]#30204L, MS[39]#30205L, MS[40]#30206L, MS[41]#30207L, MS[42]#30208L, MS[43]#30209L, MS[44]#30210L, MS[45]#30211L, MS[46]#30212L, MS[47]#30213L, MS[48]#30214L, MS[49]#30215L, MS[50]#30216L, MS[51]#30217L, sum#30332L, sum#30333, sum#30334, count#30335L]
Arguments: hashpartitioning(segment#30099, processing_day#30101, 200), ENSURE_REQUIREMENTS, [plan_id=2851]
(16) HashAggregate
Input [59]: [segment#30099, processing_day#30101, count#30331L, MS[0]#30166L, MS[1]#30167L, MS[2]#30168L, MS[3]#30169L, MS[4]#30170L, MS[5]#30171L, MS[6]#30172L, MS[7]#30173L, MS[8]#30174L, MS[9]#30175L, MS[10]#30176L, MS[11]#30177L, MS[12]#30178L, MS[13]#30179L, MS[14]#30180L, MS[15]#30181L, MS[16]#30182L, MS[17]#30183L, MS[18]#30184L, MS[19]#30185L, MS[20]#30186L, MS[21]#30187L, MS[22]#30188L, MS[23]#30189L, MS[24]#30190L, MS[25]#30191L, MS[26]#30192L, MS[27]#30193L, MS[28]#30194L, MS[29]#30195L, MS[30]#30196L, MS[31]#30197L, MS[32]#30198L, MS[33]#30199L, MS[34]#30200L, MS[35]#30201L, MS[36]#30202L, MS[37]#30203L, MS[38]#30204L, MS[39]#30205L, MS[40]#30206L, MS[41]#30207L, MS[42]#30208L, MS[43]#30209L, MS[44]#30210L, MS[45]#30211L, MS[46]#30212L, MS[47]#30213L, MS[48]#30214L, MS[49]#30215L, MS[50]#30216L, MS[51]#30217L, sum#30332L, sum#30333, sum#30334, count#30335L]
Keys [2]: [segment#30099, processing_day#30101]
Functions [5]: [count(1), approx_count_distinct(customer_id#30095L, 0.05, 0, 0), sum(events#30105), sum(weighted_amount#30107), avg(amount#30103)]
Aggregate Attributes [5]: [count(1)#30113L, approx_count_distinct(customer_id#30095L, 0.05, 0, 0)#30218L, sum(events#30105)#30219L, sum(weighted_amount#30107)#30220, avg(amount#30103)#30221]
Results [7]: [segment#30099, processing_day#30101, count(1)#30113L AS row_count#30108L, approx_count_distinct(customer_id#30095L, 0.05, 0, 0)#30218L AS unique_customers#30109L, sum(events#30105)#30219L AS event_sum#30110L, sum(weighted_amount#30107)#30220 AS weighted_amount_sum#30111, avg(amount#30103)#30221 AS avg_amount#30112]
(17) Exchange
Input [7]: [segment#30099, processing_day#30101, row_count#30108L, unique_customers#30109L, event_sum#30110L, weighted_amount_sum#30111, avg_amount#30112]
Arguments: rangepartitioning(segment#30099 ASC NULLS FIRST, processing_day#30101 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2854]
(18) Sort
Input [7]: [segment#30099, processing_day#30101, row_count#30108L, unique_customers#30109L, event_sum#30110L, weighted_amount_sum#30111, avg_amount#30112]
Arguments: [segment#30099 ASC NULLS FIRST, processing_day#30101 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#30099, processing_day#30101, row_count#30108L, unique_customers#30109L, event_sum#30110L, weighted_amount_sum#30111, avg_amount#30112]
Arguments: isFinalPlan=true