== 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#30977L]
Arguments: Range (11000000, 12000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#30977L % 250000) AS customer_id#30979L, concat(segment-, cast(cast((id#30977L % 12) as int) as string)) AS segment#30983, cast((id#30977L % 14) as int) AS processing_day#30985, ((cast(((id#30977L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#30987, cast((((id#30977L * 29) % 7) + 1) as int) AS events#30989]
Input [1]: [id#30977L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#30979L, segment#30983, processing_day#30985, amount#30987, events#30989, (amount#30987 * cast(events#30989 as double)) AS weighted_amount#30991]
Input [5]: [customer_id#30979L, segment#30983, processing_day#30985, amount#30987, events#30989]
(4) HashAggregate
Input [6]: [customer_id#30979L, segment#30983, processing_day#30985, amount#30987, events#30989, weighted_amount#30991]
Keys [2]: [segment#30983, processing_day#30985]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#30979L, 0.05, 0, 0), partial_sum(events#30989), partial_sum(weighted_amount#30991), partial_avg(amount#30987)]
Aggregate Attributes [57]: [count#31210L, MS[0]#30998L, MS[1]#30999L, MS[2]#31000L, MS[3]#31001L, MS[4]#31002L, MS[5]#31003L, MS[6]#31004L, MS[7]#31005L, MS[8]#31006L, MS[9]#31007L, MS[10]#31008L, MS[11]#31009L, MS[12]#31010L, MS[13]#31011L, MS[14]#31012L, MS[15]#31013L, MS[16]#31014L, MS[17]#31015L, MS[18]#31016L, MS[19]#31017L, MS[20]#31018L, MS[21]#31019L, MS[22]#31020L, MS[23]#31021L, MS[24]#31022L, MS[25]#31023L, MS[26]#31024L, MS[27]#31025L, MS[28]#31026L, MS[29]#31027L, MS[30]#31028L, MS[31]#31029L, MS[32]#31030L, MS[33]#31031L, MS[34]#31032L, MS[35]#31033L, MS[36]#31034L, MS[37]#31035L, MS[38]#31036L, MS[39]#31037L, MS[40]#31038L, MS[41]#31039L, MS[42]#31040L, MS[43]#31041L, MS[44]#31042L, MS[45]#31043L, MS[46]#31044L, MS[47]#31045L, MS[48]#31046L, MS[49]#31047L, MS[50]#31048L, MS[51]#31049L, sum#31211L, sum#31212, sum#31213, count#31214L]
Results [59]: [segment#30983, processing_day#30985, count#31215L, MS[0]#31050L, MS[1]#31051L, MS[2]#31052L, MS[3]#31053L, MS[4]#31054L, MS[5]#31055L, MS[6]#31056L, MS[7]#31057L, MS[8]#31058L, MS[9]#31059L, MS[10]#31060L, MS[11]#31061L, MS[12]#31062L, MS[13]#31063L, MS[14]#31064L, MS[15]#31065L, MS[16]#31066L, MS[17]#31067L, MS[18]#31068L, MS[19]#31069L, MS[20]#31070L, MS[21]#31071L, MS[22]#31072L, MS[23]#31073L, MS[24]#31074L, MS[25]#31075L, MS[26]#31076L, MS[27]#31077L, MS[28]#31078L, MS[29]#31079L, MS[30]#31080L, MS[31]#31081L, MS[32]#31082L, MS[33]#31083L, MS[34]#31084L, MS[35]#31085L, MS[36]#31086L, MS[37]#31087L, MS[38]#31088L, MS[39]#31089L, MS[40]#31090L, MS[41]#31091L, MS[42]#31092L, MS[43]#31093L, MS[44]#31094L, MS[45]#31095L, MS[46]#31096L, MS[47]#31097L, MS[48]#31098L, MS[49]#31099L, MS[50]#31100L, MS[51]#31101L, sum#31216L, sum#31217, sum#31218, count#31219L]
(5) Exchange
Input [59]: [segment#30983, processing_day#30985, count#31215L, MS[0]#31050L, MS[1]#31051L, MS[2]#31052L, MS[3]#31053L, MS[4]#31054L, MS[5]#31055L, MS[6]#31056L, MS[7]#31057L, MS[8]#31058L, MS[9]#31059L, MS[10]#31060L, MS[11]#31061L, MS[12]#31062L, MS[13]#31063L, MS[14]#31064L, MS[15]#31065L, MS[16]#31066L, MS[17]#31067L, MS[18]#31068L, MS[19]#31069L, MS[20]#31070L, MS[21]#31071L, MS[22]#31072L, MS[23]#31073L, MS[24]#31074L, MS[25]#31075L, MS[26]#31076L, MS[27]#31077L, MS[28]#31078L, MS[29]#31079L, MS[30]#31080L, MS[31]#31081L, MS[32]#31082L, MS[33]#31083L, MS[34]#31084L, MS[35]#31085L, MS[36]#31086L, MS[37]#31087L, MS[38]#31088L, MS[39]#31089L, MS[40]#31090L, MS[41]#31091L, MS[42]#31092L, MS[43]#31093L, MS[44]#31094L, MS[45]#31095L, MS[46]#31096L, MS[47]#31097L, MS[48]#31098L, MS[49]#31099L, MS[50]#31100L, MS[51]#31101L, sum#31216L, sum#31217, sum#31218, count#31219L]
Arguments: hashpartitioning(segment#30983, processing_day#30985, 200), ENSURE_REQUIREMENTS, [plan_id=2954]
(6) ShuffleQueryStage
Output [59]: [segment#30983, processing_day#30985, count#31215L, MS[0]#31050L, MS[1]#31051L, MS[2]#31052L, MS[3]#31053L, MS[4]#31054L, MS[5]#31055L, MS[6]#31056L, MS[7]#31057L, MS[8]#31058L, MS[9]#31059L, MS[10]#31060L, MS[11]#31061L, MS[12]#31062L, MS[13]#31063L, MS[14]#31064L, MS[15]#31065L, MS[16]#31066L, MS[17]#31067L, MS[18]#31068L, MS[19]#31069L, MS[20]#31070L, MS[21]#31071L, MS[22]#31072L, MS[23]#31073L, MS[24]#31074L, MS[25]#31075L, MS[26]#31076L, MS[27]#31077L, MS[28]#31078L, MS[29]#31079L, MS[30]#31080L, MS[31]#31081L, MS[32]#31082L, MS[33]#31083L, MS[34]#31084L, MS[35]#31085L, MS[36]#31086L, MS[37]#31087L, MS[38]#31088L, MS[39]#31089L, MS[40]#31090L, MS[41]#31091L, MS[42]#31092L, MS[43]#31093L, MS[44]#31094L, MS[45]#31095L, MS[46]#31096L, MS[47]#31097L, MS[48]#31098L, MS[49]#31099L, MS[50]#31100L, MS[51]#31101L, sum#31216L, sum#31217, sum#31218, count#31219L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#30983, processing_day#30985, count#31215L, MS[0]#31050L, MS[1]#31051L, MS[2]#31052L, MS[3]#31053L, MS[4]#31054L, MS[5]#31055L, MS[6]#31056L, MS[7]#31057L, MS[8]#31058L, MS[9]#31059L, MS[10]#31060L, MS[11]#31061L, MS[12]#31062L, MS[13]#31063L, MS[14]#31064L, MS[15]#31065L, MS[16]#31066L, MS[17]#31067L, MS[18]#31068L, MS[19]#31069L, MS[20]#31070L, MS[21]#31071L, MS[22]#31072L, MS[23]#31073L, MS[24]#31074L, MS[25]#31075L, MS[26]#31076L, MS[27]#31077L, MS[28]#31078L, MS[29]#31079L, MS[30]#31080L, MS[31]#31081L, MS[32]#31082L, MS[33]#31083L, MS[34]#31084L, MS[35]#31085L, MS[36]#31086L, MS[37]#31087L, MS[38]#31088L, MS[39]#31089L, MS[40]#31090L, MS[41]#31091L, MS[42]#31092L, MS[43]#31093L, MS[44]#31094L, MS[45]#31095L, MS[46]#31096L, MS[47]#31097L, MS[48]#31098L, MS[49]#31099L, MS[50]#31100L, MS[51]#31101L, sum#31216L, sum#31217, sum#31218, count#31219L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#30983, processing_day#30985, count#31215L, MS[0]#31050L, MS[1]#31051L, MS[2]#31052L, MS[3]#31053L, MS[4]#31054L, MS[5]#31055L, MS[6]#31056L, MS[7]#31057L, MS[8]#31058L, MS[9]#31059L, MS[10]#31060L, MS[11]#31061L, MS[12]#31062L, MS[13]#31063L, MS[14]#31064L, MS[15]#31065L, MS[16]#31066L, MS[17]#31067L, MS[18]#31068L, MS[19]#31069L, MS[20]#31070L, MS[21]#31071L, MS[22]#31072L, MS[23]#31073L, MS[24]#31074L, MS[25]#31075L, MS[26]#31076L, MS[27]#31077L, MS[28]#31078L, MS[29]#31079L, MS[30]#31080L, MS[31]#31081L, MS[32]#31082L, MS[33]#31083L, MS[34]#31084L, MS[35]#31085L, MS[36]#31086L, MS[37]#31087L, MS[38]#31088L, MS[39]#31089L, MS[40]#31090L, MS[41]#31091L, MS[42]#31092L, MS[43]#31093L, MS[44]#31094L, MS[45]#31095L, MS[46]#31096L, MS[47]#31097L, MS[48]#31098L, MS[49]#31099L, MS[50]#31100L, MS[51]#31101L, sum#31216L, sum#31217, sum#31218, count#31219L]
Keys [2]: [segment#30983, processing_day#30985]
Functions [5]: [count(1), approx_count_distinct(customer_id#30979L, 0.05, 0, 0), sum(events#30989), sum(weighted_amount#30991), avg(amount#30987)]
Aggregate Attributes [5]: [count(1)#30997L, approx_count_distinct(customer_id#30979L, 0.05, 0, 0)#31102L, sum(events#30989)#31103L, sum(weighted_amount#30991)#31104, avg(amount#30987)#31105]
Results [7]: [segment#30983, processing_day#30985, count(1)#30997L AS row_count#30992L, approx_count_distinct(customer_id#30979L, 0.05, 0, 0)#31102L AS unique_customers#30993L, sum(events#30989)#31103L AS event_sum#30994L, sum(weighted_amount#30991)#31104 AS weighted_amount_sum#30995, avg(amount#30987)#31105 AS avg_amount#30996]
(9) Exchange
Input [7]: [segment#30983, processing_day#30985, row_count#30992L, unique_customers#30993L, event_sum#30994L, weighted_amount_sum#30995, avg_amount#30996]
Arguments: rangepartitioning(segment#30983 ASC NULLS FIRST, processing_day#30985 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2976]
(10) ShuffleQueryStage
Output [7]: [segment#30983, processing_day#30985, row_count#30992L, unique_customers#30993L, event_sum#30994L, weighted_amount_sum#30995, avg_amount#30996]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#30983, processing_day#30985, row_count#30992L, unique_customers#30993L, event_sum#30994L, weighted_amount_sum#30995, avg_amount#30996]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#30983, processing_day#30985, row_count#30992L, unique_customers#30993L, event_sum#30994L, weighted_amount_sum#30995, avg_amount#30996]
Arguments: [segment#30983 ASC NULLS FIRST, processing_day#30985 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#30983, processing_day#30985, row_count#30992L, unique_customers#30993L, event_sum#30994L, weighted_amount_sum#30995, avg_amount#30996]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#30979L, segment#30983, processing_day#30985, amount#30987, events#30989, weighted_amount#30991]
Keys [2]: [segment#30983, processing_day#30985]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#30979L, 0.05, 0, 0), partial_sum(events#30989), partial_sum(weighted_amount#30991), partial_avg(amount#30987)]
Aggregate Attributes [57]: [count#31210L, MS[0]#30998L, MS[1]#30999L, MS[2]#31000L, MS[3]#31001L, MS[4]#31002L, MS[5]#31003L, MS[6]#31004L, MS[7]#31005L, MS[8]#31006L, MS[9]#31007L, MS[10]#31008L, MS[11]#31009L, MS[12]#31010L, MS[13]#31011L, MS[14]#31012L, MS[15]#31013L, MS[16]#31014L, MS[17]#31015L, MS[18]#31016L, MS[19]#31017L, MS[20]#31018L, MS[21]#31019L, MS[22]#31020L, MS[23]#31021L, MS[24]#31022L, MS[25]#31023L, MS[26]#31024L, MS[27]#31025L, MS[28]#31026L, MS[29]#31027L, MS[30]#31028L, MS[31]#31029L, MS[32]#31030L, MS[33]#31031L, MS[34]#31032L, MS[35]#31033L, MS[36]#31034L, MS[37]#31035L, MS[38]#31036L, MS[39]#31037L, MS[40]#31038L, MS[41]#31039L, MS[42]#31040L, MS[43]#31041L, MS[44]#31042L, MS[45]#31043L, MS[46]#31044L, MS[47]#31045L, MS[48]#31046L, MS[49]#31047L, MS[50]#31048L, MS[51]#31049L, sum#31211L, sum#31212, sum#31213, count#31214L]
Results [59]: [segment#30983, processing_day#30985, count#31215L, MS[0]#31050L, MS[1]#31051L, MS[2]#31052L, MS[3]#31053L, MS[4]#31054L, MS[5]#31055L, MS[6]#31056L, MS[7]#31057L, MS[8]#31058L, MS[9]#31059L, MS[10]#31060L, MS[11]#31061L, MS[12]#31062L, MS[13]#31063L, MS[14]#31064L, MS[15]#31065L, MS[16]#31066L, MS[17]#31067L, MS[18]#31068L, MS[19]#31069L, MS[20]#31070L, MS[21]#31071L, MS[22]#31072L, MS[23]#31073L, MS[24]#31074L, MS[25]#31075L, MS[26]#31076L, MS[27]#31077L, MS[28]#31078L, MS[29]#31079L, MS[30]#31080L, MS[31]#31081L, MS[32]#31082L, MS[33]#31083L, MS[34]#31084L, MS[35]#31085L, MS[36]#31086L, MS[37]#31087L, MS[38]#31088L, MS[39]#31089L, MS[40]#31090L, MS[41]#31091L, MS[42]#31092L, MS[43]#31093L, MS[44]#31094L, MS[45]#31095L, MS[46]#31096L, MS[47]#31097L, MS[48]#31098L, MS[49]#31099L, MS[50]#31100L, MS[51]#31101L, sum#31216L, sum#31217, sum#31218, count#31219L]
(15) Exchange
Input [59]: [segment#30983, processing_day#30985, count#31215L, MS[0]#31050L, MS[1]#31051L, MS[2]#31052L, MS[3]#31053L, MS[4]#31054L, MS[5]#31055L, MS[6]#31056L, MS[7]#31057L, MS[8]#31058L, MS[9]#31059L, MS[10]#31060L, MS[11]#31061L, MS[12]#31062L, MS[13]#31063L, MS[14]#31064L, MS[15]#31065L, MS[16]#31066L, MS[17]#31067L, MS[18]#31068L, MS[19]#31069L, MS[20]#31070L, MS[21]#31071L, MS[22]#31072L, MS[23]#31073L, MS[24]#31074L, MS[25]#31075L, MS[26]#31076L, MS[27]#31077L, MS[28]#31078L, MS[29]#31079L, MS[30]#31080L, MS[31]#31081L, MS[32]#31082L, MS[33]#31083L, MS[34]#31084L, MS[35]#31085L, MS[36]#31086L, MS[37]#31087L, MS[38]#31088L, MS[39]#31089L, MS[40]#31090L, MS[41]#31091L, MS[42]#31092L, MS[43]#31093L, MS[44]#31094L, MS[45]#31095L, MS[46]#31096L, MS[47]#31097L, MS[48]#31098L, MS[49]#31099L, MS[50]#31100L, MS[51]#31101L, sum#31216L, sum#31217, sum#31218, count#31219L]
Arguments: hashpartitioning(segment#30983, processing_day#30985, 200), ENSURE_REQUIREMENTS, [plan_id=2934]
(16) HashAggregate
Input [59]: [segment#30983, processing_day#30985, count#31215L, MS[0]#31050L, MS[1]#31051L, MS[2]#31052L, MS[3]#31053L, MS[4]#31054L, MS[5]#31055L, MS[6]#31056L, MS[7]#31057L, MS[8]#31058L, MS[9]#31059L, MS[10]#31060L, MS[11]#31061L, MS[12]#31062L, MS[13]#31063L, MS[14]#31064L, MS[15]#31065L, MS[16]#31066L, MS[17]#31067L, MS[18]#31068L, MS[19]#31069L, MS[20]#31070L, MS[21]#31071L, MS[22]#31072L, MS[23]#31073L, MS[24]#31074L, MS[25]#31075L, MS[26]#31076L, MS[27]#31077L, MS[28]#31078L, MS[29]#31079L, MS[30]#31080L, MS[31]#31081L, MS[32]#31082L, MS[33]#31083L, MS[34]#31084L, MS[35]#31085L, MS[36]#31086L, MS[37]#31087L, MS[38]#31088L, MS[39]#31089L, MS[40]#31090L, MS[41]#31091L, MS[42]#31092L, MS[43]#31093L, MS[44]#31094L, MS[45]#31095L, MS[46]#31096L, MS[47]#31097L, MS[48]#31098L, MS[49]#31099L, MS[50]#31100L, MS[51]#31101L, sum#31216L, sum#31217, sum#31218, count#31219L]
Keys [2]: [segment#30983, processing_day#30985]
Functions [5]: [count(1), approx_count_distinct(customer_id#30979L, 0.05, 0, 0), sum(events#30989), sum(weighted_amount#30991), avg(amount#30987)]
Aggregate Attributes [5]: [count(1)#30997L, approx_count_distinct(customer_id#30979L, 0.05, 0, 0)#31102L, sum(events#30989)#31103L, sum(weighted_amount#30991)#31104, avg(amount#30987)#31105]
Results [7]: [segment#30983, processing_day#30985, count(1)#30997L AS row_count#30992L, approx_count_distinct(customer_id#30979L, 0.05, 0, 0)#31102L AS unique_customers#30993L, sum(events#30989)#31103L AS event_sum#30994L, sum(weighted_amount#30991)#31104 AS weighted_amount_sum#30995, avg(amount#30987)#31105 AS avg_amount#30996]
(17) Exchange
Input [7]: [segment#30983, processing_day#30985, row_count#30992L, unique_customers#30993L, event_sum#30994L, weighted_amount_sum#30995, avg_amount#30996]
Arguments: rangepartitioning(segment#30983 ASC NULLS FIRST, processing_day#30985 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2937]
(18) Sort
Input [7]: [segment#30983, processing_day#30985, row_count#30992L, unique_customers#30993L, event_sum#30994L, weighted_amount_sum#30995, avg_amount#30996]
Arguments: [segment#30983 ASC NULLS FIRST, processing_day#30985 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#30983, processing_day#30985, row_count#30992L, unique_customers#30993L, event_sum#30994L, weighted_amount_sum#30995, avg_amount#30996]
Arguments: isFinalPlan=true