== 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#66405L]
Arguments: Range (3000000, 4000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#66405L % 250000) AS customer_id#66407L, concat(segment-, cast(cast((id#66405L % 12) as int) as string)) AS segment#66411, cast((id#66405L % 14) as int) AS processing_day#66413, ((cast(((id#66405L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#66415, cast((((id#66405L * 29) % 7) + 1) as int) AS events#66417]
Input [1]: [id#66405L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#66407L, segment#66411, processing_day#66413, amount#66415, events#66417, (amount#66415 * cast(events#66417 as double)) AS weighted_amount#66419]
Input [5]: [customer_id#66407L, segment#66411, processing_day#66413, amount#66415, events#66417]
(4) HashAggregate
Input [6]: [customer_id#66407L, segment#66411, processing_day#66413, amount#66415, events#66417, weighted_amount#66419]
Keys [2]: [segment#66411, processing_day#66413]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#66407L, 0.05, 0, 0), partial_sum(events#66417), partial_sum(weighted_amount#66419), partial_avg(amount#66415)]
Aggregate Attributes [57]: [count#66638L, MS[0]#66426L, MS[1]#66427L, MS[2]#66428L, MS[3]#66429L, MS[4]#66430L, MS[5]#66431L, MS[6]#66432L, MS[7]#66433L, MS[8]#66434L, MS[9]#66435L, MS[10]#66436L, MS[11]#66437L, MS[12]#66438L, MS[13]#66439L, MS[14]#66440L, MS[15]#66441L, MS[16]#66442L, MS[17]#66443L, MS[18]#66444L, MS[19]#66445L, MS[20]#66446L, MS[21]#66447L, MS[22]#66448L, MS[23]#66449L, MS[24]#66450L, MS[25]#66451L, MS[26]#66452L, MS[27]#66453L, MS[28]#66454L, MS[29]#66455L, MS[30]#66456L, MS[31]#66457L, MS[32]#66458L, MS[33]#66459L, MS[34]#66460L, MS[35]#66461L, MS[36]#66462L, MS[37]#66463L, MS[38]#66464L, MS[39]#66465L, MS[40]#66466L, MS[41]#66467L, MS[42]#66468L, MS[43]#66469L, MS[44]#66470L, MS[45]#66471L, MS[46]#66472L, MS[47]#66473L, MS[48]#66474L, MS[49]#66475L, MS[50]#66476L, MS[51]#66477L, sum#66639L, sum#66640, sum#66641, count#66642L]
Results [59]: [segment#66411, processing_day#66413, count#66643L, MS[0]#66478L, MS[1]#66479L, MS[2]#66480L, MS[3]#66481L, MS[4]#66482L, MS[5]#66483L, MS[6]#66484L, MS[7]#66485L, MS[8]#66486L, MS[9]#66487L, MS[10]#66488L, MS[11]#66489L, MS[12]#66490L, MS[13]#66491L, MS[14]#66492L, MS[15]#66493L, MS[16]#66494L, MS[17]#66495L, MS[18]#66496L, MS[19]#66497L, MS[20]#66498L, MS[21]#66499L, MS[22]#66500L, MS[23]#66501L, MS[24]#66502L, MS[25]#66503L, MS[26]#66504L, MS[27]#66505L, MS[28]#66506L, MS[29]#66507L, MS[30]#66508L, MS[31]#66509L, MS[32]#66510L, MS[33]#66511L, MS[34]#66512L, MS[35]#66513L, MS[36]#66514L, MS[37]#66515L, MS[38]#66516L, MS[39]#66517L, MS[40]#66518L, MS[41]#66519L, MS[42]#66520L, MS[43]#66521L, MS[44]#66522L, MS[45]#66523L, MS[46]#66524L, MS[47]#66525L, MS[48]#66526L, MS[49]#66527L, MS[50]#66528L, MS[51]#66529L, sum#66644L, sum#66645, sum#66646, count#66647L]
(5) Exchange
Input [59]: [segment#66411, processing_day#66413, count#66643L, MS[0]#66478L, MS[1]#66479L, MS[2]#66480L, MS[3]#66481L, MS[4]#66482L, MS[5]#66483L, MS[6]#66484L, MS[7]#66485L, MS[8]#66486L, MS[9]#66487L, MS[10]#66488L, MS[11]#66489L, MS[12]#66490L, MS[13]#66491L, MS[14]#66492L, MS[15]#66493L, MS[16]#66494L, MS[17]#66495L, MS[18]#66496L, MS[19]#66497L, MS[20]#66498L, MS[21]#66499L, MS[22]#66500L, MS[23]#66501L, MS[24]#66502L, MS[25]#66503L, MS[26]#66504L, MS[27]#66505L, MS[28]#66506L, MS[29]#66507L, MS[30]#66508L, MS[31]#66509L, MS[32]#66510L, MS[33]#66511L, MS[34]#66512L, MS[35]#66513L, MS[36]#66514L, MS[37]#66515L, MS[38]#66516L, MS[39]#66517L, MS[40]#66518L, MS[41]#66519L, MS[42]#66520L, MS[43]#66521L, MS[44]#66522L, MS[45]#66523L, MS[46]#66524L, MS[47]#66525L, MS[48]#66526L, MS[49]#66527L, MS[50]#66528L, MS[51]#66529L, sum#66644L, sum#66645, sum#66646, count#66647L]
Arguments: hashpartitioning(segment#66411, processing_day#66413, 200), ENSURE_REQUIREMENTS, [plan_id=6286]
(6) ShuffleQueryStage
Output [59]: [segment#66411, processing_day#66413, count#66643L, MS[0]#66478L, MS[1]#66479L, MS[2]#66480L, MS[3]#66481L, MS[4]#66482L, MS[5]#66483L, MS[6]#66484L, MS[7]#66485L, MS[8]#66486L, MS[9]#66487L, MS[10]#66488L, MS[11]#66489L, MS[12]#66490L, MS[13]#66491L, MS[14]#66492L, MS[15]#66493L, MS[16]#66494L, MS[17]#66495L, MS[18]#66496L, MS[19]#66497L, MS[20]#66498L, MS[21]#66499L, MS[22]#66500L, MS[23]#66501L, MS[24]#66502L, MS[25]#66503L, MS[26]#66504L, MS[27]#66505L, MS[28]#66506L, MS[29]#66507L, MS[30]#66508L, MS[31]#66509L, MS[32]#66510L, MS[33]#66511L, MS[34]#66512L, MS[35]#66513L, MS[36]#66514L, MS[37]#66515L, MS[38]#66516L, MS[39]#66517L, MS[40]#66518L, MS[41]#66519L, MS[42]#66520L, MS[43]#66521L, MS[44]#66522L, MS[45]#66523L, MS[46]#66524L, MS[47]#66525L, MS[48]#66526L, MS[49]#66527L, MS[50]#66528L, MS[51]#66529L, sum#66644L, sum#66645, sum#66646, count#66647L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#66411, processing_day#66413, count#66643L, MS[0]#66478L, MS[1]#66479L, MS[2]#66480L, MS[3]#66481L, MS[4]#66482L, MS[5]#66483L, MS[6]#66484L, MS[7]#66485L, MS[8]#66486L, MS[9]#66487L, MS[10]#66488L, MS[11]#66489L, MS[12]#66490L, MS[13]#66491L, MS[14]#66492L, MS[15]#66493L, MS[16]#66494L, MS[17]#66495L, MS[18]#66496L, MS[19]#66497L, MS[20]#66498L, MS[21]#66499L, MS[22]#66500L, MS[23]#66501L, MS[24]#66502L, MS[25]#66503L, MS[26]#66504L, MS[27]#66505L, MS[28]#66506L, MS[29]#66507L, MS[30]#66508L, MS[31]#66509L, MS[32]#66510L, MS[33]#66511L, MS[34]#66512L, MS[35]#66513L, MS[36]#66514L, MS[37]#66515L, MS[38]#66516L, MS[39]#66517L, MS[40]#66518L, MS[41]#66519L, MS[42]#66520L, MS[43]#66521L, MS[44]#66522L, MS[45]#66523L, MS[46]#66524L, MS[47]#66525L, MS[48]#66526L, MS[49]#66527L, MS[50]#66528L, MS[51]#66529L, sum#66644L, sum#66645, sum#66646, count#66647L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#66411, processing_day#66413, count#66643L, MS[0]#66478L, MS[1]#66479L, MS[2]#66480L, MS[3]#66481L, MS[4]#66482L, MS[5]#66483L, MS[6]#66484L, MS[7]#66485L, MS[8]#66486L, MS[9]#66487L, MS[10]#66488L, MS[11]#66489L, MS[12]#66490L, MS[13]#66491L, MS[14]#66492L, MS[15]#66493L, MS[16]#66494L, MS[17]#66495L, MS[18]#66496L, MS[19]#66497L, MS[20]#66498L, MS[21]#66499L, MS[22]#66500L, MS[23]#66501L, MS[24]#66502L, MS[25]#66503L, MS[26]#66504L, MS[27]#66505L, MS[28]#66506L, MS[29]#66507L, MS[30]#66508L, MS[31]#66509L, MS[32]#66510L, MS[33]#66511L, MS[34]#66512L, MS[35]#66513L, MS[36]#66514L, MS[37]#66515L, MS[38]#66516L, MS[39]#66517L, MS[40]#66518L, MS[41]#66519L, MS[42]#66520L, MS[43]#66521L, MS[44]#66522L, MS[45]#66523L, MS[46]#66524L, MS[47]#66525L, MS[48]#66526L, MS[49]#66527L, MS[50]#66528L, MS[51]#66529L, sum#66644L, sum#66645, sum#66646, count#66647L]
Keys [2]: [segment#66411, processing_day#66413]
Functions [5]: [count(1), approx_count_distinct(customer_id#66407L, 0.05, 0, 0), sum(events#66417), sum(weighted_amount#66419), avg(amount#66415)]
Aggregate Attributes [5]: [count(1)#66425L, approx_count_distinct(customer_id#66407L, 0.05, 0, 0)#66530L, sum(events#66417)#66531L, sum(weighted_amount#66419)#66532, avg(amount#66415)#66533]
Results [7]: [segment#66411, processing_day#66413, count(1)#66425L AS row_count#66420L, approx_count_distinct(customer_id#66407L, 0.05, 0, 0)#66530L AS unique_customers#66421L, sum(events#66417)#66531L AS event_sum#66422L, sum(weighted_amount#66419)#66532 AS weighted_amount_sum#66423, avg(amount#66415)#66533 AS avg_amount#66424]
(9) Exchange
Input [7]: [segment#66411, processing_day#66413, row_count#66420L, unique_customers#66421L, event_sum#66422L, weighted_amount_sum#66423, avg_amount#66424]
Arguments: rangepartitioning(segment#66411 ASC NULLS FIRST, processing_day#66413 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=6308]
(10) ShuffleQueryStage
Output [7]: [segment#66411, processing_day#66413, row_count#66420L, unique_customers#66421L, event_sum#66422L, weighted_amount_sum#66423, avg_amount#66424]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#66411, processing_day#66413, row_count#66420L, unique_customers#66421L, event_sum#66422L, weighted_amount_sum#66423, avg_amount#66424]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#66411, processing_day#66413, row_count#66420L, unique_customers#66421L, event_sum#66422L, weighted_amount_sum#66423, avg_amount#66424]
Arguments: [segment#66411 ASC NULLS FIRST, processing_day#66413 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#66411, processing_day#66413, row_count#66420L, unique_customers#66421L, event_sum#66422L, weighted_amount_sum#66423, avg_amount#66424]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#66407L, segment#66411, processing_day#66413, amount#66415, events#66417, weighted_amount#66419]
Keys [2]: [segment#66411, processing_day#66413]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#66407L, 0.05, 0, 0), partial_sum(events#66417), partial_sum(weighted_amount#66419), partial_avg(amount#66415)]
Aggregate Attributes [57]: [count#66638L, MS[0]#66426L, MS[1]#66427L, MS[2]#66428L, MS[3]#66429L, MS[4]#66430L, MS[5]#66431L, MS[6]#66432L, MS[7]#66433L, MS[8]#66434L, MS[9]#66435L, MS[10]#66436L, MS[11]#66437L, MS[12]#66438L, MS[13]#66439L, MS[14]#66440L, MS[15]#66441L, MS[16]#66442L, MS[17]#66443L, MS[18]#66444L, MS[19]#66445L, MS[20]#66446L, MS[21]#66447L, MS[22]#66448L, MS[23]#66449L, MS[24]#66450L, MS[25]#66451L, MS[26]#66452L, MS[27]#66453L, MS[28]#66454L, MS[29]#66455L, MS[30]#66456L, MS[31]#66457L, MS[32]#66458L, MS[33]#66459L, MS[34]#66460L, MS[35]#66461L, MS[36]#66462L, MS[37]#66463L, MS[38]#66464L, MS[39]#66465L, MS[40]#66466L, MS[41]#66467L, MS[42]#66468L, MS[43]#66469L, MS[44]#66470L, MS[45]#66471L, MS[46]#66472L, MS[47]#66473L, MS[48]#66474L, MS[49]#66475L, MS[50]#66476L, MS[51]#66477L, sum#66639L, sum#66640, sum#66641, count#66642L]
Results [59]: [segment#66411, processing_day#66413, count#66643L, MS[0]#66478L, MS[1]#66479L, MS[2]#66480L, MS[3]#66481L, MS[4]#66482L, MS[5]#66483L, MS[6]#66484L, MS[7]#66485L, MS[8]#66486L, MS[9]#66487L, MS[10]#66488L, MS[11]#66489L, MS[12]#66490L, MS[13]#66491L, MS[14]#66492L, MS[15]#66493L, MS[16]#66494L, MS[17]#66495L, MS[18]#66496L, MS[19]#66497L, MS[20]#66498L, MS[21]#66499L, MS[22]#66500L, MS[23]#66501L, MS[24]#66502L, MS[25]#66503L, MS[26]#66504L, MS[27]#66505L, MS[28]#66506L, MS[29]#66507L, MS[30]#66508L, MS[31]#66509L, MS[32]#66510L, MS[33]#66511L, MS[34]#66512L, MS[35]#66513L, MS[36]#66514L, MS[37]#66515L, MS[38]#66516L, MS[39]#66517L, MS[40]#66518L, MS[41]#66519L, MS[42]#66520L, MS[43]#66521L, MS[44]#66522L, MS[45]#66523L, MS[46]#66524L, MS[47]#66525L, MS[48]#66526L, MS[49]#66527L, MS[50]#66528L, MS[51]#66529L, sum#66644L, sum#66645, sum#66646, count#66647L]
(15) Exchange
Input [59]: [segment#66411, processing_day#66413, count#66643L, MS[0]#66478L, MS[1]#66479L, MS[2]#66480L, MS[3]#66481L, MS[4]#66482L, MS[5]#66483L, MS[6]#66484L, MS[7]#66485L, MS[8]#66486L, MS[9]#66487L, MS[10]#66488L, MS[11]#66489L, MS[12]#66490L, MS[13]#66491L, MS[14]#66492L, MS[15]#66493L, MS[16]#66494L, MS[17]#66495L, MS[18]#66496L, MS[19]#66497L, MS[20]#66498L, MS[21]#66499L, MS[22]#66500L, MS[23]#66501L, MS[24]#66502L, MS[25]#66503L, MS[26]#66504L, MS[27]#66505L, MS[28]#66506L, MS[29]#66507L, MS[30]#66508L, MS[31]#66509L, MS[32]#66510L, MS[33]#66511L, MS[34]#66512L, MS[35]#66513L, MS[36]#66514L, MS[37]#66515L, MS[38]#66516L, MS[39]#66517L, MS[40]#66518L, MS[41]#66519L, MS[42]#66520L, MS[43]#66521L, MS[44]#66522L, MS[45]#66523L, MS[46]#66524L, MS[47]#66525L, MS[48]#66526L, MS[49]#66527L, MS[50]#66528L, MS[51]#66529L, sum#66644L, sum#66645, sum#66646, count#66647L]
Arguments: hashpartitioning(segment#66411, processing_day#66413, 200), ENSURE_REQUIREMENTS, [plan_id=6266]
(16) HashAggregate
Input [59]: [segment#66411, processing_day#66413, count#66643L, MS[0]#66478L, MS[1]#66479L, MS[2]#66480L, MS[3]#66481L, MS[4]#66482L, MS[5]#66483L, MS[6]#66484L, MS[7]#66485L, MS[8]#66486L, MS[9]#66487L, MS[10]#66488L, MS[11]#66489L, MS[12]#66490L, MS[13]#66491L, MS[14]#66492L, MS[15]#66493L, MS[16]#66494L, MS[17]#66495L, MS[18]#66496L, MS[19]#66497L, MS[20]#66498L, MS[21]#66499L, MS[22]#66500L, MS[23]#66501L, MS[24]#66502L, MS[25]#66503L, MS[26]#66504L, MS[27]#66505L, MS[28]#66506L, MS[29]#66507L, MS[30]#66508L, MS[31]#66509L, MS[32]#66510L, MS[33]#66511L, MS[34]#66512L, MS[35]#66513L, MS[36]#66514L, MS[37]#66515L, MS[38]#66516L, MS[39]#66517L, MS[40]#66518L, MS[41]#66519L, MS[42]#66520L, MS[43]#66521L, MS[44]#66522L, MS[45]#66523L, MS[46]#66524L, MS[47]#66525L, MS[48]#66526L, MS[49]#66527L, MS[50]#66528L, MS[51]#66529L, sum#66644L, sum#66645, sum#66646, count#66647L]
Keys [2]: [segment#66411, processing_day#66413]
Functions [5]: [count(1), approx_count_distinct(customer_id#66407L, 0.05, 0, 0), sum(events#66417), sum(weighted_amount#66419), avg(amount#66415)]
Aggregate Attributes [5]: [count(1)#66425L, approx_count_distinct(customer_id#66407L, 0.05, 0, 0)#66530L, sum(events#66417)#66531L, sum(weighted_amount#66419)#66532, avg(amount#66415)#66533]
Results [7]: [segment#66411, processing_day#66413, count(1)#66425L AS row_count#66420L, approx_count_distinct(customer_id#66407L, 0.05, 0, 0)#66530L AS unique_customers#66421L, sum(events#66417)#66531L AS event_sum#66422L, sum(weighted_amount#66419)#66532 AS weighted_amount_sum#66423, avg(amount#66415)#66533 AS avg_amount#66424]
(17) Exchange
Input [7]: [segment#66411, processing_day#66413, row_count#66420L, unique_customers#66421L, event_sum#66422L, weighted_amount_sum#66423, avg_amount#66424]
Arguments: rangepartitioning(segment#66411 ASC NULLS FIRST, processing_day#66413 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=6269]
(18) Sort
Input [7]: [segment#66411, processing_day#66413, row_count#66420L, unique_customers#66421L, event_sum#66422L, weighted_amount_sum#66423, avg_amount#66424]
Arguments: [segment#66411 ASC NULLS FIRST, processing_day#66413 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#66411, processing_day#66413, row_count#66420L, unique_customers#66421L, event_sum#66422L, weighted_amount_sum#66423, avg_amount#66424]
Arguments: isFinalPlan=true