== 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#89423L]
Arguments: Range (5000000, 6000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#89423L % 250000) AS customer_id#89425L, concat(segment-, cast(cast((id#89423L % 12) as int) as string)) AS segment#89429, cast((id#89423L % 14) as int) AS processing_day#89431, ((cast(((id#89423L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#89433, cast((((id#89423L * 29) % 7) + 1) as int) AS events#89435]
Input [1]: [id#89423L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#89425L, segment#89429, processing_day#89431, amount#89433, events#89435, (amount#89433 * cast(events#89435 as double)) AS weighted_amount#89437]
Input [5]: [customer_id#89425L, segment#89429, processing_day#89431, amount#89433, events#89435]
(4) HashAggregate
Input [6]: [customer_id#89425L, segment#89429, processing_day#89431, amount#89433, events#89435, weighted_amount#89437]
Keys [2]: [segment#89429, processing_day#89431]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#89425L, 0.05, 0, 0), partial_sum(events#89435), partial_sum(weighted_amount#89437), partial_avg(amount#89433)]
Aggregate Attributes [57]: [count#89656L, MS[0]#89444L, MS[1]#89445L, MS[2]#89446L, MS[3]#89447L, MS[4]#89448L, MS[5]#89449L, MS[6]#89450L, MS[7]#89451L, MS[8]#89452L, MS[9]#89453L, MS[10]#89454L, MS[11]#89455L, MS[12]#89456L, MS[13]#89457L, MS[14]#89458L, MS[15]#89459L, MS[16]#89460L, MS[17]#89461L, MS[18]#89462L, MS[19]#89463L, MS[20]#89464L, MS[21]#89465L, MS[22]#89466L, MS[23]#89467L, MS[24]#89468L, MS[25]#89469L, MS[26]#89470L, MS[27]#89471L, MS[28]#89472L, MS[29]#89473L, MS[30]#89474L, MS[31]#89475L, MS[32]#89476L, MS[33]#89477L, MS[34]#89478L, MS[35]#89479L, MS[36]#89480L, MS[37]#89481L, MS[38]#89482L, MS[39]#89483L, MS[40]#89484L, MS[41]#89485L, MS[42]#89486L, MS[43]#89487L, MS[44]#89488L, MS[45]#89489L, MS[46]#89490L, MS[47]#89491L, MS[48]#89492L, MS[49]#89493L, MS[50]#89494L, MS[51]#89495L, sum#89657L, sum#89658, sum#89659, count#89660L]
Results [59]: [segment#89429, processing_day#89431, count#89661L, MS[0]#89496L, MS[1]#89497L, MS[2]#89498L, MS[3]#89499L, MS[4]#89500L, MS[5]#89501L, MS[6]#89502L, MS[7]#89503L, MS[8]#89504L, MS[9]#89505L, MS[10]#89506L, MS[11]#89507L, MS[12]#89508L, MS[13]#89509L, MS[14]#89510L, MS[15]#89511L, MS[16]#89512L, MS[17]#89513L, MS[18]#89514L, MS[19]#89515L, MS[20]#89516L, MS[21]#89517L, MS[22]#89518L, MS[23]#89519L, MS[24]#89520L, MS[25]#89521L, MS[26]#89522L, MS[27]#89523L, MS[28]#89524L, MS[29]#89525L, MS[30]#89526L, MS[31]#89527L, MS[32]#89528L, MS[33]#89529L, MS[34]#89530L, MS[35]#89531L, MS[36]#89532L, MS[37]#89533L, MS[38]#89534L, MS[39]#89535L, MS[40]#89536L, MS[41]#89537L, MS[42]#89538L, MS[43]#89539L, MS[44]#89540L, MS[45]#89541L, MS[46]#89542L, MS[47]#89543L, MS[48]#89544L, MS[49]#89545L, MS[50]#89546L, MS[51]#89547L, sum#89662L, sum#89663, sum#89664, count#89665L]
(5) Exchange
Input [59]: [segment#89429, processing_day#89431, count#89661L, MS[0]#89496L, MS[1]#89497L, MS[2]#89498L, MS[3]#89499L, MS[4]#89500L, MS[5]#89501L, MS[6]#89502L, MS[7]#89503L, MS[8]#89504L, MS[9]#89505L, MS[10]#89506L, MS[11]#89507L, MS[12]#89508L, MS[13]#89509L, MS[14]#89510L, MS[15]#89511L, MS[16]#89512L, MS[17]#89513L, MS[18]#89514L, MS[19]#89515L, MS[20]#89516L, MS[21]#89517L, MS[22]#89518L, MS[23]#89519L, MS[24]#89520L, MS[25]#89521L, MS[26]#89522L, MS[27]#89523L, MS[28]#89524L, MS[29]#89525L, MS[30]#89526L, MS[31]#89527L, MS[32]#89528L, MS[33]#89529L, MS[34]#89530L, MS[35]#89531L, MS[36]#89532L, MS[37]#89533L, MS[38]#89534L, MS[39]#89535L, MS[40]#89536L, MS[41]#89537L, MS[42]#89538L, MS[43]#89539L, MS[44]#89540L, MS[45]#89541L, MS[46]#89542L, MS[47]#89543L, MS[48]#89544L, MS[49]#89545L, MS[50]#89546L, MS[51]#89547L, sum#89662L, sum#89663, sum#89664, count#89665L]
Arguments: hashpartitioning(segment#89429, processing_day#89431, 200), ENSURE_REQUIREMENTS, [plan_id=8450]
(6) ShuffleQueryStage
Output [59]: [segment#89429, processing_day#89431, count#89661L, MS[0]#89496L, MS[1]#89497L, MS[2]#89498L, MS[3]#89499L, MS[4]#89500L, MS[5]#89501L, MS[6]#89502L, MS[7]#89503L, MS[8]#89504L, MS[9]#89505L, MS[10]#89506L, MS[11]#89507L, MS[12]#89508L, MS[13]#89509L, MS[14]#89510L, MS[15]#89511L, MS[16]#89512L, MS[17]#89513L, MS[18]#89514L, MS[19]#89515L, MS[20]#89516L, MS[21]#89517L, MS[22]#89518L, MS[23]#89519L, MS[24]#89520L, MS[25]#89521L, MS[26]#89522L, MS[27]#89523L, MS[28]#89524L, MS[29]#89525L, MS[30]#89526L, MS[31]#89527L, MS[32]#89528L, MS[33]#89529L, MS[34]#89530L, MS[35]#89531L, MS[36]#89532L, MS[37]#89533L, MS[38]#89534L, MS[39]#89535L, MS[40]#89536L, MS[41]#89537L, MS[42]#89538L, MS[43]#89539L, MS[44]#89540L, MS[45]#89541L, MS[46]#89542L, MS[47]#89543L, MS[48]#89544L, MS[49]#89545L, MS[50]#89546L, MS[51]#89547L, sum#89662L, sum#89663, sum#89664, count#89665L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#89429, processing_day#89431, count#89661L, MS[0]#89496L, MS[1]#89497L, MS[2]#89498L, MS[3]#89499L, MS[4]#89500L, MS[5]#89501L, MS[6]#89502L, MS[7]#89503L, MS[8]#89504L, MS[9]#89505L, MS[10]#89506L, MS[11]#89507L, MS[12]#89508L, MS[13]#89509L, MS[14]#89510L, MS[15]#89511L, MS[16]#89512L, MS[17]#89513L, MS[18]#89514L, MS[19]#89515L, MS[20]#89516L, MS[21]#89517L, MS[22]#89518L, MS[23]#89519L, MS[24]#89520L, MS[25]#89521L, MS[26]#89522L, MS[27]#89523L, MS[28]#89524L, MS[29]#89525L, MS[30]#89526L, MS[31]#89527L, MS[32]#89528L, MS[33]#89529L, MS[34]#89530L, MS[35]#89531L, MS[36]#89532L, MS[37]#89533L, MS[38]#89534L, MS[39]#89535L, MS[40]#89536L, MS[41]#89537L, MS[42]#89538L, MS[43]#89539L, MS[44]#89540L, MS[45]#89541L, MS[46]#89542L, MS[47]#89543L, MS[48]#89544L, MS[49]#89545L, MS[50]#89546L, MS[51]#89547L, sum#89662L, sum#89663, sum#89664, count#89665L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#89429, processing_day#89431, count#89661L, MS[0]#89496L, MS[1]#89497L, MS[2]#89498L, MS[3]#89499L, MS[4]#89500L, MS[5]#89501L, MS[6]#89502L, MS[7]#89503L, MS[8]#89504L, MS[9]#89505L, MS[10]#89506L, MS[11]#89507L, MS[12]#89508L, MS[13]#89509L, MS[14]#89510L, MS[15]#89511L, MS[16]#89512L, MS[17]#89513L, MS[18]#89514L, MS[19]#89515L, MS[20]#89516L, MS[21]#89517L, MS[22]#89518L, MS[23]#89519L, MS[24]#89520L, MS[25]#89521L, MS[26]#89522L, MS[27]#89523L, MS[28]#89524L, MS[29]#89525L, MS[30]#89526L, MS[31]#89527L, MS[32]#89528L, MS[33]#89529L, MS[34]#89530L, MS[35]#89531L, MS[36]#89532L, MS[37]#89533L, MS[38]#89534L, MS[39]#89535L, MS[40]#89536L, MS[41]#89537L, MS[42]#89538L, MS[43]#89539L, MS[44]#89540L, MS[45]#89541L, MS[46]#89542L, MS[47]#89543L, MS[48]#89544L, MS[49]#89545L, MS[50]#89546L, MS[51]#89547L, sum#89662L, sum#89663, sum#89664, count#89665L]
Keys [2]: [segment#89429, processing_day#89431]
Functions [5]: [count(1), approx_count_distinct(customer_id#89425L, 0.05, 0, 0), sum(events#89435), sum(weighted_amount#89437), avg(amount#89433)]
Aggregate Attributes [5]: [count(1)#89443L, approx_count_distinct(customer_id#89425L, 0.05, 0, 0)#89548L, sum(events#89435)#89549L, sum(weighted_amount#89437)#89550, avg(amount#89433)#89551]
Results [7]: [segment#89429, processing_day#89431, count(1)#89443L AS row_count#89438L, approx_count_distinct(customer_id#89425L, 0.05, 0, 0)#89548L AS unique_customers#89439L, sum(events#89435)#89549L AS event_sum#89440L, sum(weighted_amount#89437)#89550 AS weighted_amount_sum#89441, avg(amount#89433)#89551 AS avg_amount#89442]
(9) Exchange
Input [7]: [segment#89429, processing_day#89431, row_count#89438L, unique_customers#89439L, event_sum#89440L, weighted_amount_sum#89441, avg_amount#89442]
Arguments: rangepartitioning(segment#89429 ASC NULLS FIRST, processing_day#89431 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8472]
(10) ShuffleQueryStage
Output [7]: [segment#89429, processing_day#89431, row_count#89438L, unique_customers#89439L, event_sum#89440L, weighted_amount_sum#89441, avg_amount#89442]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#89429, processing_day#89431, row_count#89438L, unique_customers#89439L, event_sum#89440L, weighted_amount_sum#89441, avg_amount#89442]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#89429, processing_day#89431, row_count#89438L, unique_customers#89439L, event_sum#89440L, weighted_amount_sum#89441, avg_amount#89442]
Arguments: [segment#89429 ASC NULLS FIRST, processing_day#89431 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#89429, processing_day#89431, row_count#89438L, unique_customers#89439L, event_sum#89440L, weighted_amount_sum#89441, avg_amount#89442]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#89425L, segment#89429, processing_day#89431, amount#89433, events#89435, weighted_amount#89437]
Keys [2]: [segment#89429, processing_day#89431]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#89425L, 0.05, 0, 0), partial_sum(events#89435), partial_sum(weighted_amount#89437), partial_avg(amount#89433)]
Aggregate Attributes [57]: [count#89656L, MS[0]#89444L, MS[1]#89445L, MS[2]#89446L, MS[3]#89447L, MS[4]#89448L, MS[5]#89449L, MS[6]#89450L, MS[7]#89451L, MS[8]#89452L, MS[9]#89453L, MS[10]#89454L, MS[11]#89455L, MS[12]#89456L, MS[13]#89457L, MS[14]#89458L, MS[15]#89459L, MS[16]#89460L, MS[17]#89461L, MS[18]#89462L, MS[19]#89463L, MS[20]#89464L, MS[21]#89465L, MS[22]#89466L, MS[23]#89467L, MS[24]#89468L, MS[25]#89469L, MS[26]#89470L, MS[27]#89471L, MS[28]#89472L, MS[29]#89473L, MS[30]#89474L, MS[31]#89475L, MS[32]#89476L, MS[33]#89477L, MS[34]#89478L, MS[35]#89479L, MS[36]#89480L, MS[37]#89481L, MS[38]#89482L, MS[39]#89483L, MS[40]#89484L, MS[41]#89485L, MS[42]#89486L, MS[43]#89487L, MS[44]#89488L, MS[45]#89489L, MS[46]#89490L, MS[47]#89491L, MS[48]#89492L, MS[49]#89493L, MS[50]#89494L, MS[51]#89495L, sum#89657L, sum#89658, sum#89659, count#89660L]
Results [59]: [segment#89429, processing_day#89431, count#89661L, MS[0]#89496L, MS[1]#89497L, MS[2]#89498L, MS[3]#89499L, MS[4]#89500L, MS[5]#89501L, MS[6]#89502L, MS[7]#89503L, MS[8]#89504L, MS[9]#89505L, MS[10]#89506L, MS[11]#89507L, MS[12]#89508L, MS[13]#89509L, MS[14]#89510L, MS[15]#89511L, MS[16]#89512L, MS[17]#89513L, MS[18]#89514L, MS[19]#89515L, MS[20]#89516L, MS[21]#89517L, MS[22]#89518L, MS[23]#89519L, MS[24]#89520L, MS[25]#89521L, MS[26]#89522L, MS[27]#89523L, MS[28]#89524L, MS[29]#89525L, MS[30]#89526L, MS[31]#89527L, MS[32]#89528L, MS[33]#89529L, MS[34]#89530L, MS[35]#89531L, MS[36]#89532L, MS[37]#89533L, MS[38]#89534L, MS[39]#89535L, MS[40]#89536L, MS[41]#89537L, MS[42]#89538L, MS[43]#89539L, MS[44]#89540L, MS[45]#89541L, MS[46]#89542L, MS[47]#89543L, MS[48]#89544L, MS[49]#89545L, MS[50]#89546L, MS[51]#89547L, sum#89662L, sum#89663, sum#89664, count#89665L]
(15) Exchange
Input [59]: [segment#89429, processing_day#89431, count#89661L, MS[0]#89496L, MS[1]#89497L, MS[2]#89498L, MS[3]#89499L, MS[4]#89500L, MS[5]#89501L, MS[6]#89502L, MS[7]#89503L, MS[8]#89504L, MS[9]#89505L, MS[10]#89506L, MS[11]#89507L, MS[12]#89508L, MS[13]#89509L, MS[14]#89510L, MS[15]#89511L, MS[16]#89512L, MS[17]#89513L, MS[18]#89514L, MS[19]#89515L, MS[20]#89516L, MS[21]#89517L, MS[22]#89518L, MS[23]#89519L, MS[24]#89520L, MS[25]#89521L, MS[26]#89522L, MS[27]#89523L, MS[28]#89524L, MS[29]#89525L, MS[30]#89526L, MS[31]#89527L, MS[32]#89528L, MS[33]#89529L, MS[34]#89530L, MS[35]#89531L, MS[36]#89532L, MS[37]#89533L, MS[38]#89534L, MS[39]#89535L, MS[40]#89536L, MS[41]#89537L, MS[42]#89538L, MS[43]#89539L, MS[44]#89540L, MS[45]#89541L, MS[46]#89542L, MS[47]#89543L, MS[48]#89544L, MS[49]#89545L, MS[50]#89546L, MS[51]#89547L, sum#89662L, sum#89663, sum#89664, count#89665L]
Arguments: hashpartitioning(segment#89429, processing_day#89431, 200), ENSURE_REQUIREMENTS, [plan_id=8430]
(16) HashAggregate
Input [59]: [segment#89429, processing_day#89431, count#89661L, MS[0]#89496L, MS[1]#89497L, MS[2]#89498L, MS[3]#89499L, MS[4]#89500L, MS[5]#89501L, MS[6]#89502L, MS[7]#89503L, MS[8]#89504L, MS[9]#89505L, MS[10]#89506L, MS[11]#89507L, MS[12]#89508L, MS[13]#89509L, MS[14]#89510L, MS[15]#89511L, MS[16]#89512L, MS[17]#89513L, MS[18]#89514L, MS[19]#89515L, MS[20]#89516L, MS[21]#89517L, MS[22]#89518L, MS[23]#89519L, MS[24]#89520L, MS[25]#89521L, MS[26]#89522L, MS[27]#89523L, MS[28]#89524L, MS[29]#89525L, MS[30]#89526L, MS[31]#89527L, MS[32]#89528L, MS[33]#89529L, MS[34]#89530L, MS[35]#89531L, MS[36]#89532L, MS[37]#89533L, MS[38]#89534L, MS[39]#89535L, MS[40]#89536L, MS[41]#89537L, MS[42]#89538L, MS[43]#89539L, MS[44]#89540L, MS[45]#89541L, MS[46]#89542L, MS[47]#89543L, MS[48]#89544L, MS[49]#89545L, MS[50]#89546L, MS[51]#89547L, sum#89662L, sum#89663, sum#89664, count#89665L]
Keys [2]: [segment#89429, processing_day#89431]
Functions [5]: [count(1), approx_count_distinct(customer_id#89425L, 0.05, 0, 0), sum(events#89435), sum(weighted_amount#89437), avg(amount#89433)]
Aggregate Attributes [5]: [count(1)#89443L, approx_count_distinct(customer_id#89425L, 0.05, 0, 0)#89548L, sum(events#89435)#89549L, sum(weighted_amount#89437)#89550, avg(amount#89433)#89551]
Results [7]: [segment#89429, processing_day#89431, count(1)#89443L AS row_count#89438L, approx_count_distinct(customer_id#89425L, 0.05, 0, 0)#89548L AS unique_customers#89439L, sum(events#89435)#89549L AS event_sum#89440L, sum(weighted_amount#89437)#89550 AS weighted_amount_sum#89441, avg(amount#89433)#89551 AS avg_amount#89442]
(17) Exchange
Input [7]: [segment#89429, processing_day#89431, row_count#89438L, unique_customers#89439L, event_sum#89440L, weighted_amount_sum#89441, avg_amount#89442]
Arguments: rangepartitioning(segment#89429 ASC NULLS FIRST, processing_day#89431 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8433]
(18) Sort
Input [7]: [segment#89429, processing_day#89431, row_count#89438L, unique_customers#89439L, event_sum#89440L, weighted_amount_sum#89441, avg_amount#89442]
Arguments: [segment#89429 ASC NULLS FIRST, processing_day#89431 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#89429, processing_day#89431, row_count#89438L, unique_customers#89439L, event_sum#89440L, weighted_amount_sum#89441, avg_amount#89442]
Arguments: isFinalPlan=true