== 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#50459L]
Arguments: Range (9000000, 10000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#50459L % 250000) AS customer_id#50461L, concat(segment-, cast(cast((id#50459L % 12) as int) as string)) AS segment#50465, cast((id#50459L % 14) as int) AS processing_day#50467, ((cast(((id#50459L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#50469, cast((((id#50459L * 29) % 7) + 1) as int) AS events#50471]
Input [1]: [id#50459L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#50461L, segment#50465, processing_day#50467, amount#50469, events#50471, (amount#50469 * cast(events#50471 as double)) AS weighted_amount#50473]
Input [5]: [customer_id#50461L, segment#50465, processing_day#50467, amount#50469, events#50471]
(4) HashAggregate
Input [6]: [customer_id#50461L, segment#50465, processing_day#50467, amount#50469, events#50471, weighted_amount#50473]
Keys [2]: [segment#50465, processing_day#50467]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#50461L, 0.05, 0, 0), partial_sum(events#50471), partial_sum(weighted_amount#50473), partial_avg(amount#50469)]
Aggregate Attributes [57]: [count#50692L, MS[0]#50480L, MS[1]#50481L, MS[2]#50482L, MS[3]#50483L, MS[4]#50484L, MS[5]#50485L, MS[6]#50486L, MS[7]#50487L, MS[8]#50488L, MS[9]#50489L, MS[10]#50490L, MS[11]#50491L, MS[12]#50492L, MS[13]#50493L, MS[14]#50494L, MS[15]#50495L, MS[16]#50496L, MS[17]#50497L, MS[18]#50498L, MS[19]#50499L, MS[20]#50500L, MS[21]#50501L, MS[22]#50502L, MS[23]#50503L, MS[24]#50504L, MS[25]#50505L, MS[26]#50506L, MS[27]#50507L, MS[28]#50508L, MS[29]#50509L, MS[30]#50510L, MS[31]#50511L, MS[32]#50512L, MS[33]#50513L, MS[34]#50514L, MS[35]#50515L, MS[36]#50516L, MS[37]#50517L, MS[38]#50518L, MS[39]#50519L, MS[40]#50520L, MS[41]#50521L, MS[42]#50522L, MS[43]#50523L, MS[44]#50524L, MS[45]#50525L, MS[46]#50526L, MS[47]#50527L, MS[48]#50528L, MS[49]#50529L, MS[50]#50530L, MS[51]#50531L, sum#50693L, sum#50694, sum#50695, count#50696L]
Results [59]: [segment#50465, processing_day#50467, count#50697L, MS[0]#50532L, MS[1]#50533L, MS[2]#50534L, MS[3]#50535L, MS[4]#50536L, MS[5]#50537L, MS[6]#50538L, MS[7]#50539L, MS[8]#50540L, MS[9]#50541L, MS[10]#50542L, MS[11]#50543L, MS[12]#50544L, MS[13]#50545L, MS[14]#50546L, MS[15]#50547L, MS[16]#50548L, MS[17]#50549L, MS[18]#50550L, MS[19]#50551L, MS[20]#50552L, MS[21]#50553L, MS[22]#50554L, MS[23]#50555L, MS[24]#50556L, MS[25]#50557L, MS[26]#50558L, MS[27]#50559L, MS[28]#50560L, MS[29]#50561L, MS[30]#50562L, MS[31]#50563L, MS[32]#50564L, MS[33]#50565L, MS[34]#50566L, MS[35]#50567L, MS[36]#50568L, MS[37]#50569L, MS[38]#50570L, MS[39]#50571L, MS[40]#50572L, MS[41]#50573L, MS[42]#50574L, MS[43]#50575L, MS[44]#50576L, MS[45]#50577L, MS[46]#50578L, MS[47]#50579L, MS[48]#50580L, MS[49]#50581L, MS[50]#50582L, MS[51]#50583L, sum#50698L, sum#50699, sum#50700, count#50701L]
(5) Exchange
Input [59]: [segment#50465, processing_day#50467, count#50697L, MS[0]#50532L, MS[1]#50533L, MS[2]#50534L, MS[3]#50535L, MS[4]#50536L, MS[5]#50537L, MS[6]#50538L, MS[7]#50539L, MS[8]#50540L, MS[9]#50541L, MS[10]#50542L, MS[11]#50543L, MS[12]#50544L, MS[13]#50545L, MS[14]#50546L, MS[15]#50547L, MS[16]#50548L, MS[17]#50549L, MS[18]#50550L, MS[19]#50551L, MS[20]#50552L, MS[21]#50553L, MS[22]#50554L, MS[23]#50555L, MS[24]#50556L, MS[25]#50557L, MS[26]#50558L, MS[27]#50559L, MS[28]#50560L, MS[29]#50561L, MS[30]#50562L, MS[31]#50563L, MS[32]#50564L, MS[33]#50565L, MS[34]#50566L, MS[35]#50567L, MS[36]#50568L, MS[37]#50569L, MS[38]#50570L, MS[39]#50571L, MS[40]#50572L, MS[41]#50573L, MS[42]#50574L, MS[43]#50575L, MS[44]#50576L, MS[45]#50577L, MS[46]#50578L, MS[47]#50579L, MS[48]#50580L, MS[49]#50581L, MS[50]#50582L, MS[51]#50583L, sum#50698L, sum#50699, sum#50700, count#50701L]
Arguments: hashpartitioning(segment#50465, processing_day#50467, 200), ENSURE_REQUIREMENTS, [plan_id=4786]
(6) ShuffleQueryStage
Output [59]: [segment#50465, processing_day#50467, count#50697L, MS[0]#50532L, MS[1]#50533L, MS[2]#50534L, MS[3]#50535L, MS[4]#50536L, MS[5]#50537L, MS[6]#50538L, MS[7]#50539L, MS[8]#50540L, MS[9]#50541L, MS[10]#50542L, MS[11]#50543L, MS[12]#50544L, MS[13]#50545L, MS[14]#50546L, MS[15]#50547L, MS[16]#50548L, MS[17]#50549L, MS[18]#50550L, MS[19]#50551L, MS[20]#50552L, MS[21]#50553L, MS[22]#50554L, MS[23]#50555L, MS[24]#50556L, MS[25]#50557L, MS[26]#50558L, MS[27]#50559L, MS[28]#50560L, MS[29]#50561L, MS[30]#50562L, MS[31]#50563L, MS[32]#50564L, MS[33]#50565L, MS[34]#50566L, MS[35]#50567L, MS[36]#50568L, MS[37]#50569L, MS[38]#50570L, MS[39]#50571L, MS[40]#50572L, MS[41]#50573L, MS[42]#50574L, MS[43]#50575L, MS[44]#50576L, MS[45]#50577L, MS[46]#50578L, MS[47]#50579L, MS[48]#50580L, MS[49]#50581L, MS[50]#50582L, MS[51]#50583L, sum#50698L, sum#50699, sum#50700, count#50701L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#50465, processing_day#50467, count#50697L, MS[0]#50532L, MS[1]#50533L, MS[2]#50534L, MS[3]#50535L, MS[4]#50536L, MS[5]#50537L, MS[6]#50538L, MS[7]#50539L, MS[8]#50540L, MS[9]#50541L, MS[10]#50542L, MS[11]#50543L, MS[12]#50544L, MS[13]#50545L, MS[14]#50546L, MS[15]#50547L, MS[16]#50548L, MS[17]#50549L, MS[18]#50550L, MS[19]#50551L, MS[20]#50552L, MS[21]#50553L, MS[22]#50554L, MS[23]#50555L, MS[24]#50556L, MS[25]#50557L, MS[26]#50558L, MS[27]#50559L, MS[28]#50560L, MS[29]#50561L, MS[30]#50562L, MS[31]#50563L, MS[32]#50564L, MS[33]#50565L, MS[34]#50566L, MS[35]#50567L, MS[36]#50568L, MS[37]#50569L, MS[38]#50570L, MS[39]#50571L, MS[40]#50572L, MS[41]#50573L, MS[42]#50574L, MS[43]#50575L, MS[44]#50576L, MS[45]#50577L, MS[46]#50578L, MS[47]#50579L, MS[48]#50580L, MS[49]#50581L, MS[50]#50582L, MS[51]#50583L, sum#50698L, sum#50699, sum#50700, count#50701L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#50465, processing_day#50467, count#50697L, MS[0]#50532L, MS[1]#50533L, MS[2]#50534L, MS[3]#50535L, MS[4]#50536L, MS[5]#50537L, MS[6]#50538L, MS[7]#50539L, MS[8]#50540L, MS[9]#50541L, MS[10]#50542L, MS[11]#50543L, MS[12]#50544L, MS[13]#50545L, MS[14]#50546L, MS[15]#50547L, MS[16]#50548L, MS[17]#50549L, MS[18]#50550L, MS[19]#50551L, MS[20]#50552L, MS[21]#50553L, MS[22]#50554L, MS[23]#50555L, MS[24]#50556L, MS[25]#50557L, MS[26]#50558L, MS[27]#50559L, MS[28]#50560L, MS[29]#50561L, MS[30]#50562L, MS[31]#50563L, MS[32]#50564L, MS[33]#50565L, MS[34]#50566L, MS[35]#50567L, MS[36]#50568L, MS[37]#50569L, MS[38]#50570L, MS[39]#50571L, MS[40]#50572L, MS[41]#50573L, MS[42]#50574L, MS[43]#50575L, MS[44]#50576L, MS[45]#50577L, MS[46]#50578L, MS[47]#50579L, MS[48]#50580L, MS[49]#50581L, MS[50]#50582L, MS[51]#50583L, sum#50698L, sum#50699, sum#50700, count#50701L]
Keys [2]: [segment#50465, processing_day#50467]
Functions [5]: [count(1), approx_count_distinct(customer_id#50461L, 0.05, 0, 0), sum(events#50471), sum(weighted_amount#50473), avg(amount#50469)]
Aggregate Attributes [5]: [count(1)#50479L, approx_count_distinct(customer_id#50461L, 0.05, 0, 0)#50584L, sum(events#50471)#50585L, sum(weighted_amount#50473)#50586, avg(amount#50469)#50587]
Results [7]: [segment#50465, processing_day#50467, count(1)#50479L AS row_count#50474L, approx_count_distinct(customer_id#50461L, 0.05, 0, 0)#50584L AS unique_customers#50475L, sum(events#50471)#50585L AS event_sum#50476L, sum(weighted_amount#50473)#50586 AS weighted_amount_sum#50477, avg(amount#50469)#50587 AS avg_amount#50478]
(9) Exchange
Input [7]: [segment#50465, processing_day#50467, row_count#50474L, unique_customers#50475L, event_sum#50476L, weighted_amount_sum#50477, avg_amount#50478]
Arguments: rangepartitioning(segment#50465 ASC NULLS FIRST, processing_day#50467 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4808]
(10) ShuffleQueryStage
Output [7]: [segment#50465, processing_day#50467, row_count#50474L, unique_customers#50475L, event_sum#50476L, weighted_amount_sum#50477, avg_amount#50478]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#50465, processing_day#50467, row_count#50474L, unique_customers#50475L, event_sum#50476L, weighted_amount_sum#50477, avg_amount#50478]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#50465, processing_day#50467, row_count#50474L, unique_customers#50475L, event_sum#50476L, weighted_amount_sum#50477, avg_amount#50478]
Arguments: [segment#50465 ASC NULLS FIRST, processing_day#50467 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#50465, processing_day#50467, row_count#50474L, unique_customers#50475L, event_sum#50476L, weighted_amount_sum#50477, avg_amount#50478]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#50461L, segment#50465, processing_day#50467, amount#50469, events#50471, weighted_amount#50473]
Keys [2]: [segment#50465, processing_day#50467]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#50461L, 0.05, 0, 0), partial_sum(events#50471), partial_sum(weighted_amount#50473), partial_avg(amount#50469)]
Aggregate Attributes [57]: [count#50692L, MS[0]#50480L, MS[1]#50481L, MS[2]#50482L, MS[3]#50483L, MS[4]#50484L, MS[5]#50485L, MS[6]#50486L, MS[7]#50487L, MS[8]#50488L, MS[9]#50489L, MS[10]#50490L, MS[11]#50491L, MS[12]#50492L, MS[13]#50493L, MS[14]#50494L, MS[15]#50495L, MS[16]#50496L, MS[17]#50497L, MS[18]#50498L, MS[19]#50499L, MS[20]#50500L, MS[21]#50501L, MS[22]#50502L, MS[23]#50503L, MS[24]#50504L, MS[25]#50505L, MS[26]#50506L, MS[27]#50507L, MS[28]#50508L, MS[29]#50509L, MS[30]#50510L, MS[31]#50511L, MS[32]#50512L, MS[33]#50513L, MS[34]#50514L, MS[35]#50515L, MS[36]#50516L, MS[37]#50517L, MS[38]#50518L, MS[39]#50519L, MS[40]#50520L, MS[41]#50521L, MS[42]#50522L, MS[43]#50523L, MS[44]#50524L, MS[45]#50525L, MS[46]#50526L, MS[47]#50527L, MS[48]#50528L, MS[49]#50529L, MS[50]#50530L, MS[51]#50531L, sum#50693L, sum#50694, sum#50695, count#50696L]
Results [59]: [segment#50465, processing_day#50467, count#50697L, MS[0]#50532L, MS[1]#50533L, MS[2]#50534L, MS[3]#50535L, MS[4]#50536L, MS[5]#50537L, MS[6]#50538L, MS[7]#50539L, MS[8]#50540L, MS[9]#50541L, MS[10]#50542L, MS[11]#50543L, MS[12]#50544L, MS[13]#50545L, MS[14]#50546L, MS[15]#50547L, MS[16]#50548L, MS[17]#50549L, MS[18]#50550L, MS[19]#50551L, MS[20]#50552L, MS[21]#50553L, MS[22]#50554L, MS[23]#50555L, MS[24]#50556L, MS[25]#50557L, MS[26]#50558L, MS[27]#50559L, MS[28]#50560L, MS[29]#50561L, MS[30]#50562L, MS[31]#50563L, MS[32]#50564L, MS[33]#50565L, MS[34]#50566L, MS[35]#50567L, MS[36]#50568L, MS[37]#50569L, MS[38]#50570L, MS[39]#50571L, MS[40]#50572L, MS[41]#50573L, MS[42]#50574L, MS[43]#50575L, MS[44]#50576L, MS[45]#50577L, MS[46]#50578L, MS[47]#50579L, MS[48]#50580L, MS[49]#50581L, MS[50]#50582L, MS[51]#50583L, sum#50698L, sum#50699, sum#50700, count#50701L]
(15) Exchange
Input [59]: [segment#50465, processing_day#50467, count#50697L, MS[0]#50532L, MS[1]#50533L, MS[2]#50534L, MS[3]#50535L, MS[4]#50536L, MS[5]#50537L, MS[6]#50538L, MS[7]#50539L, MS[8]#50540L, MS[9]#50541L, MS[10]#50542L, MS[11]#50543L, MS[12]#50544L, MS[13]#50545L, MS[14]#50546L, MS[15]#50547L, MS[16]#50548L, MS[17]#50549L, MS[18]#50550L, MS[19]#50551L, MS[20]#50552L, MS[21]#50553L, MS[22]#50554L, MS[23]#50555L, MS[24]#50556L, MS[25]#50557L, MS[26]#50558L, MS[27]#50559L, MS[28]#50560L, MS[29]#50561L, MS[30]#50562L, MS[31]#50563L, MS[32]#50564L, MS[33]#50565L, MS[34]#50566L, MS[35]#50567L, MS[36]#50568L, MS[37]#50569L, MS[38]#50570L, MS[39]#50571L, MS[40]#50572L, MS[41]#50573L, MS[42]#50574L, MS[43]#50575L, MS[44]#50576L, MS[45]#50577L, MS[46]#50578L, MS[47]#50579L, MS[48]#50580L, MS[49]#50581L, MS[50]#50582L, MS[51]#50583L, sum#50698L, sum#50699, sum#50700, count#50701L]
Arguments: hashpartitioning(segment#50465, processing_day#50467, 200), ENSURE_REQUIREMENTS, [plan_id=4766]
(16) HashAggregate
Input [59]: [segment#50465, processing_day#50467, count#50697L, MS[0]#50532L, MS[1]#50533L, MS[2]#50534L, MS[3]#50535L, MS[4]#50536L, MS[5]#50537L, MS[6]#50538L, MS[7]#50539L, MS[8]#50540L, MS[9]#50541L, MS[10]#50542L, MS[11]#50543L, MS[12]#50544L, MS[13]#50545L, MS[14]#50546L, MS[15]#50547L, MS[16]#50548L, MS[17]#50549L, MS[18]#50550L, MS[19]#50551L, MS[20]#50552L, MS[21]#50553L, MS[22]#50554L, MS[23]#50555L, MS[24]#50556L, MS[25]#50557L, MS[26]#50558L, MS[27]#50559L, MS[28]#50560L, MS[29]#50561L, MS[30]#50562L, MS[31]#50563L, MS[32]#50564L, MS[33]#50565L, MS[34]#50566L, MS[35]#50567L, MS[36]#50568L, MS[37]#50569L, MS[38]#50570L, MS[39]#50571L, MS[40]#50572L, MS[41]#50573L, MS[42]#50574L, MS[43]#50575L, MS[44]#50576L, MS[45]#50577L, MS[46]#50578L, MS[47]#50579L, MS[48]#50580L, MS[49]#50581L, MS[50]#50582L, MS[51]#50583L, sum#50698L, sum#50699, sum#50700, count#50701L]
Keys [2]: [segment#50465, processing_day#50467]
Functions [5]: [count(1), approx_count_distinct(customer_id#50461L, 0.05, 0, 0), sum(events#50471), sum(weighted_amount#50473), avg(amount#50469)]
Aggregate Attributes [5]: [count(1)#50479L, approx_count_distinct(customer_id#50461L, 0.05, 0, 0)#50584L, sum(events#50471)#50585L, sum(weighted_amount#50473)#50586, avg(amount#50469)#50587]
Results [7]: [segment#50465, processing_day#50467, count(1)#50479L AS row_count#50474L, approx_count_distinct(customer_id#50461L, 0.05, 0, 0)#50584L AS unique_customers#50475L, sum(events#50471)#50585L AS event_sum#50476L, sum(weighted_amount#50473)#50586 AS weighted_amount_sum#50477, avg(amount#50469)#50587 AS avg_amount#50478]
(17) Exchange
Input [7]: [segment#50465, processing_day#50467, row_count#50474L, unique_customers#50475L, event_sum#50476L, weighted_amount_sum#50477, avg_amount#50478]
Arguments: rangepartitioning(segment#50465 ASC NULLS FIRST, processing_day#50467 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4769]
(18) Sort
Input [7]: [segment#50465, processing_day#50467, row_count#50474L, unique_customers#50475L, event_sum#50476L, weighted_amount_sum#50477, avg_amount#50478]
Arguments: [segment#50465 ASC NULLS FIRST, processing_day#50467 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#50465, processing_day#50467, row_count#50474L, unique_customers#50475L, event_sum#50476L, weighted_amount_sum#50477, avg_amount#50478]
Arguments: isFinalPlan=true