== 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#61067L]
Arguments: Range (21000000, 22000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#61067L % 250000) AS customer_id#61069L, concat(segment-, cast(cast((id#61067L % 12) as int) as string)) AS segment#61073, cast((id#61067L % 14) as int) AS processing_day#61075, ((cast(((id#61067L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#61077, cast((((id#61067L * 29) % 7) + 1) as int) AS events#61079]
Input [1]: [id#61067L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#61069L, segment#61073, processing_day#61075, amount#61077, events#61079, (amount#61077 * cast(events#61079 as double)) AS weighted_amount#61081]
Input [5]: [customer_id#61069L, segment#61073, processing_day#61075, amount#61077, events#61079]
(4) HashAggregate
Input [6]: [customer_id#61069L, segment#61073, processing_day#61075, amount#61077, events#61079, weighted_amount#61081]
Keys [2]: [segment#61073, processing_day#61075]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#61069L, 0.05, 0, 0), partial_sum(events#61079), partial_sum(weighted_amount#61081), partial_avg(amount#61077)]
Aggregate Attributes [57]: [count#61300L, MS[0]#61088L, MS[1]#61089L, MS[2]#61090L, MS[3]#61091L, MS[4]#61092L, MS[5]#61093L, MS[6]#61094L, MS[7]#61095L, MS[8]#61096L, MS[9]#61097L, MS[10]#61098L, MS[11]#61099L, MS[12]#61100L, MS[13]#61101L, MS[14]#61102L, MS[15]#61103L, MS[16]#61104L, MS[17]#61105L, MS[18]#61106L, MS[19]#61107L, MS[20]#61108L, MS[21]#61109L, MS[22]#61110L, MS[23]#61111L, MS[24]#61112L, MS[25]#61113L, MS[26]#61114L, MS[27]#61115L, MS[28]#61116L, MS[29]#61117L, MS[30]#61118L, MS[31]#61119L, MS[32]#61120L, MS[33]#61121L, MS[34]#61122L, MS[35]#61123L, MS[36]#61124L, MS[37]#61125L, MS[38]#61126L, MS[39]#61127L, MS[40]#61128L, MS[41]#61129L, MS[42]#61130L, MS[43]#61131L, MS[44]#61132L, MS[45]#61133L, MS[46]#61134L, MS[47]#61135L, MS[48]#61136L, MS[49]#61137L, MS[50]#61138L, MS[51]#61139L, sum#61301L, sum#61302, sum#61303, count#61304L]
Results [59]: [segment#61073, processing_day#61075, count#61305L, MS[0]#61140L, MS[1]#61141L, MS[2]#61142L, MS[3]#61143L, MS[4]#61144L, MS[5]#61145L, MS[6]#61146L, MS[7]#61147L, MS[8]#61148L, MS[9]#61149L, MS[10]#61150L, MS[11]#61151L, MS[12]#61152L, MS[13]#61153L, MS[14]#61154L, MS[15]#61155L, MS[16]#61156L, MS[17]#61157L, MS[18]#61158L, MS[19]#61159L, MS[20]#61160L, MS[21]#61161L, MS[22]#61162L, MS[23]#61163L, MS[24]#61164L, MS[25]#61165L, MS[26]#61166L, MS[27]#61167L, MS[28]#61168L, MS[29]#61169L, MS[30]#61170L, MS[31]#61171L, MS[32]#61172L, MS[33]#61173L, MS[34]#61174L, MS[35]#61175L, MS[36]#61176L, MS[37]#61177L, MS[38]#61178L, MS[39]#61179L, MS[40]#61180L, MS[41]#61181L, MS[42]#61182L, MS[43]#61183L, MS[44]#61184L, MS[45]#61185L, MS[46]#61186L, MS[47]#61187L, MS[48]#61188L, MS[49]#61189L, MS[50]#61190L, MS[51]#61191L, sum#61306L, sum#61307, sum#61308, count#61309L]
(5) Exchange
Input [59]: [segment#61073, processing_day#61075, count#61305L, MS[0]#61140L, MS[1]#61141L, MS[2]#61142L, MS[3]#61143L, MS[4]#61144L, MS[5]#61145L, MS[6]#61146L, MS[7]#61147L, MS[8]#61148L, MS[9]#61149L, MS[10]#61150L, MS[11]#61151L, MS[12]#61152L, MS[13]#61153L, MS[14]#61154L, MS[15]#61155L, MS[16]#61156L, MS[17]#61157L, MS[18]#61158L, MS[19]#61159L, MS[20]#61160L, MS[21]#61161L, MS[22]#61162L, MS[23]#61163L, MS[24]#61164L, MS[25]#61165L, MS[26]#61166L, MS[27]#61167L, MS[28]#61168L, MS[29]#61169L, MS[30]#61170L, MS[31]#61171L, MS[32]#61172L, MS[33]#61173L, MS[34]#61174L, MS[35]#61175L, MS[36]#61176L, MS[37]#61177L, MS[38]#61178L, MS[39]#61179L, MS[40]#61180L, MS[41]#61181L, MS[42]#61182L, MS[43]#61183L, MS[44]#61184L, MS[45]#61185L, MS[46]#61186L, MS[47]#61187L, MS[48]#61188L, MS[49]#61189L, MS[50]#61190L, MS[51]#61191L, sum#61306L, sum#61307, sum#61308, count#61309L]
Arguments: hashpartitioning(segment#61073, processing_day#61075, 200), ENSURE_REQUIREMENTS, [plan_id=5782]
(6) ShuffleQueryStage
Output [59]: [segment#61073, processing_day#61075, count#61305L, MS[0]#61140L, MS[1]#61141L, MS[2]#61142L, MS[3]#61143L, MS[4]#61144L, MS[5]#61145L, MS[6]#61146L, MS[7]#61147L, MS[8]#61148L, MS[9]#61149L, MS[10]#61150L, MS[11]#61151L, MS[12]#61152L, MS[13]#61153L, MS[14]#61154L, MS[15]#61155L, MS[16]#61156L, MS[17]#61157L, MS[18]#61158L, MS[19]#61159L, MS[20]#61160L, MS[21]#61161L, MS[22]#61162L, MS[23]#61163L, MS[24]#61164L, MS[25]#61165L, MS[26]#61166L, MS[27]#61167L, MS[28]#61168L, MS[29]#61169L, MS[30]#61170L, MS[31]#61171L, MS[32]#61172L, MS[33]#61173L, MS[34]#61174L, MS[35]#61175L, MS[36]#61176L, MS[37]#61177L, MS[38]#61178L, MS[39]#61179L, MS[40]#61180L, MS[41]#61181L, MS[42]#61182L, MS[43]#61183L, MS[44]#61184L, MS[45]#61185L, MS[46]#61186L, MS[47]#61187L, MS[48]#61188L, MS[49]#61189L, MS[50]#61190L, MS[51]#61191L, sum#61306L, sum#61307, sum#61308, count#61309L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#61073, processing_day#61075, count#61305L, MS[0]#61140L, MS[1]#61141L, MS[2]#61142L, MS[3]#61143L, MS[4]#61144L, MS[5]#61145L, MS[6]#61146L, MS[7]#61147L, MS[8]#61148L, MS[9]#61149L, MS[10]#61150L, MS[11]#61151L, MS[12]#61152L, MS[13]#61153L, MS[14]#61154L, MS[15]#61155L, MS[16]#61156L, MS[17]#61157L, MS[18]#61158L, MS[19]#61159L, MS[20]#61160L, MS[21]#61161L, MS[22]#61162L, MS[23]#61163L, MS[24]#61164L, MS[25]#61165L, MS[26]#61166L, MS[27]#61167L, MS[28]#61168L, MS[29]#61169L, MS[30]#61170L, MS[31]#61171L, MS[32]#61172L, MS[33]#61173L, MS[34]#61174L, MS[35]#61175L, MS[36]#61176L, MS[37]#61177L, MS[38]#61178L, MS[39]#61179L, MS[40]#61180L, MS[41]#61181L, MS[42]#61182L, MS[43]#61183L, MS[44]#61184L, MS[45]#61185L, MS[46]#61186L, MS[47]#61187L, MS[48]#61188L, MS[49]#61189L, MS[50]#61190L, MS[51]#61191L, sum#61306L, sum#61307, sum#61308, count#61309L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#61073, processing_day#61075, count#61305L, MS[0]#61140L, MS[1]#61141L, MS[2]#61142L, MS[3]#61143L, MS[4]#61144L, MS[5]#61145L, MS[6]#61146L, MS[7]#61147L, MS[8]#61148L, MS[9]#61149L, MS[10]#61150L, MS[11]#61151L, MS[12]#61152L, MS[13]#61153L, MS[14]#61154L, MS[15]#61155L, MS[16]#61156L, MS[17]#61157L, MS[18]#61158L, MS[19]#61159L, MS[20]#61160L, MS[21]#61161L, MS[22]#61162L, MS[23]#61163L, MS[24]#61164L, MS[25]#61165L, MS[26]#61166L, MS[27]#61167L, MS[28]#61168L, MS[29]#61169L, MS[30]#61170L, MS[31]#61171L, MS[32]#61172L, MS[33]#61173L, MS[34]#61174L, MS[35]#61175L, MS[36]#61176L, MS[37]#61177L, MS[38]#61178L, MS[39]#61179L, MS[40]#61180L, MS[41]#61181L, MS[42]#61182L, MS[43]#61183L, MS[44]#61184L, MS[45]#61185L, MS[46]#61186L, MS[47]#61187L, MS[48]#61188L, MS[49]#61189L, MS[50]#61190L, MS[51]#61191L, sum#61306L, sum#61307, sum#61308, count#61309L]
Keys [2]: [segment#61073, processing_day#61075]
Functions [5]: [count(1), approx_count_distinct(customer_id#61069L, 0.05, 0, 0), sum(events#61079), sum(weighted_amount#61081), avg(amount#61077)]
Aggregate Attributes [5]: [count(1)#61087L, approx_count_distinct(customer_id#61069L, 0.05, 0, 0)#61192L, sum(events#61079)#61193L, sum(weighted_amount#61081)#61194, avg(amount#61077)#61195]
Results [7]: [segment#61073, processing_day#61075, count(1)#61087L AS row_count#61082L, approx_count_distinct(customer_id#61069L, 0.05, 0, 0)#61192L AS unique_customers#61083L, sum(events#61079)#61193L AS event_sum#61084L, sum(weighted_amount#61081)#61194 AS weighted_amount_sum#61085, avg(amount#61077)#61195 AS avg_amount#61086]
(9) Exchange
Input [7]: [segment#61073, processing_day#61075, row_count#61082L, unique_customers#61083L, event_sum#61084L, weighted_amount_sum#61085, avg_amount#61086]
Arguments: rangepartitioning(segment#61073 ASC NULLS FIRST, processing_day#61075 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5804]
(10) ShuffleQueryStage
Output [7]: [segment#61073, processing_day#61075, row_count#61082L, unique_customers#61083L, event_sum#61084L, weighted_amount_sum#61085, avg_amount#61086]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#61073, processing_day#61075, row_count#61082L, unique_customers#61083L, event_sum#61084L, weighted_amount_sum#61085, avg_amount#61086]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#61073, processing_day#61075, row_count#61082L, unique_customers#61083L, event_sum#61084L, weighted_amount_sum#61085, avg_amount#61086]
Arguments: [segment#61073 ASC NULLS FIRST, processing_day#61075 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#61073, processing_day#61075, row_count#61082L, unique_customers#61083L, event_sum#61084L, weighted_amount_sum#61085, avg_amount#61086]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#61069L, segment#61073, processing_day#61075, amount#61077, events#61079, weighted_amount#61081]
Keys [2]: [segment#61073, processing_day#61075]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#61069L, 0.05, 0, 0), partial_sum(events#61079), partial_sum(weighted_amount#61081), partial_avg(amount#61077)]
Aggregate Attributes [57]: [count#61300L, MS[0]#61088L, MS[1]#61089L, MS[2]#61090L, MS[3]#61091L, MS[4]#61092L, MS[5]#61093L, MS[6]#61094L, MS[7]#61095L, MS[8]#61096L, MS[9]#61097L, MS[10]#61098L, MS[11]#61099L, MS[12]#61100L, MS[13]#61101L, MS[14]#61102L, MS[15]#61103L, MS[16]#61104L, MS[17]#61105L, MS[18]#61106L, MS[19]#61107L, MS[20]#61108L, MS[21]#61109L, MS[22]#61110L, MS[23]#61111L, MS[24]#61112L, MS[25]#61113L, MS[26]#61114L, MS[27]#61115L, MS[28]#61116L, MS[29]#61117L, MS[30]#61118L, MS[31]#61119L, MS[32]#61120L, MS[33]#61121L, MS[34]#61122L, MS[35]#61123L, MS[36]#61124L, MS[37]#61125L, MS[38]#61126L, MS[39]#61127L, MS[40]#61128L, MS[41]#61129L, MS[42]#61130L, MS[43]#61131L, MS[44]#61132L, MS[45]#61133L, MS[46]#61134L, MS[47]#61135L, MS[48]#61136L, MS[49]#61137L, MS[50]#61138L, MS[51]#61139L, sum#61301L, sum#61302, sum#61303, count#61304L]
Results [59]: [segment#61073, processing_day#61075, count#61305L, MS[0]#61140L, MS[1]#61141L, MS[2]#61142L, MS[3]#61143L, MS[4]#61144L, MS[5]#61145L, MS[6]#61146L, MS[7]#61147L, MS[8]#61148L, MS[9]#61149L, MS[10]#61150L, MS[11]#61151L, MS[12]#61152L, MS[13]#61153L, MS[14]#61154L, MS[15]#61155L, MS[16]#61156L, MS[17]#61157L, MS[18]#61158L, MS[19]#61159L, MS[20]#61160L, MS[21]#61161L, MS[22]#61162L, MS[23]#61163L, MS[24]#61164L, MS[25]#61165L, MS[26]#61166L, MS[27]#61167L, MS[28]#61168L, MS[29]#61169L, MS[30]#61170L, MS[31]#61171L, MS[32]#61172L, MS[33]#61173L, MS[34]#61174L, MS[35]#61175L, MS[36]#61176L, MS[37]#61177L, MS[38]#61178L, MS[39]#61179L, MS[40]#61180L, MS[41]#61181L, MS[42]#61182L, MS[43]#61183L, MS[44]#61184L, MS[45]#61185L, MS[46]#61186L, MS[47]#61187L, MS[48]#61188L, MS[49]#61189L, MS[50]#61190L, MS[51]#61191L, sum#61306L, sum#61307, sum#61308, count#61309L]
(15) Exchange
Input [59]: [segment#61073, processing_day#61075, count#61305L, MS[0]#61140L, MS[1]#61141L, MS[2]#61142L, MS[3]#61143L, MS[4]#61144L, MS[5]#61145L, MS[6]#61146L, MS[7]#61147L, MS[8]#61148L, MS[9]#61149L, MS[10]#61150L, MS[11]#61151L, MS[12]#61152L, MS[13]#61153L, MS[14]#61154L, MS[15]#61155L, MS[16]#61156L, MS[17]#61157L, MS[18]#61158L, MS[19]#61159L, MS[20]#61160L, MS[21]#61161L, MS[22]#61162L, MS[23]#61163L, MS[24]#61164L, MS[25]#61165L, MS[26]#61166L, MS[27]#61167L, MS[28]#61168L, MS[29]#61169L, MS[30]#61170L, MS[31]#61171L, MS[32]#61172L, MS[33]#61173L, MS[34]#61174L, MS[35]#61175L, MS[36]#61176L, MS[37]#61177L, MS[38]#61178L, MS[39]#61179L, MS[40]#61180L, MS[41]#61181L, MS[42]#61182L, MS[43]#61183L, MS[44]#61184L, MS[45]#61185L, MS[46]#61186L, MS[47]#61187L, MS[48]#61188L, MS[49]#61189L, MS[50]#61190L, MS[51]#61191L, sum#61306L, sum#61307, sum#61308, count#61309L]
Arguments: hashpartitioning(segment#61073, processing_day#61075, 200), ENSURE_REQUIREMENTS, [plan_id=5762]
(16) HashAggregate
Input [59]: [segment#61073, processing_day#61075, count#61305L, MS[0]#61140L, MS[1]#61141L, MS[2]#61142L, MS[3]#61143L, MS[4]#61144L, MS[5]#61145L, MS[6]#61146L, MS[7]#61147L, MS[8]#61148L, MS[9]#61149L, MS[10]#61150L, MS[11]#61151L, MS[12]#61152L, MS[13]#61153L, MS[14]#61154L, MS[15]#61155L, MS[16]#61156L, MS[17]#61157L, MS[18]#61158L, MS[19]#61159L, MS[20]#61160L, MS[21]#61161L, MS[22]#61162L, MS[23]#61163L, MS[24]#61164L, MS[25]#61165L, MS[26]#61166L, MS[27]#61167L, MS[28]#61168L, MS[29]#61169L, MS[30]#61170L, MS[31]#61171L, MS[32]#61172L, MS[33]#61173L, MS[34]#61174L, MS[35]#61175L, MS[36]#61176L, MS[37]#61177L, MS[38]#61178L, MS[39]#61179L, MS[40]#61180L, MS[41]#61181L, MS[42]#61182L, MS[43]#61183L, MS[44]#61184L, MS[45]#61185L, MS[46]#61186L, MS[47]#61187L, MS[48]#61188L, MS[49]#61189L, MS[50]#61190L, MS[51]#61191L, sum#61306L, sum#61307, sum#61308, count#61309L]
Keys [2]: [segment#61073, processing_day#61075]
Functions [5]: [count(1), approx_count_distinct(customer_id#61069L, 0.05, 0, 0), sum(events#61079), sum(weighted_amount#61081), avg(amount#61077)]
Aggregate Attributes [5]: [count(1)#61087L, approx_count_distinct(customer_id#61069L, 0.05, 0, 0)#61192L, sum(events#61079)#61193L, sum(weighted_amount#61081)#61194, avg(amount#61077)#61195]
Results [7]: [segment#61073, processing_day#61075, count(1)#61087L AS row_count#61082L, approx_count_distinct(customer_id#61069L, 0.05, 0, 0)#61192L AS unique_customers#61083L, sum(events#61079)#61193L AS event_sum#61084L, sum(weighted_amount#61081)#61194 AS weighted_amount_sum#61085, avg(amount#61077)#61195 AS avg_amount#61086]
(17) Exchange
Input [7]: [segment#61073, processing_day#61075, row_count#61082L, unique_customers#61083L, event_sum#61084L, weighted_amount_sum#61085, avg_amount#61086]
Arguments: rangepartitioning(segment#61073 ASC NULLS FIRST, processing_day#61075 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5765]
(18) Sort
Input [7]: [segment#61073, processing_day#61075, row_count#61082L, unique_customers#61083L, event_sum#61084L, weighted_amount_sum#61085, avg_amount#61086]
Arguments: [segment#61073 ASC NULLS FIRST, processing_day#61075 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#61073, processing_day#61075, row_count#61082L, unique_customers#61083L, event_sum#61084L, weighted_amount_sum#61085, avg_amount#61086]
Arguments: isFinalPlan=true