== 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#38933L]
Arguments: Range (20000000, 21000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#38933L % 250000) AS customer_id#38935L, concat(segment-, cast(cast((id#38933L % 12) as int) as string)) AS segment#38939, cast((id#38933L % 14) as int) AS processing_day#38941, ((cast(((id#38933L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#38943, cast((((id#38933L * 29) % 7) + 1) as int) AS events#38945]
Input [1]: [id#38933L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#38935L, segment#38939, processing_day#38941, amount#38943, events#38945, (amount#38943 * cast(events#38945 as double)) AS weighted_amount#38947]
Input [5]: [customer_id#38935L, segment#38939, processing_day#38941, amount#38943, events#38945]
(4) HashAggregate
Input [6]: [customer_id#38935L, segment#38939, processing_day#38941, amount#38943, events#38945, weighted_amount#38947]
Keys [2]: [segment#38939, processing_day#38941]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#38935L, 0.05, 0, 0), partial_sum(events#38945), partial_sum(weighted_amount#38947), partial_avg(amount#38943)]
Aggregate Attributes [57]: [count#39166L, MS[0]#38954L, MS[1]#38955L, MS[2]#38956L, MS[3]#38957L, MS[4]#38958L, MS[5]#38959L, MS[6]#38960L, MS[7]#38961L, MS[8]#38962L, MS[9]#38963L, MS[10]#38964L, MS[11]#38965L, MS[12]#38966L, MS[13]#38967L, MS[14]#38968L, MS[15]#38969L, MS[16]#38970L, MS[17]#38971L, MS[18]#38972L, MS[19]#38973L, MS[20]#38974L, MS[21]#38975L, MS[22]#38976L, MS[23]#38977L, MS[24]#38978L, MS[25]#38979L, MS[26]#38980L, MS[27]#38981L, MS[28]#38982L, MS[29]#38983L, MS[30]#38984L, MS[31]#38985L, MS[32]#38986L, MS[33]#38987L, MS[34]#38988L, MS[35]#38989L, MS[36]#38990L, MS[37]#38991L, MS[38]#38992L, MS[39]#38993L, MS[40]#38994L, MS[41]#38995L, MS[42]#38996L, MS[43]#38997L, MS[44]#38998L, MS[45]#38999L, MS[46]#39000L, MS[47]#39001L, MS[48]#39002L, MS[49]#39003L, MS[50]#39004L, MS[51]#39005L, sum#39167L, sum#39168, sum#39169, count#39170L]
Results [59]: [segment#38939, processing_day#38941, count#39171L, MS[0]#39006L, MS[1]#39007L, MS[2]#39008L, MS[3]#39009L, MS[4]#39010L, MS[5]#39011L, MS[6]#39012L, MS[7]#39013L, MS[8]#39014L, MS[9]#39015L, MS[10]#39016L, MS[11]#39017L, MS[12]#39018L, MS[13]#39019L, MS[14]#39020L, MS[15]#39021L, MS[16]#39022L, MS[17]#39023L, MS[18]#39024L, MS[19]#39025L, MS[20]#39026L, MS[21]#39027L, MS[22]#39028L, MS[23]#39029L, MS[24]#39030L, MS[25]#39031L, MS[26]#39032L, MS[27]#39033L, MS[28]#39034L, MS[29]#39035L, MS[30]#39036L, MS[31]#39037L, MS[32]#39038L, MS[33]#39039L, MS[34]#39040L, MS[35]#39041L, MS[36]#39042L, MS[37]#39043L, MS[38]#39044L, MS[39]#39045L, MS[40]#39046L, MS[41]#39047L, MS[42]#39048L, MS[43]#39049L, MS[44]#39050L, MS[45]#39051L, MS[46]#39052L, MS[47]#39053L, MS[48]#39054L, MS[49]#39055L, MS[50]#39056L, MS[51]#39057L, sum#39172L, sum#39173, sum#39174, count#39175L]
(5) Exchange
Input [59]: [segment#38939, processing_day#38941, count#39171L, MS[0]#39006L, MS[1]#39007L, MS[2]#39008L, MS[3]#39009L, MS[4]#39010L, MS[5]#39011L, MS[6]#39012L, MS[7]#39013L, MS[8]#39014L, MS[9]#39015L, MS[10]#39016L, MS[11]#39017L, MS[12]#39018L, MS[13]#39019L, MS[14]#39020L, MS[15]#39021L, MS[16]#39022L, MS[17]#39023L, MS[18]#39024L, MS[19]#39025L, MS[20]#39026L, MS[21]#39027L, MS[22]#39028L, MS[23]#39029L, MS[24]#39030L, MS[25]#39031L, MS[26]#39032L, MS[27]#39033L, MS[28]#39034L, MS[29]#39035L, MS[30]#39036L, MS[31]#39037L, MS[32]#39038L, MS[33]#39039L, MS[34]#39040L, MS[35]#39041L, MS[36]#39042L, MS[37]#39043L, MS[38]#39044L, MS[39]#39045L, MS[40]#39046L, MS[41]#39047L, MS[42]#39048L, MS[43]#39049L, MS[44]#39050L, MS[45]#39051L, MS[46]#39052L, MS[47]#39053L, MS[48]#39054L, MS[49]#39055L, MS[50]#39056L, MS[51]#39057L, sum#39172L, sum#39173, sum#39174, count#39175L]
Arguments: hashpartitioning(segment#38939, processing_day#38941, 200), ENSURE_REQUIREMENTS, [plan_id=3701]
(6) ShuffleQueryStage
Output [59]: [segment#38939, processing_day#38941, count#39171L, MS[0]#39006L, MS[1]#39007L, MS[2]#39008L, MS[3]#39009L, MS[4]#39010L, MS[5]#39011L, MS[6]#39012L, MS[7]#39013L, MS[8]#39014L, MS[9]#39015L, MS[10]#39016L, MS[11]#39017L, MS[12]#39018L, MS[13]#39019L, MS[14]#39020L, MS[15]#39021L, MS[16]#39022L, MS[17]#39023L, MS[18]#39024L, MS[19]#39025L, MS[20]#39026L, MS[21]#39027L, MS[22]#39028L, MS[23]#39029L, MS[24]#39030L, MS[25]#39031L, MS[26]#39032L, MS[27]#39033L, MS[28]#39034L, MS[29]#39035L, MS[30]#39036L, MS[31]#39037L, MS[32]#39038L, MS[33]#39039L, MS[34]#39040L, MS[35]#39041L, MS[36]#39042L, MS[37]#39043L, MS[38]#39044L, MS[39]#39045L, MS[40]#39046L, MS[41]#39047L, MS[42]#39048L, MS[43]#39049L, MS[44]#39050L, MS[45]#39051L, MS[46]#39052L, MS[47]#39053L, MS[48]#39054L, MS[49]#39055L, MS[50]#39056L, MS[51]#39057L, sum#39172L, sum#39173, sum#39174, count#39175L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#38939, processing_day#38941, count#39171L, MS[0]#39006L, MS[1]#39007L, MS[2]#39008L, MS[3]#39009L, MS[4]#39010L, MS[5]#39011L, MS[6]#39012L, MS[7]#39013L, MS[8]#39014L, MS[9]#39015L, MS[10]#39016L, MS[11]#39017L, MS[12]#39018L, MS[13]#39019L, MS[14]#39020L, MS[15]#39021L, MS[16]#39022L, MS[17]#39023L, MS[18]#39024L, MS[19]#39025L, MS[20]#39026L, MS[21]#39027L, MS[22]#39028L, MS[23]#39029L, MS[24]#39030L, MS[25]#39031L, MS[26]#39032L, MS[27]#39033L, MS[28]#39034L, MS[29]#39035L, MS[30]#39036L, MS[31]#39037L, MS[32]#39038L, MS[33]#39039L, MS[34]#39040L, MS[35]#39041L, MS[36]#39042L, MS[37]#39043L, MS[38]#39044L, MS[39]#39045L, MS[40]#39046L, MS[41]#39047L, MS[42]#39048L, MS[43]#39049L, MS[44]#39050L, MS[45]#39051L, MS[46]#39052L, MS[47]#39053L, MS[48]#39054L, MS[49]#39055L, MS[50]#39056L, MS[51]#39057L, sum#39172L, sum#39173, sum#39174, count#39175L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#38939, processing_day#38941, count#39171L, MS[0]#39006L, MS[1]#39007L, MS[2]#39008L, MS[3]#39009L, MS[4]#39010L, MS[5]#39011L, MS[6]#39012L, MS[7]#39013L, MS[8]#39014L, MS[9]#39015L, MS[10]#39016L, MS[11]#39017L, MS[12]#39018L, MS[13]#39019L, MS[14]#39020L, MS[15]#39021L, MS[16]#39022L, MS[17]#39023L, MS[18]#39024L, MS[19]#39025L, MS[20]#39026L, MS[21]#39027L, MS[22]#39028L, MS[23]#39029L, MS[24]#39030L, MS[25]#39031L, MS[26]#39032L, MS[27]#39033L, MS[28]#39034L, MS[29]#39035L, MS[30]#39036L, MS[31]#39037L, MS[32]#39038L, MS[33]#39039L, MS[34]#39040L, MS[35]#39041L, MS[36]#39042L, MS[37]#39043L, MS[38]#39044L, MS[39]#39045L, MS[40]#39046L, MS[41]#39047L, MS[42]#39048L, MS[43]#39049L, MS[44]#39050L, MS[45]#39051L, MS[46]#39052L, MS[47]#39053L, MS[48]#39054L, MS[49]#39055L, MS[50]#39056L, MS[51]#39057L, sum#39172L, sum#39173, sum#39174, count#39175L]
Keys [2]: [segment#38939, processing_day#38941]
Functions [5]: [count(1), approx_count_distinct(customer_id#38935L, 0.05, 0, 0), sum(events#38945), sum(weighted_amount#38947), avg(amount#38943)]
Aggregate Attributes [5]: [count(1)#38953L, approx_count_distinct(customer_id#38935L, 0.05, 0, 0)#39058L, sum(events#38945)#39059L, sum(weighted_amount#38947)#39060, avg(amount#38943)#39061]
Results [7]: [segment#38939, processing_day#38941, count(1)#38953L AS row_count#38948L, approx_count_distinct(customer_id#38935L, 0.05, 0, 0)#39058L AS unique_customers#38949L, sum(events#38945)#39059L AS event_sum#38950L, sum(weighted_amount#38947)#39060 AS weighted_amount_sum#38951, avg(amount#38943)#39061 AS avg_amount#38952]
(9) Exchange
Input [7]: [segment#38939, processing_day#38941, row_count#38948L, unique_customers#38949L, event_sum#38950L, weighted_amount_sum#38951, avg_amount#38952]
Arguments: rangepartitioning(segment#38939 ASC NULLS FIRST, processing_day#38941 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3723]
(10) ShuffleQueryStage
Output [7]: [segment#38939, processing_day#38941, row_count#38948L, unique_customers#38949L, event_sum#38950L, weighted_amount_sum#38951, avg_amount#38952]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#38939, processing_day#38941, row_count#38948L, unique_customers#38949L, event_sum#38950L, weighted_amount_sum#38951, avg_amount#38952]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#38939, processing_day#38941, row_count#38948L, unique_customers#38949L, event_sum#38950L, weighted_amount_sum#38951, avg_amount#38952]
Arguments: [segment#38939 ASC NULLS FIRST, processing_day#38941 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#38939, processing_day#38941, row_count#38948L, unique_customers#38949L, event_sum#38950L, weighted_amount_sum#38951, avg_amount#38952]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#38935L, segment#38939, processing_day#38941, amount#38943, events#38945, weighted_amount#38947]
Keys [2]: [segment#38939, processing_day#38941]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#38935L, 0.05, 0, 0), partial_sum(events#38945), partial_sum(weighted_amount#38947), partial_avg(amount#38943)]
Aggregate Attributes [57]: [count#39166L, MS[0]#38954L, MS[1]#38955L, MS[2]#38956L, MS[3]#38957L, MS[4]#38958L, MS[5]#38959L, MS[6]#38960L, MS[7]#38961L, MS[8]#38962L, MS[9]#38963L, MS[10]#38964L, MS[11]#38965L, MS[12]#38966L, MS[13]#38967L, MS[14]#38968L, MS[15]#38969L, MS[16]#38970L, MS[17]#38971L, MS[18]#38972L, MS[19]#38973L, MS[20]#38974L, MS[21]#38975L, MS[22]#38976L, MS[23]#38977L, MS[24]#38978L, MS[25]#38979L, MS[26]#38980L, MS[27]#38981L, MS[28]#38982L, MS[29]#38983L, MS[30]#38984L, MS[31]#38985L, MS[32]#38986L, MS[33]#38987L, MS[34]#38988L, MS[35]#38989L, MS[36]#38990L, MS[37]#38991L, MS[38]#38992L, MS[39]#38993L, MS[40]#38994L, MS[41]#38995L, MS[42]#38996L, MS[43]#38997L, MS[44]#38998L, MS[45]#38999L, MS[46]#39000L, MS[47]#39001L, MS[48]#39002L, MS[49]#39003L, MS[50]#39004L, MS[51]#39005L, sum#39167L, sum#39168, sum#39169, count#39170L]
Results [59]: [segment#38939, processing_day#38941, count#39171L, MS[0]#39006L, MS[1]#39007L, MS[2]#39008L, MS[3]#39009L, MS[4]#39010L, MS[5]#39011L, MS[6]#39012L, MS[7]#39013L, MS[8]#39014L, MS[9]#39015L, MS[10]#39016L, MS[11]#39017L, MS[12]#39018L, MS[13]#39019L, MS[14]#39020L, MS[15]#39021L, MS[16]#39022L, MS[17]#39023L, MS[18]#39024L, MS[19]#39025L, MS[20]#39026L, MS[21]#39027L, MS[22]#39028L, MS[23]#39029L, MS[24]#39030L, MS[25]#39031L, MS[26]#39032L, MS[27]#39033L, MS[28]#39034L, MS[29]#39035L, MS[30]#39036L, MS[31]#39037L, MS[32]#39038L, MS[33]#39039L, MS[34]#39040L, MS[35]#39041L, MS[36]#39042L, MS[37]#39043L, MS[38]#39044L, MS[39]#39045L, MS[40]#39046L, MS[41]#39047L, MS[42]#39048L, MS[43]#39049L, MS[44]#39050L, MS[45]#39051L, MS[46]#39052L, MS[47]#39053L, MS[48]#39054L, MS[49]#39055L, MS[50]#39056L, MS[51]#39057L, sum#39172L, sum#39173, sum#39174, count#39175L]
(15) Exchange
Input [59]: [segment#38939, processing_day#38941, count#39171L, MS[0]#39006L, MS[1]#39007L, MS[2]#39008L, MS[3]#39009L, MS[4]#39010L, MS[5]#39011L, MS[6]#39012L, MS[7]#39013L, MS[8]#39014L, MS[9]#39015L, MS[10]#39016L, MS[11]#39017L, MS[12]#39018L, MS[13]#39019L, MS[14]#39020L, MS[15]#39021L, MS[16]#39022L, MS[17]#39023L, MS[18]#39024L, MS[19]#39025L, MS[20]#39026L, MS[21]#39027L, MS[22]#39028L, MS[23]#39029L, MS[24]#39030L, MS[25]#39031L, MS[26]#39032L, MS[27]#39033L, MS[28]#39034L, MS[29]#39035L, MS[30]#39036L, MS[31]#39037L, MS[32]#39038L, MS[33]#39039L, MS[34]#39040L, MS[35]#39041L, MS[36]#39042L, MS[37]#39043L, MS[38]#39044L, MS[39]#39045L, MS[40]#39046L, MS[41]#39047L, MS[42]#39048L, MS[43]#39049L, MS[44]#39050L, MS[45]#39051L, MS[46]#39052L, MS[47]#39053L, MS[48]#39054L, MS[49]#39055L, MS[50]#39056L, MS[51]#39057L, sum#39172L, sum#39173, sum#39174, count#39175L]
Arguments: hashpartitioning(segment#38939, processing_day#38941, 200), ENSURE_REQUIREMENTS, [plan_id=3681]
(16) HashAggregate
Input [59]: [segment#38939, processing_day#38941, count#39171L, MS[0]#39006L, MS[1]#39007L, MS[2]#39008L, MS[3]#39009L, MS[4]#39010L, MS[5]#39011L, MS[6]#39012L, MS[7]#39013L, MS[8]#39014L, MS[9]#39015L, MS[10]#39016L, MS[11]#39017L, MS[12]#39018L, MS[13]#39019L, MS[14]#39020L, MS[15]#39021L, MS[16]#39022L, MS[17]#39023L, MS[18]#39024L, MS[19]#39025L, MS[20]#39026L, MS[21]#39027L, MS[22]#39028L, MS[23]#39029L, MS[24]#39030L, MS[25]#39031L, MS[26]#39032L, MS[27]#39033L, MS[28]#39034L, MS[29]#39035L, MS[30]#39036L, MS[31]#39037L, MS[32]#39038L, MS[33]#39039L, MS[34]#39040L, MS[35]#39041L, MS[36]#39042L, MS[37]#39043L, MS[38]#39044L, MS[39]#39045L, MS[40]#39046L, MS[41]#39047L, MS[42]#39048L, MS[43]#39049L, MS[44]#39050L, MS[45]#39051L, MS[46]#39052L, MS[47]#39053L, MS[48]#39054L, MS[49]#39055L, MS[50]#39056L, MS[51]#39057L, sum#39172L, sum#39173, sum#39174, count#39175L]
Keys [2]: [segment#38939, processing_day#38941]
Functions [5]: [count(1), approx_count_distinct(customer_id#38935L, 0.05, 0, 0), sum(events#38945), sum(weighted_amount#38947), avg(amount#38943)]
Aggregate Attributes [5]: [count(1)#38953L, approx_count_distinct(customer_id#38935L, 0.05, 0, 0)#39058L, sum(events#38945)#39059L, sum(weighted_amount#38947)#39060, avg(amount#38943)#39061]
Results [7]: [segment#38939, processing_day#38941, count(1)#38953L AS row_count#38948L, approx_count_distinct(customer_id#38935L, 0.05, 0, 0)#39058L AS unique_customers#38949L, sum(events#38945)#39059L AS event_sum#38950L, sum(weighted_amount#38947)#39060 AS weighted_amount_sum#38951, avg(amount#38943)#39061 AS avg_amount#38952]
(17) Exchange
Input [7]: [segment#38939, processing_day#38941, row_count#38948L, unique_customers#38949L, event_sum#38950L, weighted_amount_sum#38951, avg_amount#38952]
Arguments: rangepartitioning(segment#38939 ASC NULLS FIRST, processing_day#38941 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3684]
(18) Sort
Input [7]: [segment#38939, processing_day#38941, row_count#38948L, unique_customers#38949L, event_sum#38950L, weighted_amount_sum#38951, avg_amount#38952]
Arguments: [segment#38939 ASC NULLS FIRST, processing_day#38941 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#38939, processing_day#38941, row_count#38948L, unique_customers#38949L, event_sum#38950L, weighted_amount_sum#38951, avg_amount#38952]
Arguments: isFinalPlan=true