== 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#6189L]
Arguments: Range (7000000, 8000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#6189L % 250000) AS customer_id#6191L, concat(segment-, cast(cast((id#6189L % 12) as int) as string)) AS segment#6195, cast((id#6189L % 14) as int) AS processing_day#6197, ((cast(((id#6189L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#6199, cast((((id#6189L * 29) % 7) + 1) as int) AS events#6201]
Input [1]: [id#6189L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#6191L, segment#6195, processing_day#6197, amount#6199, events#6201, (amount#6199 * cast(events#6201 as double)) AS weighted_amount#6203]
Input [5]: [customer_id#6191L, segment#6195, processing_day#6197, amount#6199, events#6201]
(4) HashAggregate
Input [6]: [customer_id#6191L, segment#6195, processing_day#6197, amount#6199, events#6201, weighted_amount#6203]
Keys [2]: [segment#6195, processing_day#6197]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#6191L, 0.05, 0, 0), partial_sum(events#6201), partial_sum(weighted_amount#6203), partial_avg(amount#6199)]
Aggregate Attributes [57]: [count#6422L, MS[0]#6210L, MS[1]#6211L, MS[2]#6212L, MS[3]#6213L, MS[4]#6214L, MS[5]#6215L, MS[6]#6216L, MS[7]#6217L, MS[8]#6218L, MS[9]#6219L, MS[10]#6220L, MS[11]#6221L, MS[12]#6222L, MS[13]#6223L, MS[14]#6224L, MS[15]#6225L, MS[16]#6226L, MS[17]#6227L, MS[18]#6228L, MS[19]#6229L, MS[20]#6230L, MS[21]#6231L, MS[22]#6232L, MS[23]#6233L, MS[24]#6234L, MS[25]#6235L, MS[26]#6236L, MS[27]#6237L, MS[28]#6238L, MS[29]#6239L, MS[30]#6240L, MS[31]#6241L, MS[32]#6242L, MS[33]#6243L, MS[34]#6244L, MS[35]#6245L, MS[36]#6246L, MS[37]#6247L, MS[38]#6248L, MS[39]#6249L, MS[40]#6250L, MS[41]#6251L, MS[42]#6252L, MS[43]#6253L, MS[44]#6254L, MS[45]#6255L, MS[46]#6256L, MS[47]#6257L, MS[48]#6258L, MS[49]#6259L, MS[50]#6260L, MS[51]#6261L, sum#6423L, sum#6424, sum#6425, count#6426L]
Results [59]: [segment#6195, processing_day#6197, count#6427L, MS[0]#6262L, MS[1]#6263L, MS[2]#6264L, MS[3]#6265L, MS[4]#6266L, MS[5]#6267L, MS[6]#6268L, MS[7]#6269L, MS[8]#6270L, MS[9]#6271L, MS[10]#6272L, MS[11]#6273L, MS[12]#6274L, MS[13]#6275L, MS[14]#6276L, MS[15]#6277L, MS[16]#6278L, MS[17]#6279L, MS[18]#6280L, MS[19]#6281L, MS[20]#6282L, MS[21]#6283L, MS[22]#6284L, MS[23]#6285L, MS[24]#6286L, MS[25]#6287L, MS[26]#6288L, MS[27]#6289L, MS[28]#6290L, MS[29]#6291L, MS[30]#6292L, MS[31]#6293L, MS[32]#6294L, MS[33]#6295L, MS[34]#6296L, MS[35]#6297L, MS[36]#6298L, MS[37]#6299L, MS[38]#6300L, MS[39]#6301L, MS[40]#6302L, MS[41]#6303L, MS[42]#6304L, MS[43]#6305L, MS[44]#6306L, MS[45]#6307L, MS[46]#6308L, MS[47]#6309L, MS[48]#6310L, MS[49]#6311L, MS[50]#6312L, MS[51]#6313L, sum#6428L, sum#6429, sum#6430, count#6431L]
(5) Exchange
Input [59]: [segment#6195, processing_day#6197, count#6427L, MS[0]#6262L, MS[1]#6263L, MS[2]#6264L, MS[3]#6265L, MS[4]#6266L, MS[5]#6267L, MS[6]#6268L, MS[7]#6269L, MS[8]#6270L, MS[9]#6271L, MS[10]#6272L, MS[11]#6273L, MS[12]#6274L, MS[13]#6275L, MS[14]#6276L, MS[15]#6277L, MS[16]#6278L, MS[17]#6279L, MS[18]#6280L, MS[19]#6281L, MS[20]#6282L, MS[21]#6283L, MS[22]#6284L, MS[23]#6285L, MS[24]#6286L, MS[25]#6287L, MS[26]#6288L, MS[27]#6289L, MS[28]#6290L, MS[29]#6291L, MS[30]#6292L, MS[31]#6293L, MS[32]#6294L, MS[33]#6295L, MS[34]#6296L, MS[35]#6297L, MS[36]#6298L, MS[37]#6299L, MS[38]#6300L, MS[39]#6301L, MS[40]#6302L, MS[41]#6303L, MS[42]#6304L, MS[43]#6305L, MS[44]#6306L, MS[45]#6307L, MS[46]#6308L, MS[47]#6309L, MS[48]#6310L, MS[49]#6311L, MS[50]#6312L, MS[51]#6313L, sum#6428L, sum#6429, sum#6430, count#6431L]
Arguments: hashpartitioning(segment#6195, processing_day#6197, 200), ENSURE_REQUIREMENTS, [plan_id=624]
(6) ShuffleQueryStage
Output [59]: [segment#6195, processing_day#6197, count#6427L, MS[0]#6262L, MS[1]#6263L, MS[2]#6264L, MS[3]#6265L, MS[4]#6266L, MS[5]#6267L, MS[6]#6268L, MS[7]#6269L, MS[8]#6270L, MS[9]#6271L, MS[10]#6272L, MS[11]#6273L, MS[12]#6274L, MS[13]#6275L, MS[14]#6276L, MS[15]#6277L, MS[16]#6278L, MS[17]#6279L, MS[18]#6280L, MS[19]#6281L, MS[20]#6282L, MS[21]#6283L, MS[22]#6284L, MS[23]#6285L, MS[24]#6286L, MS[25]#6287L, MS[26]#6288L, MS[27]#6289L, MS[28]#6290L, MS[29]#6291L, MS[30]#6292L, MS[31]#6293L, MS[32]#6294L, MS[33]#6295L, MS[34]#6296L, MS[35]#6297L, MS[36]#6298L, MS[37]#6299L, MS[38]#6300L, MS[39]#6301L, MS[40]#6302L, MS[41]#6303L, MS[42]#6304L, MS[43]#6305L, MS[44]#6306L, MS[45]#6307L, MS[46]#6308L, MS[47]#6309L, MS[48]#6310L, MS[49]#6311L, MS[50]#6312L, MS[51]#6313L, sum#6428L, sum#6429, sum#6430, count#6431L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#6195, processing_day#6197, count#6427L, MS[0]#6262L, MS[1]#6263L, MS[2]#6264L, MS[3]#6265L, MS[4]#6266L, MS[5]#6267L, MS[6]#6268L, MS[7]#6269L, MS[8]#6270L, MS[9]#6271L, MS[10]#6272L, MS[11]#6273L, MS[12]#6274L, MS[13]#6275L, MS[14]#6276L, MS[15]#6277L, MS[16]#6278L, MS[17]#6279L, MS[18]#6280L, MS[19]#6281L, MS[20]#6282L, MS[21]#6283L, MS[22]#6284L, MS[23]#6285L, MS[24]#6286L, MS[25]#6287L, MS[26]#6288L, MS[27]#6289L, MS[28]#6290L, MS[29]#6291L, MS[30]#6292L, MS[31]#6293L, MS[32]#6294L, MS[33]#6295L, MS[34]#6296L, MS[35]#6297L, MS[36]#6298L, MS[37]#6299L, MS[38]#6300L, MS[39]#6301L, MS[40]#6302L, MS[41]#6303L, MS[42]#6304L, MS[43]#6305L, MS[44]#6306L, MS[45]#6307L, MS[46]#6308L, MS[47]#6309L, MS[48]#6310L, MS[49]#6311L, MS[50]#6312L, MS[51]#6313L, sum#6428L, sum#6429, sum#6430, count#6431L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#6195, processing_day#6197, count#6427L, MS[0]#6262L, MS[1]#6263L, MS[2]#6264L, MS[3]#6265L, MS[4]#6266L, MS[5]#6267L, MS[6]#6268L, MS[7]#6269L, MS[8]#6270L, MS[9]#6271L, MS[10]#6272L, MS[11]#6273L, MS[12]#6274L, MS[13]#6275L, MS[14]#6276L, MS[15]#6277L, MS[16]#6278L, MS[17]#6279L, MS[18]#6280L, MS[19]#6281L, MS[20]#6282L, MS[21]#6283L, MS[22]#6284L, MS[23]#6285L, MS[24]#6286L, MS[25]#6287L, MS[26]#6288L, MS[27]#6289L, MS[28]#6290L, MS[29]#6291L, MS[30]#6292L, MS[31]#6293L, MS[32]#6294L, MS[33]#6295L, MS[34]#6296L, MS[35]#6297L, MS[36]#6298L, MS[37]#6299L, MS[38]#6300L, MS[39]#6301L, MS[40]#6302L, MS[41]#6303L, MS[42]#6304L, MS[43]#6305L, MS[44]#6306L, MS[45]#6307L, MS[46]#6308L, MS[47]#6309L, MS[48]#6310L, MS[49]#6311L, MS[50]#6312L, MS[51]#6313L, sum#6428L, sum#6429, sum#6430, count#6431L]
Keys [2]: [segment#6195, processing_day#6197]
Functions [5]: [count(1), approx_count_distinct(customer_id#6191L, 0.05, 0, 0), sum(events#6201), sum(weighted_amount#6203), avg(amount#6199)]
Aggregate Attributes [5]: [count(1)#6209L, approx_count_distinct(customer_id#6191L, 0.05, 0, 0)#6314L, sum(events#6201)#6315L, sum(weighted_amount#6203)#6316, avg(amount#6199)#6317]
Results [7]: [segment#6195, processing_day#6197, count(1)#6209L AS row_count#6204L, approx_count_distinct(customer_id#6191L, 0.05, 0, 0)#6314L AS unique_customers#6205L, sum(events#6201)#6315L AS event_sum#6206L, sum(weighted_amount#6203)#6316 AS weighted_amount_sum#6207, avg(amount#6199)#6317 AS avg_amount#6208]
(9) Exchange
Input [7]: [segment#6195, processing_day#6197, row_count#6204L, unique_customers#6205L, event_sum#6206L, weighted_amount_sum#6207, avg_amount#6208]
Arguments: rangepartitioning(segment#6195 ASC NULLS FIRST, processing_day#6197 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=646]
(10) ShuffleQueryStage
Output [7]: [segment#6195, processing_day#6197, row_count#6204L, unique_customers#6205L, event_sum#6206L, weighted_amount_sum#6207, avg_amount#6208]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#6195, processing_day#6197, row_count#6204L, unique_customers#6205L, event_sum#6206L, weighted_amount_sum#6207, avg_amount#6208]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#6195, processing_day#6197, row_count#6204L, unique_customers#6205L, event_sum#6206L, weighted_amount_sum#6207, avg_amount#6208]
Arguments: [segment#6195 ASC NULLS FIRST, processing_day#6197 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#6195, processing_day#6197, row_count#6204L, unique_customers#6205L, event_sum#6206L, weighted_amount_sum#6207, avg_amount#6208]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#6191L, segment#6195, processing_day#6197, amount#6199, events#6201, weighted_amount#6203]
Keys [2]: [segment#6195, processing_day#6197]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#6191L, 0.05, 0, 0), partial_sum(events#6201), partial_sum(weighted_amount#6203), partial_avg(amount#6199)]
Aggregate Attributes [57]: [count#6422L, MS[0]#6210L, MS[1]#6211L, MS[2]#6212L, MS[3]#6213L, MS[4]#6214L, MS[5]#6215L, MS[6]#6216L, MS[7]#6217L, MS[8]#6218L, MS[9]#6219L, MS[10]#6220L, MS[11]#6221L, MS[12]#6222L, MS[13]#6223L, MS[14]#6224L, MS[15]#6225L, MS[16]#6226L, MS[17]#6227L, MS[18]#6228L, MS[19]#6229L, MS[20]#6230L, MS[21]#6231L, MS[22]#6232L, MS[23]#6233L, MS[24]#6234L, MS[25]#6235L, MS[26]#6236L, MS[27]#6237L, MS[28]#6238L, MS[29]#6239L, MS[30]#6240L, MS[31]#6241L, MS[32]#6242L, MS[33]#6243L, MS[34]#6244L, MS[35]#6245L, MS[36]#6246L, MS[37]#6247L, MS[38]#6248L, MS[39]#6249L, MS[40]#6250L, MS[41]#6251L, MS[42]#6252L, MS[43]#6253L, MS[44]#6254L, MS[45]#6255L, MS[46]#6256L, MS[47]#6257L, MS[48]#6258L, MS[49]#6259L, MS[50]#6260L, MS[51]#6261L, sum#6423L, sum#6424, sum#6425, count#6426L]
Results [59]: [segment#6195, processing_day#6197, count#6427L, MS[0]#6262L, MS[1]#6263L, MS[2]#6264L, MS[3]#6265L, MS[4]#6266L, MS[5]#6267L, MS[6]#6268L, MS[7]#6269L, MS[8]#6270L, MS[9]#6271L, MS[10]#6272L, MS[11]#6273L, MS[12]#6274L, MS[13]#6275L, MS[14]#6276L, MS[15]#6277L, MS[16]#6278L, MS[17]#6279L, MS[18]#6280L, MS[19]#6281L, MS[20]#6282L, MS[21]#6283L, MS[22]#6284L, MS[23]#6285L, MS[24]#6286L, MS[25]#6287L, MS[26]#6288L, MS[27]#6289L, MS[28]#6290L, MS[29]#6291L, MS[30]#6292L, MS[31]#6293L, MS[32]#6294L, MS[33]#6295L, MS[34]#6296L, MS[35]#6297L, MS[36]#6298L, MS[37]#6299L, MS[38]#6300L, MS[39]#6301L, MS[40]#6302L, MS[41]#6303L, MS[42]#6304L, MS[43]#6305L, MS[44]#6306L, MS[45]#6307L, MS[46]#6308L, MS[47]#6309L, MS[48]#6310L, MS[49]#6311L, MS[50]#6312L, MS[51]#6313L, sum#6428L, sum#6429, sum#6430, count#6431L]
(15) Exchange
Input [59]: [segment#6195, processing_day#6197, count#6427L, MS[0]#6262L, MS[1]#6263L, MS[2]#6264L, MS[3]#6265L, MS[4]#6266L, MS[5]#6267L, MS[6]#6268L, MS[7]#6269L, MS[8]#6270L, MS[9]#6271L, MS[10]#6272L, MS[11]#6273L, MS[12]#6274L, MS[13]#6275L, MS[14]#6276L, MS[15]#6277L, MS[16]#6278L, MS[17]#6279L, MS[18]#6280L, MS[19]#6281L, MS[20]#6282L, MS[21]#6283L, MS[22]#6284L, MS[23]#6285L, MS[24]#6286L, MS[25]#6287L, MS[26]#6288L, MS[27]#6289L, MS[28]#6290L, MS[29]#6291L, MS[30]#6292L, MS[31]#6293L, MS[32]#6294L, MS[33]#6295L, MS[34]#6296L, MS[35]#6297L, MS[36]#6298L, MS[37]#6299L, MS[38]#6300L, MS[39]#6301L, MS[40]#6302L, MS[41]#6303L, MS[42]#6304L, MS[43]#6305L, MS[44]#6306L, MS[45]#6307L, MS[46]#6308L, MS[47]#6309L, MS[48]#6310L, MS[49]#6311L, MS[50]#6312L, MS[51]#6313L, sum#6428L, sum#6429, sum#6430, count#6431L]
Arguments: hashpartitioning(segment#6195, processing_day#6197, 200), ENSURE_REQUIREMENTS, [plan_id=604]
(16) HashAggregate
Input [59]: [segment#6195, processing_day#6197, count#6427L, MS[0]#6262L, MS[1]#6263L, MS[2]#6264L, MS[3]#6265L, MS[4]#6266L, MS[5]#6267L, MS[6]#6268L, MS[7]#6269L, MS[8]#6270L, MS[9]#6271L, MS[10]#6272L, MS[11]#6273L, MS[12]#6274L, MS[13]#6275L, MS[14]#6276L, MS[15]#6277L, MS[16]#6278L, MS[17]#6279L, MS[18]#6280L, MS[19]#6281L, MS[20]#6282L, MS[21]#6283L, MS[22]#6284L, MS[23]#6285L, MS[24]#6286L, MS[25]#6287L, MS[26]#6288L, MS[27]#6289L, MS[28]#6290L, MS[29]#6291L, MS[30]#6292L, MS[31]#6293L, MS[32]#6294L, MS[33]#6295L, MS[34]#6296L, MS[35]#6297L, MS[36]#6298L, MS[37]#6299L, MS[38]#6300L, MS[39]#6301L, MS[40]#6302L, MS[41]#6303L, MS[42]#6304L, MS[43]#6305L, MS[44]#6306L, MS[45]#6307L, MS[46]#6308L, MS[47]#6309L, MS[48]#6310L, MS[49]#6311L, MS[50]#6312L, MS[51]#6313L, sum#6428L, sum#6429, sum#6430, count#6431L]
Keys [2]: [segment#6195, processing_day#6197]
Functions [5]: [count(1), approx_count_distinct(customer_id#6191L, 0.05, 0, 0), sum(events#6201), sum(weighted_amount#6203), avg(amount#6199)]
Aggregate Attributes [5]: [count(1)#6209L, approx_count_distinct(customer_id#6191L, 0.05, 0, 0)#6314L, sum(events#6201)#6315L, sum(weighted_amount#6203)#6316, avg(amount#6199)#6317]
Results [7]: [segment#6195, processing_day#6197, count(1)#6209L AS row_count#6204L, approx_count_distinct(customer_id#6191L, 0.05, 0, 0)#6314L AS unique_customers#6205L, sum(events#6201)#6315L AS event_sum#6206L, sum(weighted_amount#6203)#6316 AS weighted_amount_sum#6207, avg(amount#6199)#6317 AS avg_amount#6208]
(17) Exchange
Input [7]: [segment#6195, processing_day#6197, row_count#6204L, unique_customers#6205L, event_sum#6206L, weighted_amount_sum#6207, avg_amount#6208]
Arguments: rangepartitioning(segment#6195 ASC NULLS FIRST, processing_day#6197 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=607]
(18) Sort
Input [7]: [segment#6195, processing_day#6197, row_count#6204L, unique_customers#6205L, event_sum#6206L, weighted_amount_sum#6207, avg_amount#6208]
Arguments: [segment#6195 ASC NULLS FIRST, processing_day#6197 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#6195, processing_day#6197, row_count#6204L, unique_customers#6205L, event_sum#6206L, weighted_amount_sum#6207, avg_amount#6208]
Arguments: isFinalPlan=true