== 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#44271L]
Arguments: Range (2000000, 3000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#44271L % 250000) AS customer_id#44273L, concat(segment-, cast(cast((id#44271L % 12) as int) as string)) AS segment#44277, cast((id#44271L % 14) as int) AS processing_day#44279, ((cast(((id#44271L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#44281, cast((((id#44271L * 29) % 7) + 1) as int) AS events#44283]
Input [1]: [id#44271L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#44273L, segment#44277, processing_day#44279, amount#44281, events#44283, (amount#44281 * cast(events#44283 as double)) AS weighted_amount#44285]
Input [5]: [customer_id#44273L, segment#44277, processing_day#44279, amount#44281, events#44283]
(4) HashAggregate
Input [6]: [customer_id#44273L, segment#44277, processing_day#44279, amount#44281, events#44283, weighted_amount#44285]
Keys [2]: [segment#44277, processing_day#44279]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#44273L, 0.05, 0, 0), partial_sum(events#44283), partial_sum(weighted_amount#44285), partial_avg(amount#44281)]
Aggregate Attributes [57]: [count#44504L, MS[0]#44292L, MS[1]#44293L, MS[2]#44294L, MS[3]#44295L, MS[4]#44296L, MS[5]#44297L, MS[6]#44298L, MS[7]#44299L, MS[8]#44300L, MS[9]#44301L, MS[10]#44302L, MS[11]#44303L, MS[12]#44304L, MS[13]#44305L, MS[14]#44306L, MS[15]#44307L, MS[16]#44308L, MS[17]#44309L, MS[18]#44310L, MS[19]#44311L, MS[20]#44312L, MS[21]#44313L, MS[22]#44314L, MS[23]#44315L, MS[24]#44316L, MS[25]#44317L, MS[26]#44318L, MS[27]#44319L, MS[28]#44320L, MS[29]#44321L, MS[30]#44322L, MS[31]#44323L, MS[32]#44324L, MS[33]#44325L, MS[34]#44326L, MS[35]#44327L, MS[36]#44328L, MS[37]#44329L, MS[38]#44330L, MS[39]#44331L, MS[40]#44332L, MS[41]#44333L, MS[42]#44334L, MS[43]#44335L, MS[44]#44336L, MS[45]#44337L, MS[46]#44338L, MS[47]#44339L, MS[48]#44340L, MS[49]#44341L, MS[50]#44342L, MS[51]#44343L, sum#44505L, sum#44506, sum#44507, count#44508L]
Results [59]: [segment#44277, processing_day#44279, count#44509L, MS[0]#44344L, MS[1]#44345L, MS[2]#44346L, MS[3]#44347L, MS[4]#44348L, MS[5]#44349L, MS[6]#44350L, MS[7]#44351L, MS[8]#44352L, MS[9]#44353L, MS[10]#44354L, MS[11]#44355L, MS[12]#44356L, MS[13]#44357L, MS[14]#44358L, MS[15]#44359L, MS[16]#44360L, MS[17]#44361L, MS[18]#44362L, MS[19]#44363L, MS[20]#44364L, MS[21]#44365L, MS[22]#44366L, MS[23]#44367L, MS[24]#44368L, MS[25]#44369L, MS[26]#44370L, MS[27]#44371L, MS[28]#44372L, MS[29]#44373L, MS[30]#44374L, MS[31]#44375L, MS[32]#44376L, MS[33]#44377L, MS[34]#44378L, MS[35]#44379L, MS[36]#44380L, MS[37]#44381L, MS[38]#44382L, MS[39]#44383L, MS[40]#44384L, MS[41]#44385L, MS[42]#44386L, MS[43]#44387L, MS[44]#44388L, MS[45]#44389L, MS[46]#44390L, MS[47]#44391L, MS[48]#44392L, MS[49]#44393L, MS[50]#44394L, MS[51]#44395L, sum#44510L, sum#44511, sum#44512, count#44513L]
(5) Exchange
Input [59]: [segment#44277, processing_day#44279, count#44509L, MS[0]#44344L, MS[1]#44345L, MS[2]#44346L, MS[3]#44347L, MS[4]#44348L, MS[5]#44349L, MS[6]#44350L, MS[7]#44351L, MS[8]#44352L, MS[9]#44353L, MS[10]#44354L, MS[11]#44355L, MS[12]#44356L, MS[13]#44357L, MS[14]#44358L, MS[15]#44359L, MS[16]#44360L, MS[17]#44361L, MS[18]#44362L, MS[19]#44363L, MS[20]#44364L, MS[21]#44365L, MS[22]#44366L, MS[23]#44367L, MS[24]#44368L, MS[25]#44369L, MS[26]#44370L, MS[27]#44371L, MS[28]#44372L, MS[29]#44373L, MS[30]#44374L, MS[31]#44375L, MS[32]#44376L, MS[33]#44377L, MS[34]#44378L, MS[35]#44379L, MS[36]#44380L, MS[37]#44381L, MS[38]#44382L, MS[39]#44383L, MS[40]#44384L, MS[41]#44385L, MS[42]#44386L, MS[43]#44387L, MS[44]#44388L, MS[45]#44389L, MS[46]#44390L, MS[47]#44391L, MS[48]#44392L, MS[49]#44393L, MS[50]#44394L, MS[51]#44395L, sum#44510L, sum#44511, sum#44512, count#44513L]
Arguments: hashpartitioning(segment#44277, processing_day#44279, 200), ENSURE_REQUIREMENTS, [plan_id=4205]
(6) ShuffleQueryStage
Output [59]: [segment#44277, processing_day#44279, count#44509L, MS[0]#44344L, MS[1]#44345L, MS[2]#44346L, MS[3]#44347L, MS[4]#44348L, MS[5]#44349L, MS[6]#44350L, MS[7]#44351L, MS[8]#44352L, MS[9]#44353L, MS[10]#44354L, MS[11]#44355L, MS[12]#44356L, MS[13]#44357L, MS[14]#44358L, MS[15]#44359L, MS[16]#44360L, MS[17]#44361L, MS[18]#44362L, MS[19]#44363L, MS[20]#44364L, MS[21]#44365L, MS[22]#44366L, MS[23]#44367L, MS[24]#44368L, MS[25]#44369L, MS[26]#44370L, MS[27]#44371L, MS[28]#44372L, MS[29]#44373L, MS[30]#44374L, MS[31]#44375L, MS[32]#44376L, MS[33]#44377L, MS[34]#44378L, MS[35]#44379L, MS[36]#44380L, MS[37]#44381L, MS[38]#44382L, MS[39]#44383L, MS[40]#44384L, MS[41]#44385L, MS[42]#44386L, MS[43]#44387L, MS[44]#44388L, MS[45]#44389L, MS[46]#44390L, MS[47]#44391L, MS[48]#44392L, MS[49]#44393L, MS[50]#44394L, MS[51]#44395L, sum#44510L, sum#44511, sum#44512, count#44513L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#44277, processing_day#44279, count#44509L, MS[0]#44344L, MS[1]#44345L, MS[2]#44346L, MS[3]#44347L, MS[4]#44348L, MS[5]#44349L, MS[6]#44350L, MS[7]#44351L, MS[8]#44352L, MS[9]#44353L, MS[10]#44354L, MS[11]#44355L, MS[12]#44356L, MS[13]#44357L, MS[14]#44358L, MS[15]#44359L, MS[16]#44360L, MS[17]#44361L, MS[18]#44362L, MS[19]#44363L, MS[20]#44364L, MS[21]#44365L, MS[22]#44366L, MS[23]#44367L, MS[24]#44368L, MS[25]#44369L, MS[26]#44370L, MS[27]#44371L, MS[28]#44372L, MS[29]#44373L, MS[30]#44374L, MS[31]#44375L, MS[32]#44376L, MS[33]#44377L, MS[34]#44378L, MS[35]#44379L, MS[36]#44380L, MS[37]#44381L, MS[38]#44382L, MS[39]#44383L, MS[40]#44384L, MS[41]#44385L, MS[42]#44386L, MS[43]#44387L, MS[44]#44388L, MS[45]#44389L, MS[46]#44390L, MS[47]#44391L, MS[48]#44392L, MS[49]#44393L, MS[50]#44394L, MS[51]#44395L, sum#44510L, sum#44511, sum#44512, count#44513L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#44277, processing_day#44279, count#44509L, MS[0]#44344L, MS[1]#44345L, MS[2]#44346L, MS[3]#44347L, MS[4]#44348L, MS[5]#44349L, MS[6]#44350L, MS[7]#44351L, MS[8]#44352L, MS[9]#44353L, MS[10]#44354L, MS[11]#44355L, MS[12]#44356L, MS[13]#44357L, MS[14]#44358L, MS[15]#44359L, MS[16]#44360L, MS[17]#44361L, MS[18]#44362L, MS[19]#44363L, MS[20]#44364L, MS[21]#44365L, MS[22]#44366L, MS[23]#44367L, MS[24]#44368L, MS[25]#44369L, MS[26]#44370L, MS[27]#44371L, MS[28]#44372L, MS[29]#44373L, MS[30]#44374L, MS[31]#44375L, MS[32]#44376L, MS[33]#44377L, MS[34]#44378L, MS[35]#44379L, MS[36]#44380L, MS[37]#44381L, MS[38]#44382L, MS[39]#44383L, MS[40]#44384L, MS[41]#44385L, MS[42]#44386L, MS[43]#44387L, MS[44]#44388L, MS[45]#44389L, MS[46]#44390L, MS[47]#44391L, MS[48]#44392L, MS[49]#44393L, MS[50]#44394L, MS[51]#44395L, sum#44510L, sum#44511, sum#44512, count#44513L]
Keys [2]: [segment#44277, processing_day#44279]
Functions [5]: [count(1), approx_count_distinct(customer_id#44273L, 0.05, 0, 0), sum(events#44283), sum(weighted_amount#44285), avg(amount#44281)]
Aggregate Attributes [5]: [count(1)#44291L, approx_count_distinct(customer_id#44273L, 0.05, 0, 0)#44396L, sum(events#44283)#44397L, sum(weighted_amount#44285)#44398, avg(amount#44281)#44399]
Results [7]: [segment#44277, processing_day#44279, count(1)#44291L AS row_count#44286L, approx_count_distinct(customer_id#44273L, 0.05, 0, 0)#44396L AS unique_customers#44287L, sum(events#44283)#44397L AS event_sum#44288L, sum(weighted_amount#44285)#44398 AS weighted_amount_sum#44289, avg(amount#44281)#44399 AS avg_amount#44290]
(9) Exchange
Input [7]: [segment#44277, processing_day#44279, row_count#44286L, unique_customers#44287L, event_sum#44288L, weighted_amount_sum#44289, avg_amount#44290]
Arguments: rangepartitioning(segment#44277 ASC NULLS FIRST, processing_day#44279 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4227]
(10) ShuffleQueryStage
Output [7]: [segment#44277, processing_day#44279, row_count#44286L, unique_customers#44287L, event_sum#44288L, weighted_amount_sum#44289, avg_amount#44290]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#44277, processing_day#44279, row_count#44286L, unique_customers#44287L, event_sum#44288L, weighted_amount_sum#44289, avg_amount#44290]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#44277, processing_day#44279, row_count#44286L, unique_customers#44287L, event_sum#44288L, weighted_amount_sum#44289, avg_amount#44290]
Arguments: [segment#44277 ASC NULLS FIRST, processing_day#44279 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#44277, processing_day#44279, row_count#44286L, unique_customers#44287L, event_sum#44288L, weighted_amount_sum#44289, avg_amount#44290]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#44273L, segment#44277, processing_day#44279, amount#44281, events#44283, weighted_amount#44285]
Keys [2]: [segment#44277, processing_day#44279]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#44273L, 0.05, 0, 0), partial_sum(events#44283), partial_sum(weighted_amount#44285), partial_avg(amount#44281)]
Aggregate Attributes [57]: [count#44504L, MS[0]#44292L, MS[1]#44293L, MS[2]#44294L, MS[3]#44295L, MS[4]#44296L, MS[5]#44297L, MS[6]#44298L, MS[7]#44299L, MS[8]#44300L, MS[9]#44301L, MS[10]#44302L, MS[11]#44303L, MS[12]#44304L, MS[13]#44305L, MS[14]#44306L, MS[15]#44307L, MS[16]#44308L, MS[17]#44309L, MS[18]#44310L, MS[19]#44311L, MS[20]#44312L, MS[21]#44313L, MS[22]#44314L, MS[23]#44315L, MS[24]#44316L, MS[25]#44317L, MS[26]#44318L, MS[27]#44319L, MS[28]#44320L, MS[29]#44321L, MS[30]#44322L, MS[31]#44323L, MS[32]#44324L, MS[33]#44325L, MS[34]#44326L, MS[35]#44327L, MS[36]#44328L, MS[37]#44329L, MS[38]#44330L, MS[39]#44331L, MS[40]#44332L, MS[41]#44333L, MS[42]#44334L, MS[43]#44335L, MS[44]#44336L, MS[45]#44337L, MS[46]#44338L, MS[47]#44339L, MS[48]#44340L, MS[49]#44341L, MS[50]#44342L, MS[51]#44343L, sum#44505L, sum#44506, sum#44507, count#44508L]
Results [59]: [segment#44277, processing_day#44279, count#44509L, MS[0]#44344L, MS[1]#44345L, MS[2]#44346L, MS[3]#44347L, MS[4]#44348L, MS[5]#44349L, MS[6]#44350L, MS[7]#44351L, MS[8]#44352L, MS[9]#44353L, MS[10]#44354L, MS[11]#44355L, MS[12]#44356L, MS[13]#44357L, MS[14]#44358L, MS[15]#44359L, MS[16]#44360L, MS[17]#44361L, MS[18]#44362L, MS[19]#44363L, MS[20]#44364L, MS[21]#44365L, MS[22]#44366L, MS[23]#44367L, MS[24]#44368L, MS[25]#44369L, MS[26]#44370L, MS[27]#44371L, MS[28]#44372L, MS[29]#44373L, MS[30]#44374L, MS[31]#44375L, MS[32]#44376L, MS[33]#44377L, MS[34]#44378L, MS[35]#44379L, MS[36]#44380L, MS[37]#44381L, MS[38]#44382L, MS[39]#44383L, MS[40]#44384L, MS[41]#44385L, MS[42]#44386L, MS[43]#44387L, MS[44]#44388L, MS[45]#44389L, MS[46]#44390L, MS[47]#44391L, MS[48]#44392L, MS[49]#44393L, MS[50]#44394L, MS[51]#44395L, sum#44510L, sum#44511, sum#44512, count#44513L]
(15) Exchange
Input [59]: [segment#44277, processing_day#44279, count#44509L, MS[0]#44344L, MS[1]#44345L, MS[2]#44346L, MS[3]#44347L, MS[4]#44348L, MS[5]#44349L, MS[6]#44350L, MS[7]#44351L, MS[8]#44352L, MS[9]#44353L, MS[10]#44354L, MS[11]#44355L, MS[12]#44356L, MS[13]#44357L, MS[14]#44358L, MS[15]#44359L, MS[16]#44360L, MS[17]#44361L, MS[18]#44362L, MS[19]#44363L, MS[20]#44364L, MS[21]#44365L, MS[22]#44366L, MS[23]#44367L, MS[24]#44368L, MS[25]#44369L, MS[26]#44370L, MS[27]#44371L, MS[28]#44372L, MS[29]#44373L, MS[30]#44374L, MS[31]#44375L, MS[32]#44376L, MS[33]#44377L, MS[34]#44378L, MS[35]#44379L, MS[36]#44380L, MS[37]#44381L, MS[38]#44382L, MS[39]#44383L, MS[40]#44384L, MS[41]#44385L, MS[42]#44386L, MS[43]#44387L, MS[44]#44388L, MS[45]#44389L, MS[46]#44390L, MS[47]#44391L, MS[48]#44392L, MS[49]#44393L, MS[50]#44394L, MS[51]#44395L, sum#44510L, sum#44511, sum#44512, count#44513L]
Arguments: hashpartitioning(segment#44277, processing_day#44279, 200), ENSURE_REQUIREMENTS, [plan_id=4185]
(16) HashAggregate
Input [59]: [segment#44277, processing_day#44279, count#44509L, MS[0]#44344L, MS[1]#44345L, MS[2]#44346L, MS[3]#44347L, MS[4]#44348L, MS[5]#44349L, MS[6]#44350L, MS[7]#44351L, MS[8]#44352L, MS[9]#44353L, MS[10]#44354L, MS[11]#44355L, MS[12]#44356L, MS[13]#44357L, MS[14]#44358L, MS[15]#44359L, MS[16]#44360L, MS[17]#44361L, MS[18]#44362L, MS[19]#44363L, MS[20]#44364L, MS[21]#44365L, MS[22]#44366L, MS[23]#44367L, MS[24]#44368L, MS[25]#44369L, MS[26]#44370L, MS[27]#44371L, MS[28]#44372L, MS[29]#44373L, MS[30]#44374L, MS[31]#44375L, MS[32]#44376L, MS[33]#44377L, MS[34]#44378L, MS[35]#44379L, MS[36]#44380L, MS[37]#44381L, MS[38]#44382L, MS[39]#44383L, MS[40]#44384L, MS[41]#44385L, MS[42]#44386L, MS[43]#44387L, MS[44]#44388L, MS[45]#44389L, MS[46]#44390L, MS[47]#44391L, MS[48]#44392L, MS[49]#44393L, MS[50]#44394L, MS[51]#44395L, sum#44510L, sum#44511, sum#44512, count#44513L]
Keys [2]: [segment#44277, processing_day#44279]
Functions [5]: [count(1), approx_count_distinct(customer_id#44273L, 0.05, 0, 0), sum(events#44283), sum(weighted_amount#44285), avg(amount#44281)]
Aggregate Attributes [5]: [count(1)#44291L, approx_count_distinct(customer_id#44273L, 0.05, 0, 0)#44396L, sum(events#44283)#44397L, sum(weighted_amount#44285)#44398, avg(amount#44281)#44399]
Results [7]: [segment#44277, processing_day#44279, count(1)#44291L AS row_count#44286L, approx_count_distinct(customer_id#44273L, 0.05, 0, 0)#44396L AS unique_customers#44287L, sum(events#44283)#44397L AS event_sum#44288L, sum(weighted_amount#44285)#44398 AS weighted_amount_sum#44289, avg(amount#44281)#44399 AS avg_amount#44290]
(17) Exchange
Input [7]: [segment#44277, processing_day#44279, row_count#44286L, unique_customers#44287L, event_sum#44288L, weighted_amount_sum#44289, avg_amount#44290]
Arguments: rangepartitioning(segment#44277 ASC NULLS FIRST, processing_day#44279 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4188]
(18) Sort
Input [7]: [segment#44277, processing_day#44279, row_count#44286L, unique_customers#44287L, event_sum#44288L, weighted_amount_sum#44289, avg_amount#44290]
Arguments: [segment#44277 ASC NULLS FIRST, processing_day#44279 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#44277, processing_day#44279, row_count#44286L, unique_customers#44287L, event_sum#44288L, weighted_amount_sum#44289, avg_amount#44290]
Arguments: isFinalPlan=true