== 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#68173L]
Arguments: Range (5000000, 6000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#68173L % 250000) AS customer_id#68175L, concat(segment-, cast(cast((id#68173L % 12) as int) as string)) AS segment#68179, cast((id#68173L % 14) as int) AS processing_day#68181, ((cast(((id#68173L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#68183, cast((((id#68173L * 29) % 7) + 1) as int) AS events#68185]
Input [1]: [id#68173L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#68175L, segment#68179, processing_day#68181, amount#68183, events#68185, (amount#68183 * cast(events#68185 as double)) AS weighted_amount#68187]
Input [5]: [customer_id#68175L, segment#68179, processing_day#68181, amount#68183, events#68185]
(4) HashAggregate
Input [6]: [customer_id#68175L, segment#68179, processing_day#68181, amount#68183, events#68185, weighted_amount#68187]
Keys [2]: [segment#68179, processing_day#68181]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#68175L, 0.05, 0, 0), partial_sum(events#68185), partial_sum(weighted_amount#68187), partial_avg(amount#68183)]
Aggregate Attributes [57]: [count#68406L, MS[0]#68194L, MS[1]#68195L, MS[2]#68196L, MS[3]#68197L, MS[4]#68198L, MS[5]#68199L, MS[6]#68200L, MS[7]#68201L, MS[8]#68202L, MS[9]#68203L, MS[10]#68204L, MS[11]#68205L, MS[12]#68206L, MS[13]#68207L, MS[14]#68208L, MS[15]#68209L, MS[16]#68210L, MS[17]#68211L, MS[18]#68212L, MS[19]#68213L, MS[20]#68214L, MS[21]#68215L, MS[22]#68216L, MS[23]#68217L, MS[24]#68218L, MS[25]#68219L, MS[26]#68220L, MS[27]#68221L, MS[28]#68222L, MS[29]#68223L, MS[30]#68224L, MS[31]#68225L, MS[32]#68226L, MS[33]#68227L, MS[34]#68228L, MS[35]#68229L, MS[36]#68230L, MS[37]#68231L, MS[38]#68232L, MS[39]#68233L, MS[40]#68234L, MS[41]#68235L, MS[42]#68236L, MS[43]#68237L, MS[44]#68238L, MS[45]#68239L, MS[46]#68240L, MS[47]#68241L, MS[48]#68242L, MS[49]#68243L, MS[50]#68244L, MS[51]#68245L, sum#68407L, sum#68408, sum#68409, count#68410L]
Results [59]: [segment#68179, processing_day#68181, count#68411L, MS[0]#68246L, MS[1]#68247L, MS[2]#68248L, MS[3]#68249L, MS[4]#68250L, MS[5]#68251L, MS[6]#68252L, MS[7]#68253L, MS[8]#68254L, MS[9]#68255L, MS[10]#68256L, MS[11]#68257L, MS[12]#68258L, MS[13]#68259L, MS[14]#68260L, MS[15]#68261L, MS[16]#68262L, MS[17]#68263L, MS[18]#68264L, MS[19]#68265L, MS[20]#68266L, MS[21]#68267L, MS[22]#68268L, MS[23]#68269L, MS[24]#68270L, MS[25]#68271L, MS[26]#68272L, MS[27]#68273L, MS[28]#68274L, MS[29]#68275L, MS[30]#68276L, MS[31]#68277L, MS[32]#68278L, MS[33]#68279L, MS[34]#68280L, MS[35]#68281L, MS[36]#68282L, MS[37]#68283L, MS[38]#68284L, MS[39]#68285L, MS[40]#68286L, MS[41]#68287L, MS[42]#68288L, MS[43]#68289L, MS[44]#68290L, MS[45]#68291L, MS[46]#68292L, MS[47]#68293L, MS[48]#68294L, MS[49]#68295L, MS[50]#68296L, MS[51]#68297L, sum#68412L, sum#68413, sum#68414, count#68415L]
(5) Exchange
Input [59]: [segment#68179, processing_day#68181, count#68411L, MS[0]#68246L, MS[1]#68247L, MS[2]#68248L, MS[3]#68249L, MS[4]#68250L, MS[5]#68251L, MS[6]#68252L, MS[7]#68253L, MS[8]#68254L, MS[9]#68255L, MS[10]#68256L, MS[11]#68257L, MS[12]#68258L, MS[13]#68259L, MS[14]#68260L, MS[15]#68261L, MS[16]#68262L, MS[17]#68263L, MS[18]#68264L, MS[19]#68265L, MS[20]#68266L, MS[21]#68267L, MS[22]#68268L, MS[23]#68269L, MS[24]#68270L, MS[25]#68271L, MS[26]#68272L, MS[27]#68273L, MS[28]#68274L, MS[29]#68275L, MS[30]#68276L, MS[31]#68277L, MS[32]#68278L, MS[33]#68279L, MS[34]#68280L, MS[35]#68281L, MS[36]#68282L, MS[37]#68283L, MS[38]#68284L, MS[39]#68285L, MS[40]#68286L, MS[41]#68287L, MS[42]#68288L, MS[43]#68289L, MS[44]#68290L, MS[45]#68291L, MS[46]#68292L, MS[47]#68293L, MS[48]#68294L, MS[49]#68295L, MS[50]#68296L, MS[51]#68297L, sum#68412L, sum#68413, sum#68414, count#68415L]
Arguments: hashpartitioning(segment#68179, processing_day#68181, 200), ENSURE_REQUIREMENTS, [plan_id=6452]
(6) ShuffleQueryStage
Output [59]: [segment#68179, processing_day#68181, count#68411L, MS[0]#68246L, MS[1]#68247L, MS[2]#68248L, MS[3]#68249L, MS[4]#68250L, MS[5]#68251L, MS[6]#68252L, MS[7]#68253L, MS[8]#68254L, MS[9]#68255L, MS[10]#68256L, MS[11]#68257L, MS[12]#68258L, MS[13]#68259L, MS[14]#68260L, MS[15]#68261L, MS[16]#68262L, MS[17]#68263L, MS[18]#68264L, MS[19]#68265L, MS[20]#68266L, MS[21]#68267L, MS[22]#68268L, MS[23]#68269L, MS[24]#68270L, MS[25]#68271L, MS[26]#68272L, MS[27]#68273L, MS[28]#68274L, MS[29]#68275L, MS[30]#68276L, MS[31]#68277L, MS[32]#68278L, MS[33]#68279L, MS[34]#68280L, MS[35]#68281L, MS[36]#68282L, MS[37]#68283L, MS[38]#68284L, MS[39]#68285L, MS[40]#68286L, MS[41]#68287L, MS[42]#68288L, MS[43]#68289L, MS[44]#68290L, MS[45]#68291L, MS[46]#68292L, MS[47]#68293L, MS[48]#68294L, MS[49]#68295L, MS[50]#68296L, MS[51]#68297L, sum#68412L, sum#68413, sum#68414, count#68415L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#68179, processing_day#68181, count#68411L, MS[0]#68246L, MS[1]#68247L, MS[2]#68248L, MS[3]#68249L, MS[4]#68250L, MS[5]#68251L, MS[6]#68252L, MS[7]#68253L, MS[8]#68254L, MS[9]#68255L, MS[10]#68256L, MS[11]#68257L, MS[12]#68258L, MS[13]#68259L, MS[14]#68260L, MS[15]#68261L, MS[16]#68262L, MS[17]#68263L, MS[18]#68264L, MS[19]#68265L, MS[20]#68266L, MS[21]#68267L, MS[22]#68268L, MS[23]#68269L, MS[24]#68270L, MS[25]#68271L, MS[26]#68272L, MS[27]#68273L, MS[28]#68274L, MS[29]#68275L, MS[30]#68276L, MS[31]#68277L, MS[32]#68278L, MS[33]#68279L, MS[34]#68280L, MS[35]#68281L, MS[36]#68282L, MS[37]#68283L, MS[38]#68284L, MS[39]#68285L, MS[40]#68286L, MS[41]#68287L, MS[42]#68288L, MS[43]#68289L, MS[44]#68290L, MS[45]#68291L, MS[46]#68292L, MS[47]#68293L, MS[48]#68294L, MS[49]#68295L, MS[50]#68296L, MS[51]#68297L, sum#68412L, sum#68413, sum#68414, count#68415L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#68179, processing_day#68181, count#68411L, MS[0]#68246L, MS[1]#68247L, MS[2]#68248L, MS[3]#68249L, MS[4]#68250L, MS[5]#68251L, MS[6]#68252L, MS[7]#68253L, MS[8]#68254L, MS[9]#68255L, MS[10]#68256L, MS[11]#68257L, MS[12]#68258L, MS[13]#68259L, MS[14]#68260L, MS[15]#68261L, MS[16]#68262L, MS[17]#68263L, MS[18]#68264L, MS[19]#68265L, MS[20]#68266L, MS[21]#68267L, MS[22]#68268L, MS[23]#68269L, MS[24]#68270L, MS[25]#68271L, MS[26]#68272L, MS[27]#68273L, MS[28]#68274L, MS[29]#68275L, MS[30]#68276L, MS[31]#68277L, MS[32]#68278L, MS[33]#68279L, MS[34]#68280L, MS[35]#68281L, MS[36]#68282L, MS[37]#68283L, MS[38]#68284L, MS[39]#68285L, MS[40]#68286L, MS[41]#68287L, MS[42]#68288L, MS[43]#68289L, MS[44]#68290L, MS[45]#68291L, MS[46]#68292L, MS[47]#68293L, MS[48]#68294L, MS[49]#68295L, MS[50]#68296L, MS[51]#68297L, sum#68412L, sum#68413, sum#68414, count#68415L]
Keys [2]: [segment#68179, processing_day#68181]
Functions [5]: [count(1), approx_count_distinct(customer_id#68175L, 0.05, 0, 0), sum(events#68185), sum(weighted_amount#68187), avg(amount#68183)]
Aggregate Attributes [5]: [count(1)#68193L, approx_count_distinct(customer_id#68175L, 0.05, 0, 0)#68298L, sum(events#68185)#68299L, sum(weighted_amount#68187)#68300, avg(amount#68183)#68301]
Results [7]: [segment#68179, processing_day#68181, count(1)#68193L AS row_count#68188L, approx_count_distinct(customer_id#68175L, 0.05, 0, 0)#68298L AS unique_customers#68189L, sum(events#68185)#68299L AS event_sum#68190L, sum(weighted_amount#68187)#68300 AS weighted_amount_sum#68191, avg(amount#68183)#68301 AS avg_amount#68192]
(9) Exchange
Input [7]: [segment#68179, processing_day#68181, row_count#68188L, unique_customers#68189L, event_sum#68190L, weighted_amount_sum#68191, avg_amount#68192]
Arguments: rangepartitioning(segment#68179 ASC NULLS FIRST, processing_day#68181 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=6474]
(10) ShuffleQueryStage
Output [7]: [segment#68179, processing_day#68181, row_count#68188L, unique_customers#68189L, event_sum#68190L, weighted_amount_sum#68191, avg_amount#68192]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#68179, processing_day#68181, row_count#68188L, unique_customers#68189L, event_sum#68190L, weighted_amount_sum#68191, avg_amount#68192]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#68179, processing_day#68181, row_count#68188L, unique_customers#68189L, event_sum#68190L, weighted_amount_sum#68191, avg_amount#68192]
Arguments: [segment#68179 ASC NULLS FIRST, processing_day#68181 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#68179, processing_day#68181, row_count#68188L, unique_customers#68189L, event_sum#68190L, weighted_amount_sum#68191, avg_amount#68192]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#68175L, segment#68179, processing_day#68181, amount#68183, events#68185, weighted_amount#68187]
Keys [2]: [segment#68179, processing_day#68181]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#68175L, 0.05, 0, 0), partial_sum(events#68185), partial_sum(weighted_amount#68187), partial_avg(amount#68183)]
Aggregate Attributes [57]: [count#68406L, MS[0]#68194L, MS[1]#68195L, MS[2]#68196L, MS[3]#68197L, MS[4]#68198L, MS[5]#68199L, MS[6]#68200L, MS[7]#68201L, MS[8]#68202L, MS[9]#68203L, MS[10]#68204L, MS[11]#68205L, MS[12]#68206L, MS[13]#68207L, MS[14]#68208L, MS[15]#68209L, MS[16]#68210L, MS[17]#68211L, MS[18]#68212L, MS[19]#68213L, MS[20]#68214L, MS[21]#68215L, MS[22]#68216L, MS[23]#68217L, MS[24]#68218L, MS[25]#68219L, MS[26]#68220L, MS[27]#68221L, MS[28]#68222L, MS[29]#68223L, MS[30]#68224L, MS[31]#68225L, MS[32]#68226L, MS[33]#68227L, MS[34]#68228L, MS[35]#68229L, MS[36]#68230L, MS[37]#68231L, MS[38]#68232L, MS[39]#68233L, MS[40]#68234L, MS[41]#68235L, MS[42]#68236L, MS[43]#68237L, MS[44]#68238L, MS[45]#68239L, MS[46]#68240L, MS[47]#68241L, MS[48]#68242L, MS[49]#68243L, MS[50]#68244L, MS[51]#68245L, sum#68407L, sum#68408, sum#68409, count#68410L]
Results [59]: [segment#68179, processing_day#68181, count#68411L, MS[0]#68246L, MS[1]#68247L, MS[2]#68248L, MS[3]#68249L, MS[4]#68250L, MS[5]#68251L, MS[6]#68252L, MS[7]#68253L, MS[8]#68254L, MS[9]#68255L, MS[10]#68256L, MS[11]#68257L, MS[12]#68258L, MS[13]#68259L, MS[14]#68260L, MS[15]#68261L, MS[16]#68262L, MS[17]#68263L, MS[18]#68264L, MS[19]#68265L, MS[20]#68266L, MS[21]#68267L, MS[22]#68268L, MS[23]#68269L, MS[24]#68270L, MS[25]#68271L, MS[26]#68272L, MS[27]#68273L, MS[28]#68274L, MS[29]#68275L, MS[30]#68276L, MS[31]#68277L, MS[32]#68278L, MS[33]#68279L, MS[34]#68280L, MS[35]#68281L, MS[36]#68282L, MS[37]#68283L, MS[38]#68284L, MS[39]#68285L, MS[40]#68286L, MS[41]#68287L, MS[42]#68288L, MS[43]#68289L, MS[44]#68290L, MS[45]#68291L, MS[46]#68292L, MS[47]#68293L, MS[48]#68294L, MS[49]#68295L, MS[50]#68296L, MS[51]#68297L, sum#68412L, sum#68413, sum#68414, count#68415L]
(15) Exchange
Input [59]: [segment#68179, processing_day#68181, count#68411L, MS[0]#68246L, MS[1]#68247L, MS[2]#68248L, MS[3]#68249L, MS[4]#68250L, MS[5]#68251L, MS[6]#68252L, MS[7]#68253L, MS[8]#68254L, MS[9]#68255L, MS[10]#68256L, MS[11]#68257L, MS[12]#68258L, MS[13]#68259L, MS[14]#68260L, MS[15]#68261L, MS[16]#68262L, MS[17]#68263L, MS[18]#68264L, MS[19]#68265L, MS[20]#68266L, MS[21]#68267L, MS[22]#68268L, MS[23]#68269L, MS[24]#68270L, MS[25]#68271L, MS[26]#68272L, MS[27]#68273L, MS[28]#68274L, MS[29]#68275L, MS[30]#68276L, MS[31]#68277L, MS[32]#68278L, MS[33]#68279L, MS[34]#68280L, MS[35]#68281L, MS[36]#68282L, MS[37]#68283L, MS[38]#68284L, MS[39]#68285L, MS[40]#68286L, MS[41]#68287L, MS[42]#68288L, MS[43]#68289L, MS[44]#68290L, MS[45]#68291L, MS[46]#68292L, MS[47]#68293L, MS[48]#68294L, MS[49]#68295L, MS[50]#68296L, MS[51]#68297L, sum#68412L, sum#68413, sum#68414, count#68415L]
Arguments: hashpartitioning(segment#68179, processing_day#68181, 200), ENSURE_REQUIREMENTS, [plan_id=6432]
(16) HashAggregate
Input [59]: [segment#68179, processing_day#68181, count#68411L, MS[0]#68246L, MS[1]#68247L, MS[2]#68248L, MS[3]#68249L, MS[4]#68250L, MS[5]#68251L, MS[6]#68252L, MS[7]#68253L, MS[8]#68254L, MS[9]#68255L, MS[10]#68256L, MS[11]#68257L, MS[12]#68258L, MS[13]#68259L, MS[14]#68260L, MS[15]#68261L, MS[16]#68262L, MS[17]#68263L, MS[18]#68264L, MS[19]#68265L, MS[20]#68266L, MS[21]#68267L, MS[22]#68268L, MS[23]#68269L, MS[24]#68270L, MS[25]#68271L, MS[26]#68272L, MS[27]#68273L, MS[28]#68274L, MS[29]#68275L, MS[30]#68276L, MS[31]#68277L, MS[32]#68278L, MS[33]#68279L, MS[34]#68280L, MS[35]#68281L, MS[36]#68282L, MS[37]#68283L, MS[38]#68284L, MS[39]#68285L, MS[40]#68286L, MS[41]#68287L, MS[42]#68288L, MS[43]#68289L, MS[44]#68290L, MS[45]#68291L, MS[46]#68292L, MS[47]#68293L, MS[48]#68294L, MS[49]#68295L, MS[50]#68296L, MS[51]#68297L, sum#68412L, sum#68413, sum#68414, count#68415L]
Keys [2]: [segment#68179, processing_day#68181]
Functions [5]: [count(1), approx_count_distinct(customer_id#68175L, 0.05, 0, 0), sum(events#68185), sum(weighted_amount#68187), avg(amount#68183)]
Aggregate Attributes [5]: [count(1)#68193L, approx_count_distinct(customer_id#68175L, 0.05, 0, 0)#68298L, sum(events#68185)#68299L, sum(weighted_amount#68187)#68300, avg(amount#68183)#68301]
Results [7]: [segment#68179, processing_day#68181, count(1)#68193L AS row_count#68188L, approx_count_distinct(customer_id#68175L, 0.05, 0, 0)#68298L AS unique_customers#68189L, sum(events#68185)#68299L AS event_sum#68190L, sum(weighted_amount#68187)#68300 AS weighted_amount_sum#68191, avg(amount#68183)#68301 AS avg_amount#68192]
(17) Exchange
Input [7]: [segment#68179, processing_day#68181, row_count#68188L, unique_customers#68189L, event_sum#68190L, weighted_amount_sum#68191, avg_amount#68192]
Arguments: rangepartitioning(segment#68179 ASC NULLS FIRST, processing_day#68181 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=6435]
(18) Sort
Input [7]: [segment#68179, processing_day#68181, row_count#68188L, unique_customers#68189L, event_sum#68190L, weighted_amount_sum#68191, avg_amount#68192]
Arguments: [segment#68179 ASC NULLS FIRST, processing_day#68181 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#68179, processing_day#68181, row_count#68188L, unique_customers#68189L, event_sum#68190L, weighted_amount_sum#68191, avg_amount#68192]
Arguments: isFinalPlan=true