== 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#99147L]
Arguments: Range (16000000, 17000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#99147L % 250000) AS customer_id#99149L, concat(segment-, cast(cast((id#99147L % 12) as int) as string)) AS segment#99153, cast((id#99147L % 14) as int) AS processing_day#99155, ((cast(((id#99147L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#99157, cast((((id#99147L * 29) % 7) + 1) as int) AS events#99159]
Input [1]: [id#99147L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#99149L, segment#99153, processing_day#99155, amount#99157, events#99159, (amount#99157 * cast(events#99159 as double)) AS weighted_amount#99161]
Input [5]: [customer_id#99149L, segment#99153, processing_day#99155, amount#99157, events#99159]
(4) HashAggregate
Input [6]: [customer_id#99149L, segment#99153, processing_day#99155, amount#99157, events#99159, weighted_amount#99161]
Keys [2]: [segment#99153, processing_day#99155]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#99149L, 0.05, 0, 0), partial_sum(events#99159), partial_sum(weighted_amount#99161), partial_avg(amount#99157)]
Aggregate Attributes [57]: [count#99380L, MS[0]#99168L, MS[1]#99169L, MS[2]#99170L, MS[3]#99171L, MS[4]#99172L, MS[5]#99173L, MS[6]#99174L, MS[7]#99175L, MS[8]#99176L, MS[9]#99177L, MS[10]#99178L, MS[11]#99179L, MS[12]#99180L, MS[13]#99181L, MS[14]#99182L, MS[15]#99183L, MS[16]#99184L, MS[17]#99185L, MS[18]#99186L, MS[19]#99187L, MS[20]#99188L, MS[21]#99189L, MS[22]#99190L, MS[23]#99191L, MS[24]#99192L, MS[25]#99193L, MS[26]#99194L, MS[27]#99195L, MS[28]#99196L, MS[29]#99197L, MS[30]#99198L, MS[31]#99199L, MS[32]#99200L, MS[33]#99201L, MS[34]#99202L, MS[35]#99203L, MS[36]#99204L, MS[37]#99205L, MS[38]#99206L, MS[39]#99207L, MS[40]#99208L, MS[41]#99209L, MS[42]#99210L, MS[43]#99211L, MS[44]#99212L, MS[45]#99213L, MS[46]#99214L, MS[47]#99215L, MS[48]#99216L, MS[49]#99217L, MS[50]#99218L, MS[51]#99219L, sum#99381L, sum#99382, sum#99383, count#99384L]
Results [59]: [segment#99153, processing_day#99155, count#99385L, MS[0]#99220L, MS[1]#99221L, MS[2]#99222L, MS[3]#99223L, MS[4]#99224L, MS[5]#99225L, MS[6]#99226L, MS[7]#99227L, MS[8]#99228L, MS[9]#99229L, MS[10]#99230L, MS[11]#99231L, MS[12]#99232L, MS[13]#99233L, MS[14]#99234L, MS[15]#99235L, MS[16]#99236L, MS[17]#99237L, MS[18]#99238L, MS[19]#99239L, MS[20]#99240L, MS[21]#99241L, MS[22]#99242L, MS[23]#99243L, MS[24]#99244L, MS[25]#99245L, MS[26]#99246L, MS[27]#99247L, MS[28]#99248L, MS[29]#99249L, MS[30]#99250L, MS[31]#99251L, MS[32]#99252L, MS[33]#99253L, MS[34]#99254L, MS[35]#99255L, MS[36]#99256L, MS[37]#99257L, MS[38]#99258L, MS[39]#99259L, MS[40]#99260L, MS[41]#99261L, MS[42]#99262L, MS[43]#99263L, MS[44]#99264L, MS[45]#99265L, MS[46]#99266L, MS[47]#99267L, MS[48]#99268L, MS[49]#99269L, MS[50]#99270L, MS[51]#99271L, sum#99386L, sum#99387, sum#99388, count#99389L]
(5) Exchange
Input [59]: [segment#99153, processing_day#99155, count#99385L, MS[0]#99220L, MS[1]#99221L, MS[2]#99222L, MS[3]#99223L, MS[4]#99224L, MS[5]#99225L, MS[6]#99226L, MS[7]#99227L, MS[8]#99228L, MS[9]#99229L, MS[10]#99230L, MS[11]#99231L, MS[12]#99232L, MS[13]#99233L, MS[14]#99234L, MS[15]#99235L, MS[16]#99236L, MS[17]#99237L, MS[18]#99238L, MS[19]#99239L, MS[20]#99240L, MS[21]#99241L, MS[22]#99242L, MS[23]#99243L, MS[24]#99244L, MS[25]#99245L, MS[26]#99246L, MS[27]#99247L, MS[28]#99248L, MS[29]#99249L, MS[30]#99250L, MS[31]#99251L, MS[32]#99252L, MS[33]#99253L, MS[34]#99254L, MS[35]#99255L, MS[36]#99256L, MS[37]#99257L, MS[38]#99258L, MS[39]#99259L, MS[40]#99260L, MS[41]#99261L, MS[42]#99262L, MS[43]#99263L, MS[44]#99264L, MS[45]#99265L, MS[46]#99266L, MS[47]#99267L, MS[48]#99268L, MS[49]#99269L, MS[50]#99270L, MS[51]#99271L, sum#99386L, sum#99387, sum#99388, count#99389L]
Arguments: hashpartitioning(segment#99153, processing_day#99155, 200), ENSURE_REQUIREMENTS, [plan_id=9363]
(6) ShuffleQueryStage
Output [59]: [segment#99153, processing_day#99155, count#99385L, MS[0]#99220L, MS[1]#99221L, MS[2]#99222L, MS[3]#99223L, MS[4]#99224L, MS[5]#99225L, MS[6]#99226L, MS[7]#99227L, MS[8]#99228L, MS[9]#99229L, MS[10]#99230L, MS[11]#99231L, MS[12]#99232L, MS[13]#99233L, MS[14]#99234L, MS[15]#99235L, MS[16]#99236L, MS[17]#99237L, MS[18]#99238L, MS[19]#99239L, MS[20]#99240L, MS[21]#99241L, MS[22]#99242L, MS[23]#99243L, MS[24]#99244L, MS[25]#99245L, MS[26]#99246L, MS[27]#99247L, MS[28]#99248L, MS[29]#99249L, MS[30]#99250L, MS[31]#99251L, MS[32]#99252L, MS[33]#99253L, MS[34]#99254L, MS[35]#99255L, MS[36]#99256L, MS[37]#99257L, MS[38]#99258L, MS[39]#99259L, MS[40]#99260L, MS[41]#99261L, MS[42]#99262L, MS[43]#99263L, MS[44]#99264L, MS[45]#99265L, MS[46]#99266L, MS[47]#99267L, MS[48]#99268L, MS[49]#99269L, MS[50]#99270L, MS[51]#99271L, sum#99386L, sum#99387, sum#99388, count#99389L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#99153, processing_day#99155, count#99385L, MS[0]#99220L, MS[1]#99221L, MS[2]#99222L, MS[3]#99223L, MS[4]#99224L, MS[5]#99225L, MS[6]#99226L, MS[7]#99227L, MS[8]#99228L, MS[9]#99229L, MS[10]#99230L, MS[11]#99231L, MS[12]#99232L, MS[13]#99233L, MS[14]#99234L, MS[15]#99235L, MS[16]#99236L, MS[17]#99237L, MS[18]#99238L, MS[19]#99239L, MS[20]#99240L, MS[21]#99241L, MS[22]#99242L, MS[23]#99243L, MS[24]#99244L, MS[25]#99245L, MS[26]#99246L, MS[27]#99247L, MS[28]#99248L, MS[29]#99249L, MS[30]#99250L, MS[31]#99251L, MS[32]#99252L, MS[33]#99253L, MS[34]#99254L, MS[35]#99255L, MS[36]#99256L, MS[37]#99257L, MS[38]#99258L, MS[39]#99259L, MS[40]#99260L, MS[41]#99261L, MS[42]#99262L, MS[43]#99263L, MS[44]#99264L, MS[45]#99265L, MS[46]#99266L, MS[47]#99267L, MS[48]#99268L, MS[49]#99269L, MS[50]#99270L, MS[51]#99271L, sum#99386L, sum#99387, sum#99388, count#99389L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#99153, processing_day#99155, count#99385L, MS[0]#99220L, MS[1]#99221L, MS[2]#99222L, MS[3]#99223L, MS[4]#99224L, MS[5]#99225L, MS[6]#99226L, MS[7]#99227L, MS[8]#99228L, MS[9]#99229L, MS[10]#99230L, MS[11]#99231L, MS[12]#99232L, MS[13]#99233L, MS[14]#99234L, MS[15]#99235L, MS[16]#99236L, MS[17]#99237L, MS[18]#99238L, MS[19]#99239L, MS[20]#99240L, MS[21]#99241L, MS[22]#99242L, MS[23]#99243L, MS[24]#99244L, MS[25]#99245L, MS[26]#99246L, MS[27]#99247L, MS[28]#99248L, MS[29]#99249L, MS[30]#99250L, MS[31]#99251L, MS[32]#99252L, MS[33]#99253L, MS[34]#99254L, MS[35]#99255L, MS[36]#99256L, MS[37]#99257L, MS[38]#99258L, MS[39]#99259L, MS[40]#99260L, MS[41]#99261L, MS[42]#99262L, MS[43]#99263L, MS[44]#99264L, MS[45]#99265L, MS[46]#99266L, MS[47]#99267L, MS[48]#99268L, MS[49]#99269L, MS[50]#99270L, MS[51]#99271L, sum#99386L, sum#99387, sum#99388, count#99389L]
Keys [2]: [segment#99153, processing_day#99155]
Functions [5]: [count(1), approx_count_distinct(customer_id#99149L, 0.05, 0, 0), sum(events#99159), sum(weighted_amount#99161), avg(amount#99157)]
Aggregate Attributes [5]: [count(1)#99167L, approx_count_distinct(customer_id#99149L, 0.05, 0, 0)#99272L, sum(events#99159)#99273L, sum(weighted_amount#99161)#99274, avg(amount#99157)#99275]
Results [7]: [segment#99153, processing_day#99155, count(1)#99167L AS row_count#99162L, approx_count_distinct(customer_id#99149L, 0.05, 0, 0)#99272L AS unique_customers#99163L, sum(events#99159)#99273L AS event_sum#99164L, sum(weighted_amount#99161)#99274 AS weighted_amount_sum#99165, avg(amount#99157)#99275 AS avg_amount#99166]
(9) Exchange
Input [7]: [segment#99153, processing_day#99155, row_count#99162L, unique_customers#99163L, event_sum#99164L, weighted_amount_sum#99165, avg_amount#99166]
Arguments: rangepartitioning(segment#99153 ASC NULLS FIRST, processing_day#99155 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9385]
(10) ShuffleQueryStage
Output [7]: [segment#99153, processing_day#99155, row_count#99162L, unique_customers#99163L, event_sum#99164L, weighted_amount_sum#99165, avg_amount#99166]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#99153, processing_day#99155, row_count#99162L, unique_customers#99163L, event_sum#99164L, weighted_amount_sum#99165, avg_amount#99166]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#99153, processing_day#99155, row_count#99162L, unique_customers#99163L, event_sum#99164L, weighted_amount_sum#99165, avg_amount#99166]
Arguments: [segment#99153 ASC NULLS FIRST, processing_day#99155 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#99153, processing_day#99155, row_count#99162L, unique_customers#99163L, event_sum#99164L, weighted_amount_sum#99165, avg_amount#99166]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#99149L, segment#99153, processing_day#99155, amount#99157, events#99159, weighted_amount#99161]
Keys [2]: [segment#99153, processing_day#99155]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#99149L, 0.05, 0, 0), partial_sum(events#99159), partial_sum(weighted_amount#99161), partial_avg(amount#99157)]
Aggregate Attributes [57]: [count#99380L, MS[0]#99168L, MS[1]#99169L, MS[2]#99170L, MS[3]#99171L, MS[4]#99172L, MS[5]#99173L, MS[6]#99174L, MS[7]#99175L, MS[8]#99176L, MS[9]#99177L, MS[10]#99178L, MS[11]#99179L, MS[12]#99180L, MS[13]#99181L, MS[14]#99182L, MS[15]#99183L, MS[16]#99184L, MS[17]#99185L, MS[18]#99186L, MS[19]#99187L, MS[20]#99188L, MS[21]#99189L, MS[22]#99190L, MS[23]#99191L, MS[24]#99192L, MS[25]#99193L, MS[26]#99194L, MS[27]#99195L, MS[28]#99196L, MS[29]#99197L, MS[30]#99198L, MS[31]#99199L, MS[32]#99200L, MS[33]#99201L, MS[34]#99202L, MS[35]#99203L, MS[36]#99204L, MS[37]#99205L, MS[38]#99206L, MS[39]#99207L, MS[40]#99208L, MS[41]#99209L, MS[42]#99210L, MS[43]#99211L, MS[44]#99212L, MS[45]#99213L, MS[46]#99214L, MS[47]#99215L, MS[48]#99216L, MS[49]#99217L, MS[50]#99218L, MS[51]#99219L, sum#99381L, sum#99382, sum#99383, count#99384L]
Results [59]: [segment#99153, processing_day#99155, count#99385L, MS[0]#99220L, MS[1]#99221L, MS[2]#99222L, MS[3]#99223L, MS[4]#99224L, MS[5]#99225L, MS[6]#99226L, MS[7]#99227L, MS[8]#99228L, MS[9]#99229L, MS[10]#99230L, MS[11]#99231L, MS[12]#99232L, MS[13]#99233L, MS[14]#99234L, MS[15]#99235L, MS[16]#99236L, MS[17]#99237L, MS[18]#99238L, MS[19]#99239L, MS[20]#99240L, MS[21]#99241L, MS[22]#99242L, MS[23]#99243L, MS[24]#99244L, MS[25]#99245L, MS[26]#99246L, MS[27]#99247L, MS[28]#99248L, MS[29]#99249L, MS[30]#99250L, MS[31]#99251L, MS[32]#99252L, MS[33]#99253L, MS[34]#99254L, MS[35]#99255L, MS[36]#99256L, MS[37]#99257L, MS[38]#99258L, MS[39]#99259L, MS[40]#99260L, MS[41]#99261L, MS[42]#99262L, MS[43]#99263L, MS[44]#99264L, MS[45]#99265L, MS[46]#99266L, MS[47]#99267L, MS[48]#99268L, MS[49]#99269L, MS[50]#99270L, MS[51]#99271L, sum#99386L, sum#99387, sum#99388, count#99389L]
(15) Exchange
Input [59]: [segment#99153, processing_day#99155, count#99385L, MS[0]#99220L, MS[1]#99221L, MS[2]#99222L, MS[3]#99223L, MS[4]#99224L, MS[5]#99225L, MS[6]#99226L, MS[7]#99227L, MS[8]#99228L, MS[9]#99229L, MS[10]#99230L, MS[11]#99231L, MS[12]#99232L, MS[13]#99233L, MS[14]#99234L, MS[15]#99235L, MS[16]#99236L, MS[17]#99237L, MS[18]#99238L, MS[19]#99239L, MS[20]#99240L, MS[21]#99241L, MS[22]#99242L, MS[23]#99243L, MS[24]#99244L, MS[25]#99245L, MS[26]#99246L, MS[27]#99247L, MS[28]#99248L, MS[29]#99249L, MS[30]#99250L, MS[31]#99251L, MS[32]#99252L, MS[33]#99253L, MS[34]#99254L, MS[35]#99255L, MS[36]#99256L, MS[37]#99257L, MS[38]#99258L, MS[39]#99259L, MS[40]#99260L, MS[41]#99261L, MS[42]#99262L, MS[43]#99263L, MS[44]#99264L, MS[45]#99265L, MS[46]#99266L, MS[47]#99267L, MS[48]#99268L, MS[49]#99269L, MS[50]#99270L, MS[51]#99271L, sum#99386L, sum#99387, sum#99388, count#99389L]
Arguments: hashpartitioning(segment#99153, processing_day#99155, 200), ENSURE_REQUIREMENTS, [plan_id=9343]
(16) HashAggregate
Input [59]: [segment#99153, processing_day#99155, count#99385L, MS[0]#99220L, MS[1]#99221L, MS[2]#99222L, MS[3]#99223L, MS[4]#99224L, MS[5]#99225L, MS[6]#99226L, MS[7]#99227L, MS[8]#99228L, MS[9]#99229L, MS[10]#99230L, MS[11]#99231L, MS[12]#99232L, MS[13]#99233L, MS[14]#99234L, MS[15]#99235L, MS[16]#99236L, MS[17]#99237L, MS[18]#99238L, MS[19]#99239L, MS[20]#99240L, MS[21]#99241L, MS[22]#99242L, MS[23]#99243L, MS[24]#99244L, MS[25]#99245L, MS[26]#99246L, MS[27]#99247L, MS[28]#99248L, MS[29]#99249L, MS[30]#99250L, MS[31]#99251L, MS[32]#99252L, MS[33]#99253L, MS[34]#99254L, MS[35]#99255L, MS[36]#99256L, MS[37]#99257L, MS[38]#99258L, MS[39]#99259L, MS[40]#99260L, MS[41]#99261L, MS[42]#99262L, MS[43]#99263L, MS[44]#99264L, MS[45]#99265L, MS[46]#99266L, MS[47]#99267L, MS[48]#99268L, MS[49]#99269L, MS[50]#99270L, MS[51]#99271L, sum#99386L, sum#99387, sum#99388, count#99389L]
Keys [2]: [segment#99153, processing_day#99155]
Functions [5]: [count(1), approx_count_distinct(customer_id#99149L, 0.05, 0, 0), sum(events#99159), sum(weighted_amount#99161), avg(amount#99157)]
Aggregate Attributes [5]: [count(1)#99167L, approx_count_distinct(customer_id#99149L, 0.05, 0, 0)#99272L, sum(events#99159)#99273L, sum(weighted_amount#99161)#99274, avg(amount#99157)#99275]
Results [7]: [segment#99153, processing_day#99155, count(1)#99167L AS row_count#99162L, approx_count_distinct(customer_id#99149L, 0.05, 0, 0)#99272L AS unique_customers#99163L, sum(events#99159)#99273L AS event_sum#99164L, sum(weighted_amount#99161)#99274 AS weighted_amount_sum#99165, avg(amount#99157)#99275 AS avg_amount#99166]
(17) Exchange
Input [7]: [segment#99153, processing_day#99155, row_count#99162L, unique_customers#99163L, event_sum#99164L, weighted_amount_sum#99165, avg_amount#99166]
Arguments: rangepartitioning(segment#99153 ASC NULLS FIRST, processing_day#99155 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9346]
(18) Sort
Input [7]: [segment#99153, processing_day#99155, row_count#99162L, unique_customers#99163L, event_sum#99164L, weighted_amount_sum#99165, avg_amount#99166]
Arguments: [segment#99153 ASC NULLS FIRST, processing_day#99155 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#99153, processing_day#99155, row_count#99162L, unique_customers#99163L, event_sum#99164L, weighted_amount_sum#99165, avg_amount#99166]
Arguments: isFinalPlan=true