== 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#79665L]
Arguments: Range (18000000, 19000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#79665L % 250000) AS customer_id#79667L, concat(segment-, cast(cast((id#79665L % 12) as int) as string)) AS segment#79671, cast((id#79665L % 14) as int) AS processing_day#79673, ((cast(((id#79665L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#79675, cast((((id#79665L * 29) % 7) + 1) as int) AS events#79677]
Input [1]: [id#79665L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#79667L, segment#79671, processing_day#79673, amount#79675, events#79677, (amount#79675 * cast(events#79677 as double)) AS weighted_amount#79679]
Input [5]: [customer_id#79667L, segment#79671, processing_day#79673, amount#79675, events#79677]
(4) HashAggregate
Input [6]: [customer_id#79667L, segment#79671, processing_day#79673, amount#79675, events#79677, weighted_amount#79679]
Keys [2]: [segment#79671, processing_day#79673]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#79667L, 0.05, 0, 0), partial_sum(events#79677), partial_sum(weighted_amount#79679), partial_avg(amount#79675)]
Aggregate Attributes [57]: [count#79898L, MS[0]#79686L, MS[1]#79687L, MS[2]#79688L, MS[3]#79689L, MS[4]#79690L, MS[5]#79691L, MS[6]#79692L, MS[7]#79693L, MS[8]#79694L, MS[9]#79695L, MS[10]#79696L, MS[11]#79697L, MS[12]#79698L, MS[13]#79699L, MS[14]#79700L, MS[15]#79701L, MS[16]#79702L, MS[17]#79703L, MS[18]#79704L, MS[19]#79705L, MS[20]#79706L, MS[21]#79707L, MS[22]#79708L, MS[23]#79709L, MS[24]#79710L, MS[25]#79711L, MS[26]#79712L, MS[27]#79713L, MS[28]#79714L, MS[29]#79715L, MS[30]#79716L, MS[31]#79717L, MS[32]#79718L, MS[33]#79719L, MS[34]#79720L, MS[35]#79721L, MS[36]#79722L, MS[37]#79723L, MS[38]#79724L, MS[39]#79725L, MS[40]#79726L, MS[41]#79727L, MS[42]#79728L, MS[43]#79729L, MS[44]#79730L, MS[45]#79731L, MS[46]#79732L, MS[47]#79733L, MS[48]#79734L, MS[49]#79735L, MS[50]#79736L, MS[51]#79737L, sum#79899L, sum#79900, sum#79901, count#79902L]
Results [59]: [segment#79671, processing_day#79673, count#79903L, MS[0]#79738L, MS[1]#79739L, MS[2]#79740L, MS[3]#79741L, MS[4]#79742L, MS[5]#79743L, MS[6]#79744L, MS[7]#79745L, MS[8]#79746L, MS[9]#79747L, MS[10]#79748L, MS[11]#79749L, MS[12]#79750L, MS[13]#79751L, MS[14]#79752L, MS[15]#79753L, MS[16]#79754L, MS[17]#79755L, MS[18]#79756L, MS[19]#79757L, MS[20]#79758L, MS[21]#79759L, MS[22]#79760L, MS[23]#79761L, MS[24]#79762L, MS[25]#79763L, MS[26]#79764L, MS[27]#79765L, MS[28]#79766L, MS[29]#79767L, MS[30]#79768L, MS[31]#79769L, MS[32]#79770L, MS[33]#79771L, MS[34]#79772L, MS[35]#79773L, MS[36]#79774L, MS[37]#79775L, MS[38]#79776L, MS[39]#79777L, MS[40]#79778L, MS[41]#79779L, MS[42]#79780L, MS[43]#79781L, MS[44]#79782L, MS[45]#79783L, MS[46]#79784L, MS[47]#79785L, MS[48]#79786L, MS[49]#79787L, MS[50]#79788L, MS[51]#79789L, sum#79904L, sum#79905, sum#79906, count#79907L]
(5) Exchange
Input [59]: [segment#79671, processing_day#79673, count#79903L, MS[0]#79738L, MS[1]#79739L, MS[2]#79740L, MS[3]#79741L, MS[4]#79742L, MS[5]#79743L, MS[6]#79744L, MS[7]#79745L, MS[8]#79746L, MS[9]#79747L, MS[10]#79748L, MS[11]#79749L, MS[12]#79750L, MS[13]#79751L, MS[14]#79752L, MS[15]#79753L, MS[16]#79754L, MS[17]#79755L, MS[18]#79756L, MS[19]#79757L, MS[20]#79758L, MS[21]#79759L, MS[22]#79760L, MS[23]#79761L, MS[24]#79762L, MS[25]#79763L, MS[26]#79764L, MS[27]#79765L, MS[28]#79766L, MS[29]#79767L, MS[30]#79768L, MS[31]#79769L, MS[32]#79770L, MS[33]#79771L, MS[34]#79772L, MS[35]#79773L, MS[36]#79774L, MS[37]#79775L, MS[38]#79776L, MS[39]#79777L, MS[40]#79778L, MS[41]#79779L, MS[42]#79780L, MS[43]#79781L, MS[44]#79782L, MS[45]#79783L, MS[46]#79784L, MS[47]#79785L, MS[48]#79786L, MS[49]#79787L, MS[50]#79788L, MS[51]#79789L, sum#79904L, sum#79905, sum#79906, count#79907L]
Arguments: hashpartitioning(segment#79671, processing_day#79673, 200), ENSURE_REQUIREMENTS, [plan_id=7531]
(6) ShuffleQueryStage
Output [59]: [segment#79671, processing_day#79673, count#79903L, MS[0]#79738L, MS[1]#79739L, MS[2]#79740L, MS[3]#79741L, MS[4]#79742L, MS[5]#79743L, MS[6]#79744L, MS[7]#79745L, MS[8]#79746L, MS[9]#79747L, MS[10]#79748L, MS[11]#79749L, MS[12]#79750L, MS[13]#79751L, MS[14]#79752L, MS[15]#79753L, MS[16]#79754L, MS[17]#79755L, MS[18]#79756L, MS[19]#79757L, MS[20]#79758L, MS[21]#79759L, MS[22]#79760L, MS[23]#79761L, MS[24]#79762L, MS[25]#79763L, MS[26]#79764L, MS[27]#79765L, MS[28]#79766L, MS[29]#79767L, MS[30]#79768L, MS[31]#79769L, MS[32]#79770L, MS[33]#79771L, MS[34]#79772L, MS[35]#79773L, MS[36]#79774L, MS[37]#79775L, MS[38]#79776L, MS[39]#79777L, MS[40]#79778L, MS[41]#79779L, MS[42]#79780L, MS[43]#79781L, MS[44]#79782L, MS[45]#79783L, MS[46]#79784L, MS[47]#79785L, MS[48]#79786L, MS[49]#79787L, MS[50]#79788L, MS[51]#79789L, sum#79904L, sum#79905, sum#79906, count#79907L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#79671, processing_day#79673, count#79903L, MS[0]#79738L, MS[1]#79739L, MS[2]#79740L, MS[3]#79741L, MS[4]#79742L, MS[5]#79743L, MS[6]#79744L, MS[7]#79745L, MS[8]#79746L, MS[9]#79747L, MS[10]#79748L, MS[11]#79749L, MS[12]#79750L, MS[13]#79751L, MS[14]#79752L, MS[15]#79753L, MS[16]#79754L, MS[17]#79755L, MS[18]#79756L, MS[19]#79757L, MS[20]#79758L, MS[21]#79759L, MS[22]#79760L, MS[23]#79761L, MS[24]#79762L, MS[25]#79763L, MS[26]#79764L, MS[27]#79765L, MS[28]#79766L, MS[29]#79767L, MS[30]#79768L, MS[31]#79769L, MS[32]#79770L, MS[33]#79771L, MS[34]#79772L, MS[35]#79773L, MS[36]#79774L, MS[37]#79775L, MS[38]#79776L, MS[39]#79777L, MS[40]#79778L, MS[41]#79779L, MS[42]#79780L, MS[43]#79781L, MS[44]#79782L, MS[45]#79783L, MS[46]#79784L, MS[47]#79785L, MS[48]#79786L, MS[49]#79787L, MS[50]#79788L, MS[51]#79789L, sum#79904L, sum#79905, sum#79906, count#79907L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#79671, processing_day#79673, count#79903L, MS[0]#79738L, MS[1]#79739L, MS[2]#79740L, MS[3]#79741L, MS[4]#79742L, MS[5]#79743L, MS[6]#79744L, MS[7]#79745L, MS[8]#79746L, MS[9]#79747L, MS[10]#79748L, MS[11]#79749L, MS[12]#79750L, MS[13]#79751L, MS[14]#79752L, MS[15]#79753L, MS[16]#79754L, MS[17]#79755L, MS[18]#79756L, MS[19]#79757L, MS[20]#79758L, MS[21]#79759L, MS[22]#79760L, MS[23]#79761L, MS[24]#79762L, MS[25]#79763L, MS[26]#79764L, MS[27]#79765L, MS[28]#79766L, MS[29]#79767L, MS[30]#79768L, MS[31]#79769L, MS[32]#79770L, MS[33]#79771L, MS[34]#79772L, MS[35]#79773L, MS[36]#79774L, MS[37]#79775L, MS[38]#79776L, MS[39]#79777L, MS[40]#79778L, MS[41]#79779L, MS[42]#79780L, MS[43]#79781L, MS[44]#79782L, MS[45]#79783L, MS[46]#79784L, MS[47]#79785L, MS[48]#79786L, MS[49]#79787L, MS[50]#79788L, MS[51]#79789L, sum#79904L, sum#79905, sum#79906, count#79907L]
Keys [2]: [segment#79671, processing_day#79673]
Functions [5]: [count(1), approx_count_distinct(customer_id#79667L, 0.05, 0, 0), sum(events#79677), sum(weighted_amount#79679), avg(amount#79675)]
Aggregate Attributes [5]: [count(1)#79685L, approx_count_distinct(customer_id#79667L, 0.05, 0, 0)#79790L, sum(events#79677)#79791L, sum(weighted_amount#79679)#79792, avg(amount#79675)#79793]
Results [7]: [segment#79671, processing_day#79673, count(1)#79685L AS row_count#79680L, approx_count_distinct(customer_id#79667L, 0.05, 0, 0)#79790L AS unique_customers#79681L, sum(events#79677)#79791L AS event_sum#79682L, sum(weighted_amount#79679)#79792 AS weighted_amount_sum#79683, avg(amount#79675)#79793 AS avg_amount#79684]
(9) Exchange
Input [7]: [segment#79671, processing_day#79673, row_count#79680L, unique_customers#79681L, event_sum#79682L, weighted_amount_sum#79683, avg_amount#79684]
Arguments: rangepartitioning(segment#79671 ASC NULLS FIRST, processing_day#79673 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=7553]
(10) ShuffleQueryStage
Output [7]: [segment#79671, processing_day#79673, row_count#79680L, unique_customers#79681L, event_sum#79682L, weighted_amount_sum#79683, avg_amount#79684]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#79671, processing_day#79673, row_count#79680L, unique_customers#79681L, event_sum#79682L, weighted_amount_sum#79683, avg_amount#79684]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#79671, processing_day#79673, row_count#79680L, unique_customers#79681L, event_sum#79682L, weighted_amount_sum#79683, avg_amount#79684]
Arguments: [segment#79671 ASC NULLS FIRST, processing_day#79673 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#79671, processing_day#79673, row_count#79680L, unique_customers#79681L, event_sum#79682L, weighted_amount_sum#79683, avg_amount#79684]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#79667L, segment#79671, processing_day#79673, amount#79675, events#79677, weighted_amount#79679]
Keys [2]: [segment#79671, processing_day#79673]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#79667L, 0.05, 0, 0), partial_sum(events#79677), partial_sum(weighted_amount#79679), partial_avg(amount#79675)]
Aggregate Attributes [57]: [count#79898L, MS[0]#79686L, MS[1]#79687L, MS[2]#79688L, MS[3]#79689L, MS[4]#79690L, MS[5]#79691L, MS[6]#79692L, MS[7]#79693L, MS[8]#79694L, MS[9]#79695L, MS[10]#79696L, MS[11]#79697L, MS[12]#79698L, MS[13]#79699L, MS[14]#79700L, MS[15]#79701L, MS[16]#79702L, MS[17]#79703L, MS[18]#79704L, MS[19]#79705L, MS[20]#79706L, MS[21]#79707L, MS[22]#79708L, MS[23]#79709L, MS[24]#79710L, MS[25]#79711L, MS[26]#79712L, MS[27]#79713L, MS[28]#79714L, MS[29]#79715L, MS[30]#79716L, MS[31]#79717L, MS[32]#79718L, MS[33]#79719L, MS[34]#79720L, MS[35]#79721L, MS[36]#79722L, MS[37]#79723L, MS[38]#79724L, MS[39]#79725L, MS[40]#79726L, MS[41]#79727L, MS[42]#79728L, MS[43]#79729L, MS[44]#79730L, MS[45]#79731L, MS[46]#79732L, MS[47]#79733L, MS[48]#79734L, MS[49]#79735L, MS[50]#79736L, MS[51]#79737L, sum#79899L, sum#79900, sum#79901, count#79902L]
Results [59]: [segment#79671, processing_day#79673, count#79903L, MS[0]#79738L, MS[1]#79739L, MS[2]#79740L, MS[3]#79741L, MS[4]#79742L, MS[5]#79743L, MS[6]#79744L, MS[7]#79745L, MS[8]#79746L, MS[9]#79747L, MS[10]#79748L, MS[11]#79749L, MS[12]#79750L, MS[13]#79751L, MS[14]#79752L, MS[15]#79753L, MS[16]#79754L, MS[17]#79755L, MS[18]#79756L, MS[19]#79757L, MS[20]#79758L, MS[21]#79759L, MS[22]#79760L, MS[23]#79761L, MS[24]#79762L, MS[25]#79763L, MS[26]#79764L, MS[27]#79765L, MS[28]#79766L, MS[29]#79767L, MS[30]#79768L, MS[31]#79769L, MS[32]#79770L, MS[33]#79771L, MS[34]#79772L, MS[35]#79773L, MS[36]#79774L, MS[37]#79775L, MS[38]#79776L, MS[39]#79777L, MS[40]#79778L, MS[41]#79779L, MS[42]#79780L, MS[43]#79781L, MS[44]#79782L, MS[45]#79783L, MS[46]#79784L, MS[47]#79785L, MS[48]#79786L, MS[49]#79787L, MS[50]#79788L, MS[51]#79789L, sum#79904L, sum#79905, sum#79906, count#79907L]
(15) Exchange
Input [59]: [segment#79671, processing_day#79673, count#79903L, MS[0]#79738L, MS[1]#79739L, MS[2]#79740L, MS[3]#79741L, MS[4]#79742L, MS[5]#79743L, MS[6]#79744L, MS[7]#79745L, MS[8]#79746L, MS[9]#79747L, MS[10]#79748L, MS[11]#79749L, MS[12]#79750L, MS[13]#79751L, MS[14]#79752L, MS[15]#79753L, MS[16]#79754L, MS[17]#79755L, MS[18]#79756L, MS[19]#79757L, MS[20]#79758L, MS[21]#79759L, MS[22]#79760L, MS[23]#79761L, MS[24]#79762L, MS[25]#79763L, MS[26]#79764L, MS[27]#79765L, MS[28]#79766L, MS[29]#79767L, MS[30]#79768L, MS[31]#79769L, MS[32]#79770L, MS[33]#79771L, MS[34]#79772L, MS[35]#79773L, MS[36]#79774L, MS[37]#79775L, MS[38]#79776L, MS[39]#79777L, MS[40]#79778L, MS[41]#79779L, MS[42]#79780L, MS[43]#79781L, MS[44]#79782L, MS[45]#79783L, MS[46]#79784L, MS[47]#79785L, MS[48]#79786L, MS[49]#79787L, MS[50]#79788L, MS[51]#79789L, sum#79904L, sum#79905, sum#79906, count#79907L]
Arguments: hashpartitioning(segment#79671, processing_day#79673, 200), ENSURE_REQUIREMENTS, [plan_id=7511]
(16) HashAggregate
Input [59]: [segment#79671, processing_day#79673, count#79903L, MS[0]#79738L, MS[1]#79739L, MS[2]#79740L, MS[3]#79741L, MS[4]#79742L, MS[5]#79743L, MS[6]#79744L, MS[7]#79745L, MS[8]#79746L, MS[9]#79747L, MS[10]#79748L, MS[11]#79749L, MS[12]#79750L, MS[13]#79751L, MS[14]#79752L, MS[15]#79753L, MS[16]#79754L, MS[17]#79755L, MS[18]#79756L, MS[19]#79757L, MS[20]#79758L, MS[21]#79759L, MS[22]#79760L, MS[23]#79761L, MS[24]#79762L, MS[25]#79763L, MS[26]#79764L, MS[27]#79765L, MS[28]#79766L, MS[29]#79767L, MS[30]#79768L, MS[31]#79769L, MS[32]#79770L, MS[33]#79771L, MS[34]#79772L, MS[35]#79773L, MS[36]#79774L, MS[37]#79775L, MS[38]#79776L, MS[39]#79777L, MS[40]#79778L, MS[41]#79779L, MS[42]#79780L, MS[43]#79781L, MS[44]#79782L, MS[45]#79783L, MS[46]#79784L, MS[47]#79785L, MS[48]#79786L, MS[49]#79787L, MS[50]#79788L, MS[51]#79789L, sum#79904L, sum#79905, sum#79906, count#79907L]
Keys [2]: [segment#79671, processing_day#79673]
Functions [5]: [count(1), approx_count_distinct(customer_id#79667L, 0.05, 0, 0), sum(events#79677), sum(weighted_amount#79679), avg(amount#79675)]
Aggregate Attributes [5]: [count(1)#79685L, approx_count_distinct(customer_id#79667L, 0.05, 0, 0)#79790L, sum(events#79677)#79791L, sum(weighted_amount#79679)#79792, avg(amount#79675)#79793]
Results [7]: [segment#79671, processing_day#79673, count(1)#79685L AS row_count#79680L, approx_count_distinct(customer_id#79667L, 0.05, 0, 0)#79790L AS unique_customers#79681L, sum(events#79677)#79791L AS event_sum#79682L, sum(weighted_amount#79679)#79792 AS weighted_amount_sum#79683, avg(amount#79675)#79793 AS avg_amount#79684]
(17) Exchange
Input [7]: [segment#79671, processing_day#79673, row_count#79680L, unique_customers#79681L, event_sum#79682L, weighted_amount_sum#79683, avg_amount#79684]
Arguments: rangepartitioning(segment#79671 ASC NULLS FIRST, processing_day#79673 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=7514]
(18) Sort
Input [7]: [segment#79671, processing_day#79673, row_count#79680L, unique_customers#79681L, event_sum#79682L, weighted_amount_sum#79683, avg_amount#79684]
Arguments: [segment#79671 ASC NULLS FIRST, processing_day#79673 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#79671, processing_day#79673, row_count#79680L, unique_customers#79681L, event_sum#79682L, weighted_amount_sum#79683, avg_amount#79684]
Arguments: isFinalPlan=true