== 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#45155L]
Arguments: Range (3000000, 4000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#45155L % 250000) AS customer_id#45157L, concat(segment-, cast(cast((id#45155L % 12) as int) as string)) AS segment#45161, cast((id#45155L % 14) as int) AS processing_day#45163, ((cast(((id#45155L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#45165, cast((((id#45155L * 29) % 7) + 1) as int) AS events#45167]
Input [1]: [id#45155L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#45157L, segment#45161, processing_day#45163, amount#45165, events#45167, (amount#45165 * cast(events#45167 as double)) AS weighted_amount#45169]
Input [5]: [customer_id#45157L, segment#45161, processing_day#45163, amount#45165, events#45167]
(4) HashAggregate
Input [6]: [customer_id#45157L, segment#45161, processing_day#45163, amount#45165, events#45167, weighted_amount#45169]
Keys [2]: [segment#45161, processing_day#45163]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#45157L, 0.05, 0, 0), partial_sum(events#45167), partial_sum(weighted_amount#45169), partial_avg(amount#45165)]
Aggregate Attributes [57]: [count#45388L, MS[0]#45176L, MS[1]#45177L, MS[2]#45178L, MS[3]#45179L, MS[4]#45180L, MS[5]#45181L, MS[6]#45182L, MS[7]#45183L, MS[8]#45184L, MS[9]#45185L, MS[10]#45186L, MS[11]#45187L, MS[12]#45188L, MS[13]#45189L, MS[14]#45190L, MS[15]#45191L, MS[16]#45192L, MS[17]#45193L, MS[18]#45194L, MS[19]#45195L, MS[20]#45196L, MS[21]#45197L, MS[22]#45198L, MS[23]#45199L, MS[24]#45200L, MS[25]#45201L, MS[26]#45202L, MS[27]#45203L, MS[28]#45204L, MS[29]#45205L, MS[30]#45206L, MS[31]#45207L, MS[32]#45208L, MS[33]#45209L, MS[34]#45210L, MS[35]#45211L, MS[36]#45212L, MS[37]#45213L, MS[38]#45214L, MS[39]#45215L, MS[40]#45216L, MS[41]#45217L, MS[42]#45218L, MS[43]#45219L, MS[44]#45220L, MS[45]#45221L, MS[46]#45222L, MS[47]#45223L, MS[48]#45224L, MS[49]#45225L, MS[50]#45226L, MS[51]#45227L, sum#45389L, sum#45390, sum#45391, count#45392L]
Results [59]: [segment#45161, processing_day#45163, count#45393L, MS[0]#45228L, MS[1]#45229L, MS[2]#45230L, MS[3]#45231L, MS[4]#45232L, MS[5]#45233L, MS[6]#45234L, MS[7]#45235L, MS[8]#45236L, MS[9]#45237L, MS[10]#45238L, MS[11]#45239L, MS[12]#45240L, MS[13]#45241L, MS[14]#45242L, MS[15]#45243L, MS[16]#45244L, MS[17]#45245L, MS[18]#45246L, MS[19]#45247L, MS[20]#45248L, MS[21]#45249L, MS[22]#45250L, MS[23]#45251L, MS[24]#45252L, MS[25]#45253L, MS[26]#45254L, MS[27]#45255L, MS[28]#45256L, MS[29]#45257L, MS[30]#45258L, MS[31]#45259L, MS[32]#45260L, MS[33]#45261L, MS[34]#45262L, MS[35]#45263L, MS[36]#45264L, MS[37]#45265L, MS[38]#45266L, MS[39]#45267L, MS[40]#45268L, MS[41]#45269L, MS[42]#45270L, MS[43]#45271L, MS[44]#45272L, MS[45]#45273L, MS[46]#45274L, MS[47]#45275L, MS[48]#45276L, MS[49]#45277L, MS[50]#45278L, MS[51]#45279L, sum#45394L, sum#45395, sum#45396, count#45397L]
(5) Exchange
Input [59]: [segment#45161, processing_day#45163, count#45393L, MS[0]#45228L, MS[1]#45229L, MS[2]#45230L, MS[3]#45231L, MS[4]#45232L, MS[5]#45233L, MS[6]#45234L, MS[7]#45235L, MS[8]#45236L, MS[9]#45237L, MS[10]#45238L, MS[11]#45239L, MS[12]#45240L, MS[13]#45241L, MS[14]#45242L, MS[15]#45243L, MS[16]#45244L, MS[17]#45245L, MS[18]#45246L, MS[19]#45247L, MS[20]#45248L, MS[21]#45249L, MS[22]#45250L, MS[23]#45251L, MS[24]#45252L, MS[25]#45253L, MS[26]#45254L, MS[27]#45255L, MS[28]#45256L, MS[29]#45257L, MS[30]#45258L, MS[31]#45259L, MS[32]#45260L, MS[33]#45261L, MS[34]#45262L, MS[35]#45263L, MS[36]#45264L, MS[37]#45265L, MS[38]#45266L, MS[39]#45267L, MS[40]#45268L, MS[41]#45269L, MS[42]#45270L, MS[43]#45271L, MS[44]#45272L, MS[45]#45273L, MS[46]#45274L, MS[47]#45275L, MS[48]#45276L, MS[49]#45277L, MS[50]#45278L, MS[51]#45279L, sum#45394L, sum#45395, sum#45396, count#45397L]
Arguments: hashpartitioning(segment#45161, processing_day#45163, 200), ENSURE_REQUIREMENTS, [plan_id=4288]
(6) ShuffleQueryStage
Output [59]: [segment#45161, processing_day#45163, count#45393L, MS[0]#45228L, MS[1]#45229L, MS[2]#45230L, MS[3]#45231L, MS[4]#45232L, MS[5]#45233L, MS[6]#45234L, MS[7]#45235L, MS[8]#45236L, MS[9]#45237L, MS[10]#45238L, MS[11]#45239L, MS[12]#45240L, MS[13]#45241L, MS[14]#45242L, MS[15]#45243L, MS[16]#45244L, MS[17]#45245L, MS[18]#45246L, MS[19]#45247L, MS[20]#45248L, MS[21]#45249L, MS[22]#45250L, MS[23]#45251L, MS[24]#45252L, MS[25]#45253L, MS[26]#45254L, MS[27]#45255L, MS[28]#45256L, MS[29]#45257L, MS[30]#45258L, MS[31]#45259L, MS[32]#45260L, MS[33]#45261L, MS[34]#45262L, MS[35]#45263L, MS[36]#45264L, MS[37]#45265L, MS[38]#45266L, MS[39]#45267L, MS[40]#45268L, MS[41]#45269L, MS[42]#45270L, MS[43]#45271L, MS[44]#45272L, MS[45]#45273L, MS[46]#45274L, MS[47]#45275L, MS[48]#45276L, MS[49]#45277L, MS[50]#45278L, MS[51]#45279L, sum#45394L, sum#45395, sum#45396, count#45397L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#45161, processing_day#45163, count#45393L, MS[0]#45228L, MS[1]#45229L, MS[2]#45230L, MS[3]#45231L, MS[4]#45232L, MS[5]#45233L, MS[6]#45234L, MS[7]#45235L, MS[8]#45236L, MS[9]#45237L, MS[10]#45238L, MS[11]#45239L, MS[12]#45240L, MS[13]#45241L, MS[14]#45242L, MS[15]#45243L, MS[16]#45244L, MS[17]#45245L, MS[18]#45246L, MS[19]#45247L, MS[20]#45248L, MS[21]#45249L, MS[22]#45250L, MS[23]#45251L, MS[24]#45252L, MS[25]#45253L, MS[26]#45254L, MS[27]#45255L, MS[28]#45256L, MS[29]#45257L, MS[30]#45258L, MS[31]#45259L, MS[32]#45260L, MS[33]#45261L, MS[34]#45262L, MS[35]#45263L, MS[36]#45264L, MS[37]#45265L, MS[38]#45266L, MS[39]#45267L, MS[40]#45268L, MS[41]#45269L, MS[42]#45270L, MS[43]#45271L, MS[44]#45272L, MS[45]#45273L, MS[46]#45274L, MS[47]#45275L, MS[48]#45276L, MS[49]#45277L, MS[50]#45278L, MS[51]#45279L, sum#45394L, sum#45395, sum#45396, count#45397L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#45161, processing_day#45163, count#45393L, MS[0]#45228L, MS[1]#45229L, MS[2]#45230L, MS[3]#45231L, MS[4]#45232L, MS[5]#45233L, MS[6]#45234L, MS[7]#45235L, MS[8]#45236L, MS[9]#45237L, MS[10]#45238L, MS[11]#45239L, MS[12]#45240L, MS[13]#45241L, MS[14]#45242L, MS[15]#45243L, MS[16]#45244L, MS[17]#45245L, MS[18]#45246L, MS[19]#45247L, MS[20]#45248L, MS[21]#45249L, MS[22]#45250L, MS[23]#45251L, MS[24]#45252L, MS[25]#45253L, MS[26]#45254L, MS[27]#45255L, MS[28]#45256L, MS[29]#45257L, MS[30]#45258L, MS[31]#45259L, MS[32]#45260L, MS[33]#45261L, MS[34]#45262L, MS[35]#45263L, MS[36]#45264L, MS[37]#45265L, MS[38]#45266L, MS[39]#45267L, MS[40]#45268L, MS[41]#45269L, MS[42]#45270L, MS[43]#45271L, MS[44]#45272L, MS[45]#45273L, MS[46]#45274L, MS[47]#45275L, MS[48]#45276L, MS[49]#45277L, MS[50]#45278L, MS[51]#45279L, sum#45394L, sum#45395, sum#45396, count#45397L]
Keys [2]: [segment#45161, processing_day#45163]
Functions [5]: [count(1), approx_count_distinct(customer_id#45157L, 0.05, 0, 0), sum(events#45167), sum(weighted_amount#45169), avg(amount#45165)]
Aggregate Attributes [5]: [count(1)#45175L, approx_count_distinct(customer_id#45157L, 0.05, 0, 0)#45280L, sum(events#45167)#45281L, sum(weighted_amount#45169)#45282, avg(amount#45165)#45283]
Results [7]: [segment#45161, processing_day#45163, count(1)#45175L AS row_count#45170L, approx_count_distinct(customer_id#45157L, 0.05, 0, 0)#45280L AS unique_customers#45171L, sum(events#45167)#45281L AS event_sum#45172L, sum(weighted_amount#45169)#45282 AS weighted_amount_sum#45173, avg(amount#45165)#45283 AS avg_amount#45174]
(9) Exchange
Input [7]: [segment#45161, processing_day#45163, row_count#45170L, unique_customers#45171L, event_sum#45172L, weighted_amount_sum#45173, avg_amount#45174]
Arguments: rangepartitioning(segment#45161 ASC NULLS FIRST, processing_day#45163 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4310]
(10) ShuffleQueryStage
Output [7]: [segment#45161, processing_day#45163, row_count#45170L, unique_customers#45171L, event_sum#45172L, weighted_amount_sum#45173, avg_amount#45174]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#45161, processing_day#45163, row_count#45170L, unique_customers#45171L, event_sum#45172L, weighted_amount_sum#45173, avg_amount#45174]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#45161, processing_day#45163, row_count#45170L, unique_customers#45171L, event_sum#45172L, weighted_amount_sum#45173, avg_amount#45174]
Arguments: [segment#45161 ASC NULLS FIRST, processing_day#45163 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#45161, processing_day#45163, row_count#45170L, unique_customers#45171L, event_sum#45172L, weighted_amount_sum#45173, avg_amount#45174]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#45157L, segment#45161, processing_day#45163, amount#45165, events#45167, weighted_amount#45169]
Keys [2]: [segment#45161, processing_day#45163]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#45157L, 0.05, 0, 0), partial_sum(events#45167), partial_sum(weighted_amount#45169), partial_avg(amount#45165)]
Aggregate Attributes [57]: [count#45388L, MS[0]#45176L, MS[1]#45177L, MS[2]#45178L, MS[3]#45179L, MS[4]#45180L, MS[5]#45181L, MS[6]#45182L, MS[7]#45183L, MS[8]#45184L, MS[9]#45185L, MS[10]#45186L, MS[11]#45187L, MS[12]#45188L, MS[13]#45189L, MS[14]#45190L, MS[15]#45191L, MS[16]#45192L, MS[17]#45193L, MS[18]#45194L, MS[19]#45195L, MS[20]#45196L, MS[21]#45197L, MS[22]#45198L, MS[23]#45199L, MS[24]#45200L, MS[25]#45201L, MS[26]#45202L, MS[27]#45203L, MS[28]#45204L, MS[29]#45205L, MS[30]#45206L, MS[31]#45207L, MS[32]#45208L, MS[33]#45209L, MS[34]#45210L, MS[35]#45211L, MS[36]#45212L, MS[37]#45213L, MS[38]#45214L, MS[39]#45215L, MS[40]#45216L, MS[41]#45217L, MS[42]#45218L, MS[43]#45219L, MS[44]#45220L, MS[45]#45221L, MS[46]#45222L, MS[47]#45223L, MS[48]#45224L, MS[49]#45225L, MS[50]#45226L, MS[51]#45227L, sum#45389L, sum#45390, sum#45391, count#45392L]
Results [59]: [segment#45161, processing_day#45163, count#45393L, MS[0]#45228L, MS[1]#45229L, MS[2]#45230L, MS[3]#45231L, MS[4]#45232L, MS[5]#45233L, MS[6]#45234L, MS[7]#45235L, MS[8]#45236L, MS[9]#45237L, MS[10]#45238L, MS[11]#45239L, MS[12]#45240L, MS[13]#45241L, MS[14]#45242L, MS[15]#45243L, MS[16]#45244L, MS[17]#45245L, MS[18]#45246L, MS[19]#45247L, MS[20]#45248L, MS[21]#45249L, MS[22]#45250L, MS[23]#45251L, MS[24]#45252L, MS[25]#45253L, MS[26]#45254L, MS[27]#45255L, MS[28]#45256L, MS[29]#45257L, MS[30]#45258L, MS[31]#45259L, MS[32]#45260L, MS[33]#45261L, MS[34]#45262L, MS[35]#45263L, MS[36]#45264L, MS[37]#45265L, MS[38]#45266L, MS[39]#45267L, MS[40]#45268L, MS[41]#45269L, MS[42]#45270L, MS[43]#45271L, MS[44]#45272L, MS[45]#45273L, MS[46]#45274L, MS[47]#45275L, MS[48]#45276L, MS[49]#45277L, MS[50]#45278L, MS[51]#45279L, sum#45394L, sum#45395, sum#45396, count#45397L]
(15) Exchange
Input [59]: [segment#45161, processing_day#45163, count#45393L, MS[0]#45228L, MS[1]#45229L, MS[2]#45230L, MS[3]#45231L, MS[4]#45232L, MS[5]#45233L, MS[6]#45234L, MS[7]#45235L, MS[8]#45236L, MS[9]#45237L, MS[10]#45238L, MS[11]#45239L, MS[12]#45240L, MS[13]#45241L, MS[14]#45242L, MS[15]#45243L, MS[16]#45244L, MS[17]#45245L, MS[18]#45246L, MS[19]#45247L, MS[20]#45248L, MS[21]#45249L, MS[22]#45250L, MS[23]#45251L, MS[24]#45252L, MS[25]#45253L, MS[26]#45254L, MS[27]#45255L, MS[28]#45256L, MS[29]#45257L, MS[30]#45258L, MS[31]#45259L, MS[32]#45260L, MS[33]#45261L, MS[34]#45262L, MS[35]#45263L, MS[36]#45264L, MS[37]#45265L, MS[38]#45266L, MS[39]#45267L, MS[40]#45268L, MS[41]#45269L, MS[42]#45270L, MS[43]#45271L, MS[44]#45272L, MS[45]#45273L, MS[46]#45274L, MS[47]#45275L, MS[48]#45276L, MS[49]#45277L, MS[50]#45278L, MS[51]#45279L, sum#45394L, sum#45395, sum#45396, count#45397L]
Arguments: hashpartitioning(segment#45161, processing_day#45163, 200), ENSURE_REQUIREMENTS, [plan_id=4268]
(16) HashAggregate
Input [59]: [segment#45161, processing_day#45163, count#45393L, MS[0]#45228L, MS[1]#45229L, MS[2]#45230L, MS[3]#45231L, MS[4]#45232L, MS[5]#45233L, MS[6]#45234L, MS[7]#45235L, MS[8]#45236L, MS[9]#45237L, MS[10]#45238L, MS[11]#45239L, MS[12]#45240L, MS[13]#45241L, MS[14]#45242L, MS[15]#45243L, MS[16]#45244L, MS[17]#45245L, MS[18]#45246L, MS[19]#45247L, MS[20]#45248L, MS[21]#45249L, MS[22]#45250L, MS[23]#45251L, MS[24]#45252L, MS[25]#45253L, MS[26]#45254L, MS[27]#45255L, MS[28]#45256L, MS[29]#45257L, MS[30]#45258L, MS[31]#45259L, MS[32]#45260L, MS[33]#45261L, MS[34]#45262L, MS[35]#45263L, MS[36]#45264L, MS[37]#45265L, MS[38]#45266L, MS[39]#45267L, MS[40]#45268L, MS[41]#45269L, MS[42]#45270L, MS[43]#45271L, MS[44]#45272L, MS[45]#45273L, MS[46]#45274L, MS[47]#45275L, MS[48]#45276L, MS[49]#45277L, MS[50]#45278L, MS[51]#45279L, sum#45394L, sum#45395, sum#45396, count#45397L]
Keys [2]: [segment#45161, processing_day#45163]
Functions [5]: [count(1), approx_count_distinct(customer_id#45157L, 0.05, 0, 0), sum(events#45167), sum(weighted_amount#45169), avg(amount#45165)]
Aggregate Attributes [5]: [count(1)#45175L, approx_count_distinct(customer_id#45157L, 0.05, 0, 0)#45280L, sum(events#45167)#45281L, sum(weighted_amount#45169)#45282, avg(amount#45165)#45283]
Results [7]: [segment#45161, processing_day#45163, count(1)#45175L AS row_count#45170L, approx_count_distinct(customer_id#45157L, 0.05, 0, 0)#45280L AS unique_customers#45171L, sum(events#45167)#45281L AS event_sum#45172L, sum(weighted_amount#45169)#45282 AS weighted_amount_sum#45173, avg(amount#45165)#45283 AS avg_amount#45174]
(17) Exchange
Input [7]: [segment#45161, processing_day#45163, row_count#45170L, unique_customers#45171L, event_sum#45172L, weighted_amount_sum#45173, avg_amount#45174]
Arguments: rangepartitioning(segment#45161 ASC NULLS FIRST, processing_day#45163 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4271]
(18) Sort
Input [7]: [segment#45161, processing_day#45163, row_count#45170L, unique_customers#45171L, event_sum#45172L, weighted_amount_sum#45173, avg_amount#45174]
Arguments: [segment#45161 ASC NULLS FIRST, processing_day#45163 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#45161, processing_day#45163, row_count#45170L, unique_customers#45171L, event_sum#45172L, weighted_amount_sum#45173, avg_amount#45174]
Arguments: isFinalPlan=true