== 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#14145L]
Arguments: Range (16000000, 17000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#14145L % 250000) AS customer_id#14147L, concat(segment-, cast(cast((id#14145L % 12) as int) as string)) AS segment#14151, cast((id#14145L % 14) as int) AS processing_day#14153, ((cast(((id#14145L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#14155, cast((((id#14145L * 29) % 7) + 1) as int) AS events#14157]
Input [1]: [id#14145L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#14147L, segment#14151, processing_day#14153, amount#14155, events#14157, (amount#14155 * cast(events#14157 as double)) AS weighted_amount#14159]
Input [5]: [customer_id#14147L, segment#14151, processing_day#14153, amount#14155, events#14157]
(4) HashAggregate
Input [6]: [customer_id#14147L, segment#14151, processing_day#14153, amount#14155, events#14157, weighted_amount#14159]
Keys [2]: [segment#14151, processing_day#14153]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#14147L, 0.05, 0, 0), partial_sum(events#14157), partial_sum(weighted_amount#14159), partial_avg(amount#14155)]
Aggregate Attributes [57]: [count#14378L, MS[0]#14166L, MS[1]#14167L, MS[2]#14168L, MS[3]#14169L, MS[4]#14170L, MS[5]#14171L, MS[6]#14172L, MS[7]#14173L, MS[8]#14174L, MS[9]#14175L, MS[10]#14176L, MS[11]#14177L, MS[12]#14178L, MS[13]#14179L, MS[14]#14180L, MS[15]#14181L, MS[16]#14182L, MS[17]#14183L, MS[18]#14184L, MS[19]#14185L, MS[20]#14186L, MS[21]#14187L, MS[22]#14188L, MS[23]#14189L, MS[24]#14190L, MS[25]#14191L, MS[26]#14192L, MS[27]#14193L, MS[28]#14194L, MS[29]#14195L, MS[30]#14196L, MS[31]#14197L, MS[32]#14198L, MS[33]#14199L, MS[34]#14200L, MS[35]#14201L, MS[36]#14202L, MS[37]#14203L, MS[38]#14204L, MS[39]#14205L, MS[40]#14206L, MS[41]#14207L, MS[42]#14208L, MS[43]#14209L, MS[44]#14210L, MS[45]#14211L, MS[46]#14212L, MS[47]#14213L, MS[48]#14214L, MS[49]#14215L, MS[50]#14216L, MS[51]#14217L, sum#14379L, sum#14380, sum#14381, count#14382L]
Results [59]: [segment#14151, processing_day#14153, count#14383L, MS[0]#14218L, MS[1]#14219L, MS[2]#14220L, MS[3]#14221L, MS[4]#14222L, MS[5]#14223L, MS[6]#14224L, MS[7]#14225L, MS[8]#14226L, MS[9]#14227L, MS[10]#14228L, MS[11]#14229L, MS[12]#14230L, MS[13]#14231L, MS[14]#14232L, MS[15]#14233L, MS[16]#14234L, MS[17]#14235L, MS[18]#14236L, MS[19]#14237L, MS[20]#14238L, MS[21]#14239L, MS[22]#14240L, MS[23]#14241L, MS[24]#14242L, MS[25]#14243L, MS[26]#14244L, MS[27]#14245L, MS[28]#14246L, MS[29]#14247L, MS[30]#14248L, MS[31]#14249L, MS[32]#14250L, MS[33]#14251L, MS[34]#14252L, MS[35]#14253L, MS[36]#14254L, MS[37]#14255L, MS[38]#14256L, MS[39]#14257L, MS[40]#14258L, MS[41]#14259L, MS[42]#14260L, MS[43]#14261L, MS[44]#14262L, MS[45]#14263L, MS[46]#14264L, MS[47]#14265L, MS[48]#14266L, MS[49]#14267L, MS[50]#14268L, MS[51]#14269L, sum#14384L, sum#14385, sum#14386, count#14387L]
(5) Exchange
Input [59]: [segment#14151, processing_day#14153, count#14383L, MS[0]#14218L, MS[1]#14219L, MS[2]#14220L, MS[3]#14221L, MS[4]#14222L, MS[5]#14223L, MS[6]#14224L, MS[7]#14225L, MS[8]#14226L, MS[9]#14227L, MS[10]#14228L, MS[11]#14229L, MS[12]#14230L, MS[13]#14231L, MS[14]#14232L, MS[15]#14233L, MS[16]#14234L, MS[17]#14235L, MS[18]#14236L, MS[19]#14237L, MS[20]#14238L, MS[21]#14239L, MS[22]#14240L, MS[23]#14241L, MS[24]#14242L, MS[25]#14243L, MS[26]#14244L, MS[27]#14245L, MS[28]#14246L, MS[29]#14247L, MS[30]#14248L, MS[31]#14249L, MS[32]#14250L, MS[33]#14251L, MS[34]#14252L, MS[35]#14253L, MS[36]#14254L, MS[37]#14255L, MS[38]#14256L, MS[39]#14257L, MS[40]#14258L, MS[41]#14259L, MS[42]#14260L, MS[43]#14261L, MS[44]#14262L, MS[45]#14263L, MS[46]#14264L, MS[47]#14265L, MS[48]#14266L, MS[49]#14267L, MS[50]#14268L, MS[51]#14269L, sum#14384L, sum#14385, sum#14386, count#14387L]
Arguments: hashpartitioning(segment#14151, processing_day#14153, 200), ENSURE_REQUIREMENTS, [plan_id=1371]
(6) ShuffleQueryStage
Output [59]: [segment#14151, processing_day#14153, count#14383L, MS[0]#14218L, MS[1]#14219L, MS[2]#14220L, MS[3]#14221L, MS[4]#14222L, MS[5]#14223L, MS[6]#14224L, MS[7]#14225L, MS[8]#14226L, MS[9]#14227L, MS[10]#14228L, MS[11]#14229L, MS[12]#14230L, MS[13]#14231L, MS[14]#14232L, MS[15]#14233L, MS[16]#14234L, MS[17]#14235L, MS[18]#14236L, MS[19]#14237L, MS[20]#14238L, MS[21]#14239L, MS[22]#14240L, MS[23]#14241L, MS[24]#14242L, MS[25]#14243L, MS[26]#14244L, MS[27]#14245L, MS[28]#14246L, MS[29]#14247L, MS[30]#14248L, MS[31]#14249L, MS[32]#14250L, MS[33]#14251L, MS[34]#14252L, MS[35]#14253L, MS[36]#14254L, MS[37]#14255L, MS[38]#14256L, MS[39]#14257L, MS[40]#14258L, MS[41]#14259L, MS[42]#14260L, MS[43]#14261L, MS[44]#14262L, MS[45]#14263L, MS[46]#14264L, MS[47]#14265L, MS[48]#14266L, MS[49]#14267L, MS[50]#14268L, MS[51]#14269L, sum#14384L, sum#14385, sum#14386, count#14387L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#14151, processing_day#14153, count#14383L, MS[0]#14218L, MS[1]#14219L, MS[2]#14220L, MS[3]#14221L, MS[4]#14222L, MS[5]#14223L, MS[6]#14224L, MS[7]#14225L, MS[8]#14226L, MS[9]#14227L, MS[10]#14228L, MS[11]#14229L, MS[12]#14230L, MS[13]#14231L, MS[14]#14232L, MS[15]#14233L, MS[16]#14234L, MS[17]#14235L, MS[18]#14236L, MS[19]#14237L, MS[20]#14238L, MS[21]#14239L, MS[22]#14240L, MS[23]#14241L, MS[24]#14242L, MS[25]#14243L, MS[26]#14244L, MS[27]#14245L, MS[28]#14246L, MS[29]#14247L, MS[30]#14248L, MS[31]#14249L, MS[32]#14250L, MS[33]#14251L, MS[34]#14252L, MS[35]#14253L, MS[36]#14254L, MS[37]#14255L, MS[38]#14256L, MS[39]#14257L, MS[40]#14258L, MS[41]#14259L, MS[42]#14260L, MS[43]#14261L, MS[44]#14262L, MS[45]#14263L, MS[46]#14264L, MS[47]#14265L, MS[48]#14266L, MS[49]#14267L, MS[50]#14268L, MS[51]#14269L, sum#14384L, sum#14385, sum#14386, count#14387L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#14151, processing_day#14153, count#14383L, MS[0]#14218L, MS[1]#14219L, MS[2]#14220L, MS[3]#14221L, MS[4]#14222L, MS[5]#14223L, MS[6]#14224L, MS[7]#14225L, MS[8]#14226L, MS[9]#14227L, MS[10]#14228L, MS[11]#14229L, MS[12]#14230L, MS[13]#14231L, MS[14]#14232L, MS[15]#14233L, MS[16]#14234L, MS[17]#14235L, MS[18]#14236L, MS[19]#14237L, MS[20]#14238L, MS[21]#14239L, MS[22]#14240L, MS[23]#14241L, MS[24]#14242L, MS[25]#14243L, MS[26]#14244L, MS[27]#14245L, MS[28]#14246L, MS[29]#14247L, MS[30]#14248L, MS[31]#14249L, MS[32]#14250L, MS[33]#14251L, MS[34]#14252L, MS[35]#14253L, MS[36]#14254L, MS[37]#14255L, MS[38]#14256L, MS[39]#14257L, MS[40]#14258L, MS[41]#14259L, MS[42]#14260L, MS[43]#14261L, MS[44]#14262L, MS[45]#14263L, MS[46]#14264L, MS[47]#14265L, MS[48]#14266L, MS[49]#14267L, MS[50]#14268L, MS[51]#14269L, sum#14384L, sum#14385, sum#14386, count#14387L]
Keys [2]: [segment#14151, processing_day#14153]
Functions [5]: [count(1), approx_count_distinct(customer_id#14147L, 0.05, 0, 0), sum(events#14157), sum(weighted_amount#14159), avg(amount#14155)]
Aggregate Attributes [5]: [count(1)#14165L, approx_count_distinct(customer_id#14147L, 0.05, 0, 0)#14270L, sum(events#14157)#14271L, sum(weighted_amount#14159)#14272, avg(amount#14155)#14273]
Results [7]: [segment#14151, processing_day#14153, count(1)#14165L AS row_count#14160L, approx_count_distinct(customer_id#14147L, 0.05, 0, 0)#14270L AS unique_customers#14161L, sum(events#14157)#14271L AS event_sum#14162L, sum(weighted_amount#14159)#14272 AS weighted_amount_sum#14163, avg(amount#14155)#14273 AS avg_amount#14164]
(9) Exchange
Input [7]: [segment#14151, processing_day#14153, row_count#14160L, unique_customers#14161L, event_sum#14162L, weighted_amount_sum#14163, avg_amount#14164]
Arguments: rangepartitioning(segment#14151 ASC NULLS FIRST, processing_day#14153 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1393]
(10) ShuffleQueryStage
Output [7]: [segment#14151, processing_day#14153, row_count#14160L, unique_customers#14161L, event_sum#14162L, weighted_amount_sum#14163, avg_amount#14164]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#14151, processing_day#14153, row_count#14160L, unique_customers#14161L, event_sum#14162L, weighted_amount_sum#14163, avg_amount#14164]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#14151, processing_day#14153, row_count#14160L, unique_customers#14161L, event_sum#14162L, weighted_amount_sum#14163, avg_amount#14164]
Arguments: [segment#14151 ASC NULLS FIRST, processing_day#14153 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#14151, processing_day#14153, row_count#14160L, unique_customers#14161L, event_sum#14162L, weighted_amount_sum#14163, avg_amount#14164]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#14147L, segment#14151, processing_day#14153, amount#14155, events#14157, weighted_amount#14159]
Keys [2]: [segment#14151, processing_day#14153]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#14147L, 0.05, 0, 0), partial_sum(events#14157), partial_sum(weighted_amount#14159), partial_avg(amount#14155)]
Aggregate Attributes [57]: [count#14378L, MS[0]#14166L, MS[1]#14167L, MS[2]#14168L, MS[3]#14169L, MS[4]#14170L, MS[5]#14171L, MS[6]#14172L, MS[7]#14173L, MS[8]#14174L, MS[9]#14175L, MS[10]#14176L, MS[11]#14177L, MS[12]#14178L, MS[13]#14179L, MS[14]#14180L, MS[15]#14181L, MS[16]#14182L, MS[17]#14183L, MS[18]#14184L, MS[19]#14185L, MS[20]#14186L, MS[21]#14187L, MS[22]#14188L, MS[23]#14189L, MS[24]#14190L, MS[25]#14191L, MS[26]#14192L, MS[27]#14193L, MS[28]#14194L, MS[29]#14195L, MS[30]#14196L, MS[31]#14197L, MS[32]#14198L, MS[33]#14199L, MS[34]#14200L, MS[35]#14201L, MS[36]#14202L, MS[37]#14203L, MS[38]#14204L, MS[39]#14205L, MS[40]#14206L, MS[41]#14207L, MS[42]#14208L, MS[43]#14209L, MS[44]#14210L, MS[45]#14211L, MS[46]#14212L, MS[47]#14213L, MS[48]#14214L, MS[49]#14215L, MS[50]#14216L, MS[51]#14217L, sum#14379L, sum#14380, sum#14381, count#14382L]
Results [59]: [segment#14151, processing_day#14153, count#14383L, MS[0]#14218L, MS[1]#14219L, MS[2]#14220L, MS[3]#14221L, MS[4]#14222L, MS[5]#14223L, MS[6]#14224L, MS[7]#14225L, MS[8]#14226L, MS[9]#14227L, MS[10]#14228L, MS[11]#14229L, MS[12]#14230L, MS[13]#14231L, MS[14]#14232L, MS[15]#14233L, MS[16]#14234L, MS[17]#14235L, MS[18]#14236L, MS[19]#14237L, MS[20]#14238L, MS[21]#14239L, MS[22]#14240L, MS[23]#14241L, MS[24]#14242L, MS[25]#14243L, MS[26]#14244L, MS[27]#14245L, MS[28]#14246L, MS[29]#14247L, MS[30]#14248L, MS[31]#14249L, MS[32]#14250L, MS[33]#14251L, MS[34]#14252L, MS[35]#14253L, MS[36]#14254L, MS[37]#14255L, MS[38]#14256L, MS[39]#14257L, MS[40]#14258L, MS[41]#14259L, MS[42]#14260L, MS[43]#14261L, MS[44]#14262L, MS[45]#14263L, MS[46]#14264L, MS[47]#14265L, MS[48]#14266L, MS[49]#14267L, MS[50]#14268L, MS[51]#14269L, sum#14384L, sum#14385, sum#14386, count#14387L]
(15) Exchange
Input [59]: [segment#14151, processing_day#14153, count#14383L, MS[0]#14218L, MS[1]#14219L, MS[2]#14220L, MS[3]#14221L, MS[4]#14222L, MS[5]#14223L, MS[6]#14224L, MS[7]#14225L, MS[8]#14226L, MS[9]#14227L, MS[10]#14228L, MS[11]#14229L, MS[12]#14230L, MS[13]#14231L, MS[14]#14232L, MS[15]#14233L, MS[16]#14234L, MS[17]#14235L, MS[18]#14236L, MS[19]#14237L, MS[20]#14238L, MS[21]#14239L, MS[22]#14240L, MS[23]#14241L, MS[24]#14242L, MS[25]#14243L, MS[26]#14244L, MS[27]#14245L, MS[28]#14246L, MS[29]#14247L, MS[30]#14248L, MS[31]#14249L, MS[32]#14250L, MS[33]#14251L, MS[34]#14252L, MS[35]#14253L, MS[36]#14254L, MS[37]#14255L, MS[38]#14256L, MS[39]#14257L, MS[40]#14258L, MS[41]#14259L, MS[42]#14260L, MS[43]#14261L, MS[44]#14262L, MS[45]#14263L, MS[46]#14264L, MS[47]#14265L, MS[48]#14266L, MS[49]#14267L, MS[50]#14268L, MS[51]#14269L, sum#14384L, sum#14385, sum#14386, count#14387L]
Arguments: hashpartitioning(segment#14151, processing_day#14153, 200), ENSURE_REQUIREMENTS, [plan_id=1351]
(16) HashAggregate
Input [59]: [segment#14151, processing_day#14153, count#14383L, MS[0]#14218L, MS[1]#14219L, MS[2]#14220L, MS[3]#14221L, MS[4]#14222L, MS[5]#14223L, MS[6]#14224L, MS[7]#14225L, MS[8]#14226L, MS[9]#14227L, MS[10]#14228L, MS[11]#14229L, MS[12]#14230L, MS[13]#14231L, MS[14]#14232L, MS[15]#14233L, MS[16]#14234L, MS[17]#14235L, MS[18]#14236L, MS[19]#14237L, MS[20]#14238L, MS[21]#14239L, MS[22]#14240L, MS[23]#14241L, MS[24]#14242L, MS[25]#14243L, MS[26]#14244L, MS[27]#14245L, MS[28]#14246L, MS[29]#14247L, MS[30]#14248L, MS[31]#14249L, MS[32]#14250L, MS[33]#14251L, MS[34]#14252L, MS[35]#14253L, MS[36]#14254L, MS[37]#14255L, MS[38]#14256L, MS[39]#14257L, MS[40]#14258L, MS[41]#14259L, MS[42]#14260L, MS[43]#14261L, MS[44]#14262L, MS[45]#14263L, MS[46]#14264L, MS[47]#14265L, MS[48]#14266L, MS[49]#14267L, MS[50]#14268L, MS[51]#14269L, sum#14384L, sum#14385, sum#14386, count#14387L]
Keys [2]: [segment#14151, processing_day#14153]
Functions [5]: [count(1), approx_count_distinct(customer_id#14147L, 0.05, 0, 0), sum(events#14157), sum(weighted_amount#14159), avg(amount#14155)]
Aggregate Attributes [5]: [count(1)#14165L, approx_count_distinct(customer_id#14147L, 0.05, 0, 0)#14270L, sum(events#14157)#14271L, sum(weighted_amount#14159)#14272, avg(amount#14155)#14273]
Results [7]: [segment#14151, processing_day#14153, count(1)#14165L AS row_count#14160L, approx_count_distinct(customer_id#14147L, 0.05, 0, 0)#14270L AS unique_customers#14161L, sum(events#14157)#14271L AS event_sum#14162L, sum(weighted_amount#14159)#14272 AS weighted_amount_sum#14163, avg(amount#14155)#14273 AS avg_amount#14164]
(17) Exchange
Input [7]: [segment#14151, processing_day#14153, row_count#14160L, unique_customers#14161L, event_sum#14162L, weighted_amount_sum#14163, avg_amount#14164]
Arguments: rangepartitioning(segment#14151 ASC NULLS FIRST, processing_day#14153 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1354]
(18) Sort
Input [7]: [segment#14151, processing_day#14153, row_count#14160L, unique_customers#14161L, event_sum#14162L, weighted_amount_sum#14163, avg_amount#14164]
Arguments: [segment#14151 ASC NULLS FIRST, processing_day#14153 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#14151, processing_day#14153, row_count#14160L, unique_customers#14161L, event_sum#14162L, weighted_amount_sum#14163, avg_amount#14164]
Arguments: isFinalPlan=true