== 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#38049L]
Arguments: Range (19000000, 20000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#38049L % 250000) AS customer_id#38051L, concat(segment-, cast(cast((id#38049L % 12) as int) as string)) AS segment#38055, cast((id#38049L % 14) as int) AS processing_day#38057, ((cast(((id#38049L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#38059, cast((((id#38049L * 29) % 7) + 1) as int) AS events#38061]
Input [1]: [id#38049L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#38051L, segment#38055, processing_day#38057, amount#38059, events#38061, (amount#38059 * cast(events#38061 as double)) AS weighted_amount#38063]
Input [5]: [customer_id#38051L, segment#38055, processing_day#38057, amount#38059, events#38061]
(4) HashAggregate
Input [6]: [customer_id#38051L, segment#38055, processing_day#38057, amount#38059, events#38061, weighted_amount#38063]
Keys [2]: [segment#38055, processing_day#38057]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#38051L, 0.05, 0, 0), partial_sum(events#38061), partial_sum(weighted_amount#38063), partial_avg(amount#38059)]
Aggregate Attributes [57]: [count#38282L, MS[0]#38070L, MS[1]#38071L, MS[2]#38072L, MS[3]#38073L, MS[4]#38074L, MS[5]#38075L, MS[6]#38076L, MS[7]#38077L, MS[8]#38078L, MS[9]#38079L, MS[10]#38080L, MS[11]#38081L, MS[12]#38082L, MS[13]#38083L, MS[14]#38084L, MS[15]#38085L, MS[16]#38086L, MS[17]#38087L, MS[18]#38088L, MS[19]#38089L, MS[20]#38090L, MS[21]#38091L, MS[22]#38092L, MS[23]#38093L, MS[24]#38094L, MS[25]#38095L, MS[26]#38096L, MS[27]#38097L, MS[28]#38098L, MS[29]#38099L, MS[30]#38100L, MS[31]#38101L, MS[32]#38102L, MS[33]#38103L, MS[34]#38104L, MS[35]#38105L, MS[36]#38106L, MS[37]#38107L, MS[38]#38108L, MS[39]#38109L, MS[40]#38110L, MS[41]#38111L, MS[42]#38112L, MS[43]#38113L, MS[44]#38114L, MS[45]#38115L, MS[46]#38116L, MS[47]#38117L, MS[48]#38118L, MS[49]#38119L, MS[50]#38120L, MS[51]#38121L, sum#38283L, sum#38284, sum#38285, count#38286L]
Results [59]: [segment#38055, processing_day#38057, count#38287L, MS[0]#38122L, MS[1]#38123L, MS[2]#38124L, MS[3]#38125L, MS[4]#38126L, MS[5]#38127L, MS[6]#38128L, MS[7]#38129L, MS[8]#38130L, MS[9]#38131L, MS[10]#38132L, MS[11]#38133L, MS[12]#38134L, MS[13]#38135L, MS[14]#38136L, MS[15]#38137L, MS[16]#38138L, MS[17]#38139L, MS[18]#38140L, MS[19]#38141L, MS[20]#38142L, MS[21]#38143L, MS[22]#38144L, MS[23]#38145L, MS[24]#38146L, MS[25]#38147L, MS[26]#38148L, MS[27]#38149L, MS[28]#38150L, MS[29]#38151L, MS[30]#38152L, MS[31]#38153L, MS[32]#38154L, MS[33]#38155L, MS[34]#38156L, MS[35]#38157L, MS[36]#38158L, MS[37]#38159L, MS[38]#38160L, MS[39]#38161L, MS[40]#38162L, MS[41]#38163L, MS[42]#38164L, MS[43]#38165L, MS[44]#38166L, MS[45]#38167L, MS[46]#38168L, MS[47]#38169L, MS[48]#38170L, MS[49]#38171L, MS[50]#38172L, MS[51]#38173L, sum#38288L, sum#38289, sum#38290, count#38291L]
(5) Exchange
Input [59]: [segment#38055, processing_day#38057, count#38287L, MS[0]#38122L, MS[1]#38123L, MS[2]#38124L, MS[3]#38125L, MS[4]#38126L, MS[5]#38127L, MS[6]#38128L, MS[7]#38129L, MS[8]#38130L, MS[9]#38131L, MS[10]#38132L, MS[11]#38133L, MS[12]#38134L, MS[13]#38135L, MS[14]#38136L, MS[15]#38137L, MS[16]#38138L, MS[17]#38139L, MS[18]#38140L, MS[19]#38141L, MS[20]#38142L, MS[21]#38143L, MS[22]#38144L, MS[23]#38145L, MS[24]#38146L, MS[25]#38147L, MS[26]#38148L, MS[27]#38149L, MS[28]#38150L, MS[29]#38151L, MS[30]#38152L, MS[31]#38153L, MS[32]#38154L, MS[33]#38155L, MS[34]#38156L, MS[35]#38157L, MS[36]#38158L, MS[37]#38159L, MS[38]#38160L, MS[39]#38161L, MS[40]#38162L, MS[41]#38163L, MS[42]#38164L, MS[43]#38165L, MS[44]#38166L, MS[45]#38167L, MS[46]#38168L, MS[47]#38169L, MS[48]#38170L, MS[49]#38171L, MS[50]#38172L, MS[51]#38173L, sum#38288L, sum#38289, sum#38290, count#38291L]
Arguments: hashpartitioning(segment#38055, processing_day#38057, 200), ENSURE_REQUIREMENTS, [plan_id=3618]
(6) ShuffleQueryStage
Output [59]: [segment#38055, processing_day#38057, count#38287L, MS[0]#38122L, MS[1]#38123L, MS[2]#38124L, MS[3]#38125L, MS[4]#38126L, MS[5]#38127L, MS[6]#38128L, MS[7]#38129L, MS[8]#38130L, MS[9]#38131L, MS[10]#38132L, MS[11]#38133L, MS[12]#38134L, MS[13]#38135L, MS[14]#38136L, MS[15]#38137L, MS[16]#38138L, MS[17]#38139L, MS[18]#38140L, MS[19]#38141L, MS[20]#38142L, MS[21]#38143L, MS[22]#38144L, MS[23]#38145L, MS[24]#38146L, MS[25]#38147L, MS[26]#38148L, MS[27]#38149L, MS[28]#38150L, MS[29]#38151L, MS[30]#38152L, MS[31]#38153L, MS[32]#38154L, MS[33]#38155L, MS[34]#38156L, MS[35]#38157L, MS[36]#38158L, MS[37]#38159L, MS[38]#38160L, MS[39]#38161L, MS[40]#38162L, MS[41]#38163L, MS[42]#38164L, MS[43]#38165L, MS[44]#38166L, MS[45]#38167L, MS[46]#38168L, MS[47]#38169L, MS[48]#38170L, MS[49]#38171L, MS[50]#38172L, MS[51]#38173L, sum#38288L, sum#38289, sum#38290, count#38291L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#38055, processing_day#38057, count#38287L, MS[0]#38122L, MS[1]#38123L, MS[2]#38124L, MS[3]#38125L, MS[4]#38126L, MS[5]#38127L, MS[6]#38128L, MS[7]#38129L, MS[8]#38130L, MS[9]#38131L, MS[10]#38132L, MS[11]#38133L, MS[12]#38134L, MS[13]#38135L, MS[14]#38136L, MS[15]#38137L, MS[16]#38138L, MS[17]#38139L, MS[18]#38140L, MS[19]#38141L, MS[20]#38142L, MS[21]#38143L, MS[22]#38144L, MS[23]#38145L, MS[24]#38146L, MS[25]#38147L, MS[26]#38148L, MS[27]#38149L, MS[28]#38150L, MS[29]#38151L, MS[30]#38152L, MS[31]#38153L, MS[32]#38154L, MS[33]#38155L, MS[34]#38156L, MS[35]#38157L, MS[36]#38158L, MS[37]#38159L, MS[38]#38160L, MS[39]#38161L, MS[40]#38162L, MS[41]#38163L, MS[42]#38164L, MS[43]#38165L, MS[44]#38166L, MS[45]#38167L, MS[46]#38168L, MS[47]#38169L, MS[48]#38170L, MS[49]#38171L, MS[50]#38172L, MS[51]#38173L, sum#38288L, sum#38289, sum#38290, count#38291L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#38055, processing_day#38057, count#38287L, MS[0]#38122L, MS[1]#38123L, MS[2]#38124L, MS[3]#38125L, MS[4]#38126L, MS[5]#38127L, MS[6]#38128L, MS[7]#38129L, MS[8]#38130L, MS[9]#38131L, MS[10]#38132L, MS[11]#38133L, MS[12]#38134L, MS[13]#38135L, MS[14]#38136L, MS[15]#38137L, MS[16]#38138L, MS[17]#38139L, MS[18]#38140L, MS[19]#38141L, MS[20]#38142L, MS[21]#38143L, MS[22]#38144L, MS[23]#38145L, MS[24]#38146L, MS[25]#38147L, MS[26]#38148L, MS[27]#38149L, MS[28]#38150L, MS[29]#38151L, MS[30]#38152L, MS[31]#38153L, MS[32]#38154L, MS[33]#38155L, MS[34]#38156L, MS[35]#38157L, MS[36]#38158L, MS[37]#38159L, MS[38]#38160L, MS[39]#38161L, MS[40]#38162L, MS[41]#38163L, MS[42]#38164L, MS[43]#38165L, MS[44]#38166L, MS[45]#38167L, MS[46]#38168L, MS[47]#38169L, MS[48]#38170L, MS[49]#38171L, MS[50]#38172L, MS[51]#38173L, sum#38288L, sum#38289, sum#38290, count#38291L]
Keys [2]: [segment#38055, processing_day#38057]
Functions [5]: [count(1), approx_count_distinct(customer_id#38051L, 0.05, 0, 0), sum(events#38061), sum(weighted_amount#38063), avg(amount#38059)]
Aggregate Attributes [5]: [count(1)#38069L, approx_count_distinct(customer_id#38051L, 0.05, 0, 0)#38174L, sum(events#38061)#38175L, sum(weighted_amount#38063)#38176, avg(amount#38059)#38177]
Results [7]: [segment#38055, processing_day#38057, count(1)#38069L AS row_count#38064L, approx_count_distinct(customer_id#38051L, 0.05, 0, 0)#38174L AS unique_customers#38065L, sum(events#38061)#38175L AS event_sum#38066L, sum(weighted_amount#38063)#38176 AS weighted_amount_sum#38067, avg(amount#38059)#38177 AS avg_amount#38068]
(9) Exchange
Input [7]: [segment#38055, processing_day#38057, row_count#38064L, unique_customers#38065L, event_sum#38066L, weighted_amount_sum#38067, avg_amount#38068]
Arguments: rangepartitioning(segment#38055 ASC NULLS FIRST, processing_day#38057 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3640]
(10) ShuffleQueryStage
Output [7]: [segment#38055, processing_day#38057, row_count#38064L, unique_customers#38065L, event_sum#38066L, weighted_amount_sum#38067, avg_amount#38068]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#38055, processing_day#38057, row_count#38064L, unique_customers#38065L, event_sum#38066L, weighted_amount_sum#38067, avg_amount#38068]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#38055, processing_day#38057, row_count#38064L, unique_customers#38065L, event_sum#38066L, weighted_amount_sum#38067, avg_amount#38068]
Arguments: [segment#38055 ASC NULLS FIRST, processing_day#38057 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#38055, processing_day#38057, row_count#38064L, unique_customers#38065L, event_sum#38066L, weighted_amount_sum#38067, avg_amount#38068]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#38051L, segment#38055, processing_day#38057, amount#38059, events#38061, weighted_amount#38063]
Keys [2]: [segment#38055, processing_day#38057]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#38051L, 0.05, 0, 0), partial_sum(events#38061), partial_sum(weighted_amount#38063), partial_avg(amount#38059)]
Aggregate Attributes [57]: [count#38282L, MS[0]#38070L, MS[1]#38071L, MS[2]#38072L, MS[3]#38073L, MS[4]#38074L, MS[5]#38075L, MS[6]#38076L, MS[7]#38077L, MS[8]#38078L, MS[9]#38079L, MS[10]#38080L, MS[11]#38081L, MS[12]#38082L, MS[13]#38083L, MS[14]#38084L, MS[15]#38085L, MS[16]#38086L, MS[17]#38087L, MS[18]#38088L, MS[19]#38089L, MS[20]#38090L, MS[21]#38091L, MS[22]#38092L, MS[23]#38093L, MS[24]#38094L, MS[25]#38095L, MS[26]#38096L, MS[27]#38097L, MS[28]#38098L, MS[29]#38099L, MS[30]#38100L, MS[31]#38101L, MS[32]#38102L, MS[33]#38103L, MS[34]#38104L, MS[35]#38105L, MS[36]#38106L, MS[37]#38107L, MS[38]#38108L, MS[39]#38109L, MS[40]#38110L, MS[41]#38111L, MS[42]#38112L, MS[43]#38113L, MS[44]#38114L, MS[45]#38115L, MS[46]#38116L, MS[47]#38117L, MS[48]#38118L, MS[49]#38119L, MS[50]#38120L, MS[51]#38121L, sum#38283L, sum#38284, sum#38285, count#38286L]
Results [59]: [segment#38055, processing_day#38057, count#38287L, MS[0]#38122L, MS[1]#38123L, MS[2]#38124L, MS[3]#38125L, MS[4]#38126L, MS[5]#38127L, MS[6]#38128L, MS[7]#38129L, MS[8]#38130L, MS[9]#38131L, MS[10]#38132L, MS[11]#38133L, MS[12]#38134L, MS[13]#38135L, MS[14]#38136L, MS[15]#38137L, MS[16]#38138L, MS[17]#38139L, MS[18]#38140L, MS[19]#38141L, MS[20]#38142L, MS[21]#38143L, MS[22]#38144L, MS[23]#38145L, MS[24]#38146L, MS[25]#38147L, MS[26]#38148L, MS[27]#38149L, MS[28]#38150L, MS[29]#38151L, MS[30]#38152L, MS[31]#38153L, MS[32]#38154L, MS[33]#38155L, MS[34]#38156L, MS[35]#38157L, MS[36]#38158L, MS[37]#38159L, MS[38]#38160L, MS[39]#38161L, MS[40]#38162L, MS[41]#38163L, MS[42]#38164L, MS[43]#38165L, MS[44]#38166L, MS[45]#38167L, MS[46]#38168L, MS[47]#38169L, MS[48]#38170L, MS[49]#38171L, MS[50]#38172L, MS[51]#38173L, sum#38288L, sum#38289, sum#38290, count#38291L]
(15) Exchange
Input [59]: [segment#38055, processing_day#38057, count#38287L, MS[0]#38122L, MS[1]#38123L, MS[2]#38124L, MS[3]#38125L, MS[4]#38126L, MS[5]#38127L, MS[6]#38128L, MS[7]#38129L, MS[8]#38130L, MS[9]#38131L, MS[10]#38132L, MS[11]#38133L, MS[12]#38134L, MS[13]#38135L, MS[14]#38136L, MS[15]#38137L, MS[16]#38138L, MS[17]#38139L, MS[18]#38140L, MS[19]#38141L, MS[20]#38142L, MS[21]#38143L, MS[22]#38144L, MS[23]#38145L, MS[24]#38146L, MS[25]#38147L, MS[26]#38148L, MS[27]#38149L, MS[28]#38150L, MS[29]#38151L, MS[30]#38152L, MS[31]#38153L, MS[32]#38154L, MS[33]#38155L, MS[34]#38156L, MS[35]#38157L, MS[36]#38158L, MS[37]#38159L, MS[38]#38160L, MS[39]#38161L, MS[40]#38162L, MS[41]#38163L, MS[42]#38164L, MS[43]#38165L, MS[44]#38166L, MS[45]#38167L, MS[46]#38168L, MS[47]#38169L, MS[48]#38170L, MS[49]#38171L, MS[50]#38172L, MS[51]#38173L, sum#38288L, sum#38289, sum#38290, count#38291L]
Arguments: hashpartitioning(segment#38055, processing_day#38057, 200), ENSURE_REQUIREMENTS, [plan_id=3598]
(16) HashAggregate
Input [59]: [segment#38055, processing_day#38057, count#38287L, MS[0]#38122L, MS[1]#38123L, MS[2]#38124L, MS[3]#38125L, MS[4]#38126L, MS[5]#38127L, MS[6]#38128L, MS[7]#38129L, MS[8]#38130L, MS[9]#38131L, MS[10]#38132L, MS[11]#38133L, MS[12]#38134L, MS[13]#38135L, MS[14]#38136L, MS[15]#38137L, MS[16]#38138L, MS[17]#38139L, MS[18]#38140L, MS[19]#38141L, MS[20]#38142L, MS[21]#38143L, MS[22]#38144L, MS[23]#38145L, MS[24]#38146L, MS[25]#38147L, MS[26]#38148L, MS[27]#38149L, MS[28]#38150L, MS[29]#38151L, MS[30]#38152L, MS[31]#38153L, MS[32]#38154L, MS[33]#38155L, MS[34]#38156L, MS[35]#38157L, MS[36]#38158L, MS[37]#38159L, MS[38]#38160L, MS[39]#38161L, MS[40]#38162L, MS[41]#38163L, MS[42]#38164L, MS[43]#38165L, MS[44]#38166L, MS[45]#38167L, MS[46]#38168L, MS[47]#38169L, MS[48]#38170L, MS[49]#38171L, MS[50]#38172L, MS[51]#38173L, sum#38288L, sum#38289, sum#38290, count#38291L]
Keys [2]: [segment#38055, processing_day#38057]
Functions [5]: [count(1), approx_count_distinct(customer_id#38051L, 0.05, 0, 0), sum(events#38061), sum(weighted_amount#38063), avg(amount#38059)]
Aggregate Attributes [5]: [count(1)#38069L, approx_count_distinct(customer_id#38051L, 0.05, 0, 0)#38174L, sum(events#38061)#38175L, sum(weighted_amount#38063)#38176, avg(amount#38059)#38177]
Results [7]: [segment#38055, processing_day#38057, count(1)#38069L AS row_count#38064L, approx_count_distinct(customer_id#38051L, 0.05, 0, 0)#38174L AS unique_customers#38065L, sum(events#38061)#38175L AS event_sum#38066L, sum(weighted_amount#38063)#38176 AS weighted_amount_sum#38067, avg(amount#38059)#38177 AS avg_amount#38068]
(17) Exchange
Input [7]: [segment#38055, processing_day#38057, row_count#38064L, unique_customers#38065L, event_sum#38066L, weighted_amount_sum#38067, avg_amount#38068]
Arguments: rangepartitioning(segment#38055 ASC NULLS FIRST, processing_day#38057 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3601]
(18) Sort
Input [7]: [segment#38055, processing_day#38057, row_count#38064L, unique_customers#38065L, event_sum#38066L, weighted_amount_sum#38067, avg_amount#38068]
Arguments: [segment#38055 ASC NULLS FIRST, processing_day#38057 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#38055, processing_day#38057, row_count#38064L, unique_customers#38065L, event_sum#38066L, weighted_amount_sum#38067, avg_amount#38068]
Arguments: isFinalPlan=true