== 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#19449L]
Arguments: Range (22000000, 23000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#19449L % 250000) AS customer_id#19451L, concat(segment-, cast(cast((id#19449L % 12) as int) as string)) AS segment#19455, cast((id#19449L % 14) as int) AS processing_day#19457, ((cast(((id#19449L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#19459, cast((((id#19449L * 29) % 7) + 1) as int) AS events#19461]
Input [1]: [id#19449L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#19451L, segment#19455, processing_day#19457, amount#19459, events#19461, (amount#19459 * cast(events#19461 as double)) AS weighted_amount#19463]
Input [5]: [customer_id#19451L, segment#19455, processing_day#19457, amount#19459, events#19461]
(4) HashAggregate
Input [6]: [customer_id#19451L, segment#19455, processing_day#19457, amount#19459, events#19461, weighted_amount#19463]
Keys [2]: [segment#19455, processing_day#19457]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#19451L, 0.05, 0, 0), partial_sum(events#19461), partial_sum(weighted_amount#19463), partial_avg(amount#19459)]
Aggregate Attributes [57]: [count#19682L, MS[0]#19470L, MS[1]#19471L, MS[2]#19472L, MS[3]#19473L, MS[4]#19474L, MS[5]#19475L, MS[6]#19476L, MS[7]#19477L, MS[8]#19478L, MS[9]#19479L, MS[10]#19480L, MS[11]#19481L, MS[12]#19482L, MS[13]#19483L, MS[14]#19484L, MS[15]#19485L, MS[16]#19486L, MS[17]#19487L, MS[18]#19488L, MS[19]#19489L, MS[20]#19490L, MS[21]#19491L, MS[22]#19492L, MS[23]#19493L, MS[24]#19494L, MS[25]#19495L, MS[26]#19496L, MS[27]#19497L, MS[28]#19498L, MS[29]#19499L, MS[30]#19500L, MS[31]#19501L, MS[32]#19502L, MS[33]#19503L, MS[34]#19504L, MS[35]#19505L, MS[36]#19506L, MS[37]#19507L, MS[38]#19508L, MS[39]#19509L, MS[40]#19510L, MS[41]#19511L, MS[42]#19512L, MS[43]#19513L, MS[44]#19514L, MS[45]#19515L, MS[46]#19516L, MS[47]#19517L, MS[48]#19518L, MS[49]#19519L, MS[50]#19520L, MS[51]#19521L, sum#19683L, sum#19684, sum#19685, count#19686L]
Results [59]: [segment#19455, processing_day#19457, count#19687L, MS[0]#19522L, MS[1]#19523L, MS[2]#19524L, MS[3]#19525L, MS[4]#19526L, MS[5]#19527L, MS[6]#19528L, MS[7]#19529L, MS[8]#19530L, MS[9]#19531L, MS[10]#19532L, MS[11]#19533L, MS[12]#19534L, MS[13]#19535L, MS[14]#19536L, MS[15]#19537L, MS[16]#19538L, MS[17]#19539L, MS[18]#19540L, MS[19]#19541L, MS[20]#19542L, MS[21]#19543L, MS[22]#19544L, MS[23]#19545L, MS[24]#19546L, MS[25]#19547L, MS[26]#19548L, MS[27]#19549L, MS[28]#19550L, MS[29]#19551L, MS[30]#19552L, MS[31]#19553L, MS[32]#19554L, MS[33]#19555L, MS[34]#19556L, MS[35]#19557L, MS[36]#19558L, MS[37]#19559L, MS[38]#19560L, MS[39]#19561L, MS[40]#19562L, MS[41]#19563L, MS[42]#19564L, MS[43]#19565L, MS[44]#19566L, MS[45]#19567L, MS[46]#19568L, MS[47]#19569L, MS[48]#19570L, MS[49]#19571L, MS[50]#19572L, MS[51]#19573L, sum#19688L, sum#19689, sum#19690, count#19691L]
(5) Exchange
Input [59]: [segment#19455, processing_day#19457, count#19687L, MS[0]#19522L, MS[1]#19523L, MS[2]#19524L, MS[3]#19525L, MS[4]#19526L, MS[5]#19527L, MS[6]#19528L, MS[7]#19529L, MS[8]#19530L, MS[9]#19531L, MS[10]#19532L, MS[11]#19533L, MS[12]#19534L, MS[13]#19535L, MS[14]#19536L, MS[15]#19537L, MS[16]#19538L, MS[17]#19539L, MS[18]#19540L, MS[19]#19541L, MS[20]#19542L, MS[21]#19543L, MS[22]#19544L, MS[23]#19545L, MS[24]#19546L, MS[25]#19547L, MS[26]#19548L, MS[27]#19549L, MS[28]#19550L, MS[29]#19551L, MS[30]#19552L, MS[31]#19553L, MS[32]#19554L, MS[33]#19555L, MS[34]#19556L, MS[35]#19557L, MS[36]#19558L, MS[37]#19559L, MS[38]#19560L, MS[39]#19561L, MS[40]#19562L, MS[41]#19563L, MS[42]#19564L, MS[43]#19565L, MS[44]#19566L, MS[45]#19567L, MS[46]#19568L, MS[47]#19569L, MS[48]#19570L, MS[49]#19571L, MS[50]#19572L, MS[51]#19573L, sum#19688L, sum#19689, sum#19690, count#19691L]
Arguments: hashpartitioning(segment#19455, processing_day#19457, 200), ENSURE_REQUIREMENTS, [plan_id=1869]
(6) ShuffleQueryStage
Output [59]: [segment#19455, processing_day#19457, count#19687L, MS[0]#19522L, MS[1]#19523L, MS[2]#19524L, MS[3]#19525L, MS[4]#19526L, MS[5]#19527L, MS[6]#19528L, MS[7]#19529L, MS[8]#19530L, MS[9]#19531L, MS[10]#19532L, MS[11]#19533L, MS[12]#19534L, MS[13]#19535L, MS[14]#19536L, MS[15]#19537L, MS[16]#19538L, MS[17]#19539L, MS[18]#19540L, MS[19]#19541L, MS[20]#19542L, MS[21]#19543L, MS[22]#19544L, MS[23]#19545L, MS[24]#19546L, MS[25]#19547L, MS[26]#19548L, MS[27]#19549L, MS[28]#19550L, MS[29]#19551L, MS[30]#19552L, MS[31]#19553L, MS[32]#19554L, MS[33]#19555L, MS[34]#19556L, MS[35]#19557L, MS[36]#19558L, MS[37]#19559L, MS[38]#19560L, MS[39]#19561L, MS[40]#19562L, MS[41]#19563L, MS[42]#19564L, MS[43]#19565L, MS[44]#19566L, MS[45]#19567L, MS[46]#19568L, MS[47]#19569L, MS[48]#19570L, MS[49]#19571L, MS[50]#19572L, MS[51]#19573L, sum#19688L, sum#19689, sum#19690, count#19691L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#19455, processing_day#19457, count#19687L, MS[0]#19522L, MS[1]#19523L, MS[2]#19524L, MS[3]#19525L, MS[4]#19526L, MS[5]#19527L, MS[6]#19528L, MS[7]#19529L, MS[8]#19530L, MS[9]#19531L, MS[10]#19532L, MS[11]#19533L, MS[12]#19534L, MS[13]#19535L, MS[14]#19536L, MS[15]#19537L, MS[16]#19538L, MS[17]#19539L, MS[18]#19540L, MS[19]#19541L, MS[20]#19542L, MS[21]#19543L, MS[22]#19544L, MS[23]#19545L, MS[24]#19546L, MS[25]#19547L, MS[26]#19548L, MS[27]#19549L, MS[28]#19550L, MS[29]#19551L, MS[30]#19552L, MS[31]#19553L, MS[32]#19554L, MS[33]#19555L, MS[34]#19556L, MS[35]#19557L, MS[36]#19558L, MS[37]#19559L, MS[38]#19560L, MS[39]#19561L, MS[40]#19562L, MS[41]#19563L, MS[42]#19564L, MS[43]#19565L, MS[44]#19566L, MS[45]#19567L, MS[46]#19568L, MS[47]#19569L, MS[48]#19570L, MS[49]#19571L, MS[50]#19572L, MS[51]#19573L, sum#19688L, sum#19689, sum#19690, count#19691L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#19455, processing_day#19457, count#19687L, MS[0]#19522L, MS[1]#19523L, MS[2]#19524L, MS[3]#19525L, MS[4]#19526L, MS[5]#19527L, MS[6]#19528L, MS[7]#19529L, MS[8]#19530L, MS[9]#19531L, MS[10]#19532L, MS[11]#19533L, MS[12]#19534L, MS[13]#19535L, MS[14]#19536L, MS[15]#19537L, MS[16]#19538L, MS[17]#19539L, MS[18]#19540L, MS[19]#19541L, MS[20]#19542L, MS[21]#19543L, MS[22]#19544L, MS[23]#19545L, MS[24]#19546L, MS[25]#19547L, MS[26]#19548L, MS[27]#19549L, MS[28]#19550L, MS[29]#19551L, MS[30]#19552L, MS[31]#19553L, MS[32]#19554L, MS[33]#19555L, MS[34]#19556L, MS[35]#19557L, MS[36]#19558L, MS[37]#19559L, MS[38]#19560L, MS[39]#19561L, MS[40]#19562L, MS[41]#19563L, MS[42]#19564L, MS[43]#19565L, MS[44]#19566L, MS[45]#19567L, MS[46]#19568L, MS[47]#19569L, MS[48]#19570L, MS[49]#19571L, MS[50]#19572L, MS[51]#19573L, sum#19688L, sum#19689, sum#19690, count#19691L]
Keys [2]: [segment#19455, processing_day#19457]
Functions [5]: [count(1), approx_count_distinct(customer_id#19451L, 0.05, 0, 0), sum(events#19461), sum(weighted_amount#19463), avg(amount#19459)]
Aggregate Attributes [5]: [count(1)#19469L, approx_count_distinct(customer_id#19451L, 0.05, 0, 0)#19574L, sum(events#19461)#19575L, sum(weighted_amount#19463)#19576, avg(amount#19459)#19577]
Results [7]: [segment#19455, processing_day#19457, count(1)#19469L AS row_count#19464L, approx_count_distinct(customer_id#19451L, 0.05, 0, 0)#19574L AS unique_customers#19465L, sum(events#19461)#19575L AS event_sum#19466L, sum(weighted_amount#19463)#19576 AS weighted_amount_sum#19467, avg(amount#19459)#19577 AS avg_amount#19468]
(9) Exchange
Input [7]: [segment#19455, processing_day#19457, row_count#19464L, unique_customers#19465L, event_sum#19466L, weighted_amount_sum#19467, avg_amount#19468]
Arguments: rangepartitioning(segment#19455 ASC NULLS FIRST, processing_day#19457 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1891]
(10) ShuffleQueryStage
Output [7]: [segment#19455, processing_day#19457, row_count#19464L, unique_customers#19465L, event_sum#19466L, weighted_amount_sum#19467, avg_amount#19468]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#19455, processing_day#19457, row_count#19464L, unique_customers#19465L, event_sum#19466L, weighted_amount_sum#19467, avg_amount#19468]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#19455, processing_day#19457, row_count#19464L, unique_customers#19465L, event_sum#19466L, weighted_amount_sum#19467, avg_amount#19468]
Arguments: [segment#19455 ASC NULLS FIRST, processing_day#19457 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#19455, processing_day#19457, row_count#19464L, unique_customers#19465L, event_sum#19466L, weighted_amount_sum#19467, avg_amount#19468]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#19451L, segment#19455, processing_day#19457, amount#19459, events#19461, weighted_amount#19463]
Keys [2]: [segment#19455, processing_day#19457]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#19451L, 0.05, 0, 0), partial_sum(events#19461), partial_sum(weighted_amount#19463), partial_avg(amount#19459)]
Aggregate Attributes [57]: [count#19682L, MS[0]#19470L, MS[1]#19471L, MS[2]#19472L, MS[3]#19473L, MS[4]#19474L, MS[5]#19475L, MS[6]#19476L, MS[7]#19477L, MS[8]#19478L, MS[9]#19479L, MS[10]#19480L, MS[11]#19481L, MS[12]#19482L, MS[13]#19483L, MS[14]#19484L, MS[15]#19485L, MS[16]#19486L, MS[17]#19487L, MS[18]#19488L, MS[19]#19489L, MS[20]#19490L, MS[21]#19491L, MS[22]#19492L, MS[23]#19493L, MS[24]#19494L, MS[25]#19495L, MS[26]#19496L, MS[27]#19497L, MS[28]#19498L, MS[29]#19499L, MS[30]#19500L, MS[31]#19501L, MS[32]#19502L, MS[33]#19503L, MS[34]#19504L, MS[35]#19505L, MS[36]#19506L, MS[37]#19507L, MS[38]#19508L, MS[39]#19509L, MS[40]#19510L, MS[41]#19511L, MS[42]#19512L, MS[43]#19513L, MS[44]#19514L, MS[45]#19515L, MS[46]#19516L, MS[47]#19517L, MS[48]#19518L, MS[49]#19519L, MS[50]#19520L, MS[51]#19521L, sum#19683L, sum#19684, sum#19685, count#19686L]
Results [59]: [segment#19455, processing_day#19457, count#19687L, MS[0]#19522L, MS[1]#19523L, MS[2]#19524L, MS[3]#19525L, MS[4]#19526L, MS[5]#19527L, MS[6]#19528L, MS[7]#19529L, MS[8]#19530L, MS[9]#19531L, MS[10]#19532L, MS[11]#19533L, MS[12]#19534L, MS[13]#19535L, MS[14]#19536L, MS[15]#19537L, MS[16]#19538L, MS[17]#19539L, MS[18]#19540L, MS[19]#19541L, MS[20]#19542L, MS[21]#19543L, MS[22]#19544L, MS[23]#19545L, MS[24]#19546L, MS[25]#19547L, MS[26]#19548L, MS[27]#19549L, MS[28]#19550L, MS[29]#19551L, MS[30]#19552L, MS[31]#19553L, MS[32]#19554L, MS[33]#19555L, MS[34]#19556L, MS[35]#19557L, MS[36]#19558L, MS[37]#19559L, MS[38]#19560L, MS[39]#19561L, MS[40]#19562L, MS[41]#19563L, MS[42]#19564L, MS[43]#19565L, MS[44]#19566L, MS[45]#19567L, MS[46]#19568L, MS[47]#19569L, MS[48]#19570L, MS[49]#19571L, MS[50]#19572L, MS[51]#19573L, sum#19688L, sum#19689, sum#19690, count#19691L]
(15) Exchange
Input [59]: [segment#19455, processing_day#19457, count#19687L, MS[0]#19522L, MS[1]#19523L, MS[2]#19524L, MS[3]#19525L, MS[4]#19526L, MS[5]#19527L, MS[6]#19528L, MS[7]#19529L, MS[8]#19530L, MS[9]#19531L, MS[10]#19532L, MS[11]#19533L, MS[12]#19534L, MS[13]#19535L, MS[14]#19536L, MS[15]#19537L, MS[16]#19538L, MS[17]#19539L, MS[18]#19540L, MS[19]#19541L, MS[20]#19542L, MS[21]#19543L, MS[22]#19544L, MS[23]#19545L, MS[24]#19546L, MS[25]#19547L, MS[26]#19548L, MS[27]#19549L, MS[28]#19550L, MS[29]#19551L, MS[30]#19552L, MS[31]#19553L, MS[32]#19554L, MS[33]#19555L, MS[34]#19556L, MS[35]#19557L, MS[36]#19558L, MS[37]#19559L, MS[38]#19560L, MS[39]#19561L, MS[40]#19562L, MS[41]#19563L, MS[42]#19564L, MS[43]#19565L, MS[44]#19566L, MS[45]#19567L, MS[46]#19568L, MS[47]#19569L, MS[48]#19570L, MS[49]#19571L, MS[50]#19572L, MS[51]#19573L, sum#19688L, sum#19689, sum#19690, count#19691L]
Arguments: hashpartitioning(segment#19455, processing_day#19457, 200), ENSURE_REQUIREMENTS, [plan_id=1849]
(16) HashAggregate
Input [59]: [segment#19455, processing_day#19457, count#19687L, MS[0]#19522L, MS[1]#19523L, MS[2]#19524L, MS[3]#19525L, MS[4]#19526L, MS[5]#19527L, MS[6]#19528L, MS[7]#19529L, MS[8]#19530L, MS[9]#19531L, MS[10]#19532L, MS[11]#19533L, MS[12]#19534L, MS[13]#19535L, MS[14]#19536L, MS[15]#19537L, MS[16]#19538L, MS[17]#19539L, MS[18]#19540L, MS[19]#19541L, MS[20]#19542L, MS[21]#19543L, MS[22]#19544L, MS[23]#19545L, MS[24]#19546L, MS[25]#19547L, MS[26]#19548L, MS[27]#19549L, MS[28]#19550L, MS[29]#19551L, MS[30]#19552L, MS[31]#19553L, MS[32]#19554L, MS[33]#19555L, MS[34]#19556L, MS[35]#19557L, MS[36]#19558L, MS[37]#19559L, MS[38]#19560L, MS[39]#19561L, MS[40]#19562L, MS[41]#19563L, MS[42]#19564L, MS[43]#19565L, MS[44]#19566L, MS[45]#19567L, MS[46]#19568L, MS[47]#19569L, MS[48]#19570L, MS[49]#19571L, MS[50]#19572L, MS[51]#19573L, sum#19688L, sum#19689, sum#19690, count#19691L]
Keys [2]: [segment#19455, processing_day#19457]
Functions [5]: [count(1), approx_count_distinct(customer_id#19451L, 0.05, 0, 0), sum(events#19461), sum(weighted_amount#19463), avg(amount#19459)]
Aggregate Attributes [5]: [count(1)#19469L, approx_count_distinct(customer_id#19451L, 0.05, 0, 0)#19574L, sum(events#19461)#19575L, sum(weighted_amount#19463)#19576, avg(amount#19459)#19577]
Results [7]: [segment#19455, processing_day#19457, count(1)#19469L AS row_count#19464L, approx_count_distinct(customer_id#19451L, 0.05, 0, 0)#19574L AS unique_customers#19465L, sum(events#19461)#19575L AS event_sum#19466L, sum(weighted_amount#19463)#19576 AS weighted_amount_sum#19467, avg(amount#19459)#19577 AS avg_amount#19468]
(17) Exchange
Input [7]: [segment#19455, processing_day#19457, row_count#19464L, unique_customers#19465L, event_sum#19466L, weighted_amount_sum#19467, avg_amount#19468]
Arguments: rangepartitioning(segment#19455 ASC NULLS FIRST, processing_day#19457 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1852]
(18) Sort
Input [7]: [segment#19455, processing_day#19457, row_count#19464L, unique_customers#19465L, event_sum#19466L, weighted_amount_sum#19467, avg_amount#19468]
Arguments: [segment#19455 ASC NULLS FIRST, processing_day#19457 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#19455, processing_day#19457, row_count#19464L, unique_customers#19465L, event_sum#19466L, weighted_amount_sum#19467, avg_amount#19468]
Arguments: isFinalPlan=true