== 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#58415L]
Arguments: Range (18000000, 19000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#58415L % 250000) AS customer_id#58417L, concat(segment-, cast(cast((id#58415L % 12) as int) as string)) AS segment#58421, cast((id#58415L % 14) as int) AS processing_day#58423, ((cast(((id#58415L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#58425, cast((((id#58415L * 29) % 7) + 1) as int) AS events#58427]
Input [1]: [id#58415L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#58417L, segment#58421, processing_day#58423, amount#58425, events#58427, (amount#58425 * cast(events#58427 as double)) AS weighted_amount#58429]
Input [5]: [customer_id#58417L, segment#58421, processing_day#58423, amount#58425, events#58427]
(4) HashAggregate
Input [6]: [customer_id#58417L, segment#58421, processing_day#58423, amount#58425, events#58427, weighted_amount#58429]
Keys [2]: [segment#58421, processing_day#58423]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#58417L, 0.05, 0, 0), partial_sum(events#58427), partial_sum(weighted_amount#58429), partial_avg(amount#58425)]
Aggregate Attributes [57]: [count#58648L, MS[0]#58436L, MS[1]#58437L, MS[2]#58438L, MS[3]#58439L, MS[4]#58440L, MS[5]#58441L, MS[6]#58442L, MS[7]#58443L, MS[8]#58444L, MS[9]#58445L, MS[10]#58446L, MS[11]#58447L, MS[12]#58448L, MS[13]#58449L, MS[14]#58450L, MS[15]#58451L, MS[16]#58452L, MS[17]#58453L, MS[18]#58454L, MS[19]#58455L, MS[20]#58456L, MS[21]#58457L, MS[22]#58458L, MS[23]#58459L, MS[24]#58460L, MS[25]#58461L, MS[26]#58462L, MS[27]#58463L, MS[28]#58464L, MS[29]#58465L, MS[30]#58466L, MS[31]#58467L, MS[32]#58468L, MS[33]#58469L, MS[34]#58470L, MS[35]#58471L, MS[36]#58472L, MS[37]#58473L, MS[38]#58474L, MS[39]#58475L, MS[40]#58476L, MS[41]#58477L, MS[42]#58478L, MS[43]#58479L, MS[44]#58480L, MS[45]#58481L, MS[46]#58482L, MS[47]#58483L, MS[48]#58484L, MS[49]#58485L, MS[50]#58486L, MS[51]#58487L, sum#58649L, sum#58650, sum#58651, count#58652L]
Results [59]: [segment#58421, processing_day#58423, count#58653L, MS[0]#58488L, MS[1]#58489L, MS[2]#58490L, MS[3]#58491L, MS[4]#58492L, MS[5]#58493L, MS[6]#58494L, MS[7]#58495L, MS[8]#58496L, MS[9]#58497L, MS[10]#58498L, MS[11]#58499L, MS[12]#58500L, MS[13]#58501L, MS[14]#58502L, MS[15]#58503L, MS[16]#58504L, MS[17]#58505L, MS[18]#58506L, MS[19]#58507L, MS[20]#58508L, MS[21]#58509L, MS[22]#58510L, MS[23]#58511L, MS[24]#58512L, MS[25]#58513L, MS[26]#58514L, MS[27]#58515L, MS[28]#58516L, MS[29]#58517L, MS[30]#58518L, MS[31]#58519L, MS[32]#58520L, MS[33]#58521L, MS[34]#58522L, MS[35]#58523L, MS[36]#58524L, MS[37]#58525L, MS[38]#58526L, MS[39]#58527L, MS[40]#58528L, MS[41]#58529L, MS[42]#58530L, MS[43]#58531L, MS[44]#58532L, MS[45]#58533L, MS[46]#58534L, MS[47]#58535L, MS[48]#58536L, MS[49]#58537L, MS[50]#58538L, MS[51]#58539L, sum#58654L, sum#58655, sum#58656, count#58657L]
(5) Exchange
Input [59]: [segment#58421, processing_day#58423, count#58653L, MS[0]#58488L, MS[1]#58489L, MS[2]#58490L, MS[3]#58491L, MS[4]#58492L, MS[5]#58493L, MS[6]#58494L, MS[7]#58495L, MS[8]#58496L, MS[9]#58497L, MS[10]#58498L, MS[11]#58499L, MS[12]#58500L, MS[13]#58501L, MS[14]#58502L, MS[15]#58503L, MS[16]#58504L, MS[17]#58505L, MS[18]#58506L, MS[19]#58507L, MS[20]#58508L, MS[21]#58509L, MS[22]#58510L, MS[23]#58511L, MS[24]#58512L, MS[25]#58513L, MS[26]#58514L, MS[27]#58515L, MS[28]#58516L, MS[29]#58517L, MS[30]#58518L, MS[31]#58519L, MS[32]#58520L, MS[33]#58521L, MS[34]#58522L, MS[35]#58523L, MS[36]#58524L, MS[37]#58525L, MS[38]#58526L, MS[39]#58527L, MS[40]#58528L, MS[41]#58529L, MS[42]#58530L, MS[43]#58531L, MS[44]#58532L, MS[45]#58533L, MS[46]#58534L, MS[47]#58535L, MS[48]#58536L, MS[49]#58537L, MS[50]#58538L, MS[51]#58539L, sum#58654L, sum#58655, sum#58656, count#58657L]
Arguments: hashpartitioning(segment#58421, processing_day#58423, 200), ENSURE_REQUIREMENTS, [plan_id=5533]
(6) ShuffleQueryStage
Output [59]: [segment#58421, processing_day#58423, count#58653L, MS[0]#58488L, MS[1]#58489L, MS[2]#58490L, MS[3]#58491L, MS[4]#58492L, MS[5]#58493L, MS[6]#58494L, MS[7]#58495L, MS[8]#58496L, MS[9]#58497L, MS[10]#58498L, MS[11]#58499L, MS[12]#58500L, MS[13]#58501L, MS[14]#58502L, MS[15]#58503L, MS[16]#58504L, MS[17]#58505L, MS[18]#58506L, MS[19]#58507L, MS[20]#58508L, MS[21]#58509L, MS[22]#58510L, MS[23]#58511L, MS[24]#58512L, MS[25]#58513L, MS[26]#58514L, MS[27]#58515L, MS[28]#58516L, MS[29]#58517L, MS[30]#58518L, MS[31]#58519L, MS[32]#58520L, MS[33]#58521L, MS[34]#58522L, MS[35]#58523L, MS[36]#58524L, MS[37]#58525L, MS[38]#58526L, MS[39]#58527L, MS[40]#58528L, MS[41]#58529L, MS[42]#58530L, MS[43]#58531L, MS[44]#58532L, MS[45]#58533L, MS[46]#58534L, MS[47]#58535L, MS[48]#58536L, MS[49]#58537L, MS[50]#58538L, MS[51]#58539L, sum#58654L, sum#58655, sum#58656, count#58657L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#58421, processing_day#58423, count#58653L, MS[0]#58488L, MS[1]#58489L, MS[2]#58490L, MS[3]#58491L, MS[4]#58492L, MS[5]#58493L, MS[6]#58494L, MS[7]#58495L, MS[8]#58496L, MS[9]#58497L, MS[10]#58498L, MS[11]#58499L, MS[12]#58500L, MS[13]#58501L, MS[14]#58502L, MS[15]#58503L, MS[16]#58504L, MS[17]#58505L, MS[18]#58506L, MS[19]#58507L, MS[20]#58508L, MS[21]#58509L, MS[22]#58510L, MS[23]#58511L, MS[24]#58512L, MS[25]#58513L, MS[26]#58514L, MS[27]#58515L, MS[28]#58516L, MS[29]#58517L, MS[30]#58518L, MS[31]#58519L, MS[32]#58520L, MS[33]#58521L, MS[34]#58522L, MS[35]#58523L, MS[36]#58524L, MS[37]#58525L, MS[38]#58526L, MS[39]#58527L, MS[40]#58528L, MS[41]#58529L, MS[42]#58530L, MS[43]#58531L, MS[44]#58532L, MS[45]#58533L, MS[46]#58534L, MS[47]#58535L, MS[48]#58536L, MS[49]#58537L, MS[50]#58538L, MS[51]#58539L, sum#58654L, sum#58655, sum#58656, count#58657L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#58421, processing_day#58423, count#58653L, MS[0]#58488L, MS[1]#58489L, MS[2]#58490L, MS[3]#58491L, MS[4]#58492L, MS[5]#58493L, MS[6]#58494L, MS[7]#58495L, MS[8]#58496L, MS[9]#58497L, MS[10]#58498L, MS[11]#58499L, MS[12]#58500L, MS[13]#58501L, MS[14]#58502L, MS[15]#58503L, MS[16]#58504L, MS[17]#58505L, MS[18]#58506L, MS[19]#58507L, MS[20]#58508L, MS[21]#58509L, MS[22]#58510L, MS[23]#58511L, MS[24]#58512L, MS[25]#58513L, MS[26]#58514L, MS[27]#58515L, MS[28]#58516L, MS[29]#58517L, MS[30]#58518L, MS[31]#58519L, MS[32]#58520L, MS[33]#58521L, MS[34]#58522L, MS[35]#58523L, MS[36]#58524L, MS[37]#58525L, MS[38]#58526L, MS[39]#58527L, MS[40]#58528L, MS[41]#58529L, MS[42]#58530L, MS[43]#58531L, MS[44]#58532L, MS[45]#58533L, MS[46]#58534L, MS[47]#58535L, MS[48]#58536L, MS[49]#58537L, MS[50]#58538L, MS[51]#58539L, sum#58654L, sum#58655, sum#58656, count#58657L]
Keys [2]: [segment#58421, processing_day#58423]
Functions [5]: [count(1), approx_count_distinct(customer_id#58417L, 0.05, 0, 0), sum(events#58427), sum(weighted_amount#58429), avg(amount#58425)]
Aggregate Attributes [5]: [count(1)#58435L, approx_count_distinct(customer_id#58417L, 0.05, 0, 0)#58540L, sum(events#58427)#58541L, sum(weighted_amount#58429)#58542, avg(amount#58425)#58543]
Results [7]: [segment#58421, processing_day#58423, count(1)#58435L AS row_count#58430L, approx_count_distinct(customer_id#58417L, 0.05, 0, 0)#58540L AS unique_customers#58431L, sum(events#58427)#58541L AS event_sum#58432L, sum(weighted_amount#58429)#58542 AS weighted_amount_sum#58433, avg(amount#58425)#58543 AS avg_amount#58434]
(9) Exchange
Input [7]: [segment#58421, processing_day#58423, row_count#58430L, unique_customers#58431L, event_sum#58432L, weighted_amount_sum#58433, avg_amount#58434]
Arguments: rangepartitioning(segment#58421 ASC NULLS FIRST, processing_day#58423 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5555]
(10) ShuffleQueryStage
Output [7]: [segment#58421, processing_day#58423, row_count#58430L, unique_customers#58431L, event_sum#58432L, weighted_amount_sum#58433, avg_amount#58434]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#58421, processing_day#58423, row_count#58430L, unique_customers#58431L, event_sum#58432L, weighted_amount_sum#58433, avg_amount#58434]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#58421, processing_day#58423, row_count#58430L, unique_customers#58431L, event_sum#58432L, weighted_amount_sum#58433, avg_amount#58434]
Arguments: [segment#58421 ASC NULLS FIRST, processing_day#58423 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#58421, processing_day#58423, row_count#58430L, unique_customers#58431L, event_sum#58432L, weighted_amount_sum#58433, avg_amount#58434]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#58417L, segment#58421, processing_day#58423, amount#58425, events#58427, weighted_amount#58429]
Keys [2]: [segment#58421, processing_day#58423]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#58417L, 0.05, 0, 0), partial_sum(events#58427), partial_sum(weighted_amount#58429), partial_avg(amount#58425)]
Aggregate Attributes [57]: [count#58648L, MS[0]#58436L, MS[1]#58437L, MS[2]#58438L, MS[3]#58439L, MS[4]#58440L, MS[5]#58441L, MS[6]#58442L, MS[7]#58443L, MS[8]#58444L, MS[9]#58445L, MS[10]#58446L, MS[11]#58447L, MS[12]#58448L, MS[13]#58449L, MS[14]#58450L, MS[15]#58451L, MS[16]#58452L, MS[17]#58453L, MS[18]#58454L, MS[19]#58455L, MS[20]#58456L, MS[21]#58457L, MS[22]#58458L, MS[23]#58459L, MS[24]#58460L, MS[25]#58461L, MS[26]#58462L, MS[27]#58463L, MS[28]#58464L, MS[29]#58465L, MS[30]#58466L, MS[31]#58467L, MS[32]#58468L, MS[33]#58469L, MS[34]#58470L, MS[35]#58471L, MS[36]#58472L, MS[37]#58473L, MS[38]#58474L, MS[39]#58475L, MS[40]#58476L, MS[41]#58477L, MS[42]#58478L, MS[43]#58479L, MS[44]#58480L, MS[45]#58481L, MS[46]#58482L, MS[47]#58483L, MS[48]#58484L, MS[49]#58485L, MS[50]#58486L, MS[51]#58487L, sum#58649L, sum#58650, sum#58651, count#58652L]
Results [59]: [segment#58421, processing_day#58423, count#58653L, MS[0]#58488L, MS[1]#58489L, MS[2]#58490L, MS[3]#58491L, MS[4]#58492L, MS[5]#58493L, MS[6]#58494L, MS[7]#58495L, MS[8]#58496L, MS[9]#58497L, MS[10]#58498L, MS[11]#58499L, MS[12]#58500L, MS[13]#58501L, MS[14]#58502L, MS[15]#58503L, MS[16]#58504L, MS[17]#58505L, MS[18]#58506L, MS[19]#58507L, MS[20]#58508L, MS[21]#58509L, MS[22]#58510L, MS[23]#58511L, MS[24]#58512L, MS[25]#58513L, MS[26]#58514L, MS[27]#58515L, MS[28]#58516L, MS[29]#58517L, MS[30]#58518L, MS[31]#58519L, MS[32]#58520L, MS[33]#58521L, MS[34]#58522L, MS[35]#58523L, MS[36]#58524L, MS[37]#58525L, MS[38]#58526L, MS[39]#58527L, MS[40]#58528L, MS[41]#58529L, MS[42]#58530L, MS[43]#58531L, MS[44]#58532L, MS[45]#58533L, MS[46]#58534L, MS[47]#58535L, MS[48]#58536L, MS[49]#58537L, MS[50]#58538L, MS[51]#58539L, sum#58654L, sum#58655, sum#58656, count#58657L]
(15) Exchange
Input [59]: [segment#58421, processing_day#58423, count#58653L, MS[0]#58488L, MS[1]#58489L, MS[2]#58490L, MS[3]#58491L, MS[4]#58492L, MS[5]#58493L, MS[6]#58494L, MS[7]#58495L, MS[8]#58496L, MS[9]#58497L, MS[10]#58498L, MS[11]#58499L, MS[12]#58500L, MS[13]#58501L, MS[14]#58502L, MS[15]#58503L, MS[16]#58504L, MS[17]#58505L, MS[18]#58506L, MS[19]#58507L, MS[20]#58508L, MS[21]#58509L, MS[22]#58510L, MS[23]#58511L, MS[24]#58512L, MS[25]#58513L, MS[26]#58514L, MS[27]#58515L, MS[28]#58516L, MS[29]#58517L, MS[30]#58518L, MS[31]#58519L, MS[32]#58520L, MS[33]#58521L, MS[34]#58522L, MS[35]#58523L, MS[36]#58524L, MS[37]#58525L, MS[38]#58526L, MS[39]#58527L, MS[40]#58528L, MS[41]#58529L, MS[42]#58530L, MS[43]#58531L, MS[44]#58532L, MS[45]#58533L, MS[46]#58534L, MS[47]#58535L, MS[48]#58536L, MS[49]#58537L, MS[50]#58538L, MS[51]#58539L, sum#58654L, sum#58655, sum#58656, count#58657L]
Arguments: hashpartitioning(segment#58421, processing_day#58423, 200), ENSURE_REQUIREMENTS, [plan_id=5513]
(16) HashAggregate
Input [59]: [segment#58421, processing_day#58423, count#58653L, MS[0]#58488L, MS[1]#58489L, MS[2]#58490L, MS[3]#58491L, MS[4]#58492L, MS[5]#58493L, MS[6]#58494L, MS[7]#58495L, MS[8]#58496L, MS[9]#58497L, MS[10]#58498L, MS[11]#58499L, MS[12]#58500L, MS[13]#58501L, MS[14]#58502L, MS[15]#58503L, MS[16]#58504L, MS[17]#58505L, MS[18]#58506L, MS[19]#58507L, MS[20]#58508L, MS[21]#58509L, MS[22]#58510L, MS[23]#58511L, MS[24]#58512L, MS[25]#58513L, MS[26]#58514L, MS[27]#58515L, MS[28]#58516L, MS[29]#58517L, MS[30]#58518L, MS[31]#58519L, MS[32]#58520L, MS[33]#58521L, MS[34]#58522L, MS[35]#58523L, MS[36]#58524L, MS[37]#58525L, MS[38]#58526L, MS[39]#58527L, MS[40]#58528L, MS[41]#58529L, MS[42]#58530L, MS[43]#58531L, MS[44]#58532L, MS[45]#58533L, MS[46]#58534L, MS[47]#58535L, MS[48]#58536L, MS[49]#58537L, MS[50]#58538L, MS[51]#58539L, sum#58654L, sum#58655, sum#58656, count#58657L]
Keys [2]: [segment#58421, processing_day#58423]
Functions [5]: [count(1), approx_count_distinct(customer_id#58417L, 0.05, 0, 0), sum(events#58427), sum(weighted_amount#58429), avg(amount#58425)]
Aggregate Attributes [5]: [count(1)#58435L, approx_count_distinct(customer_id#58417L, 0.05, 0, 0)#58540L, sum(events#58427)#58541L, sum(weighted_amount#58429)#58542, avg(amount#58425)#58543]
Results [7]: [segment#58421, processing_day#58423, count(1)#58435L AS row_count#58430L, approx_count_distinct(customer_id#58417L, 0.05, 0, 0)#58540L AS unique_customers#58431L, sum(events#58427)#58541L AS event_sum#58432L, sum(weighted_amount#58429)#58542 AS weighted_amount_sum#58433, avg(amount#58425)#58543 AS avg_amount#58434]
(17) Exchange
Input [7]: [segment#58421, processing_day#58423, row_count#58430L, unique_customers#58431L, event_sum#58432L, weighted_amount_sum#58433, avg_amount#58434]
Arguments: rangepartitioning(segment#58421 ASC NULLS FIRST, processing_day#58423 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5516]
(18) Sort
Input [7]: [segment#58421, processing_day#58423, row_count#58430L, unique_customers#58431L, event_sum#58432L, weighted_amount_sum#58433, avg_amount#58434]
Arguments: [segment#58421 ASC NULLS FIRST, processing_day#58423 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#58421, processing_day#58423, row_count#58430L, unique_customers#58431L, event_sum#58432L, weighted_amount_sum#58433, avg_amount#58434]
Arguments: isFinalPlan=true