== 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#8841L]
Arguments: Range (10000000, 11000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#8841L % 250000) AS customer_id#8843L, concat(segment-, cast(cast((id#8841L % 12) as int) as string)) AS segment#8847, cast((id#8841L % 14) as int) AS processing_day#8849, ((cast(((id#8841L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#8851, cast((((id#8841L * 29) % 7) + 1) as int) AS events#8853]
Input [1]: [id#8841L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#8843L, segment#8847, processing_day#8849, amount#8851, events#8853, (amount#8851 * cast(events#8853 as double)) AS weighted_amount#8855]
Input [5]: [customer_id#8843L, segment#8847, processing_day#8849, amount#8851, events#8853]
(4) HashAggregate
Input [6]: [customer_id#8843L, segment#8847, processing_day#8849, amount#8851, events#8853, weighted_amount#8855]
Keys [2]: [segment#8847, processing_day#8849]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#8843L, 0.05, 0, 0), partial_sum(events#8853), partial_sum(weighted_amount#8855), partial_avg(amount#8851)]
Aggregate Attributes [57]: [count#9074L, MS[0]#8862L, MS[1]#8863L, MS[2]#8864L, MS[3]#8865L, MS[4]#8866L, MS[5]#8867L, MS[6]#8868L, MS[7]#8869L, MS[8]#8870L, MS[9]#8871L, MS[10]#8872L, MS[11]#8873L, MS[12]#8874L, MS[13]#8875L, MS[14]#8876L, MS[15]#8877L, MS[16]#8878L, MS[17]#8879L, MS[18]#8880L, MS[19]#8881L, MS[20]#8882L, MS[21]#8883L, MS[22]#8884L, MS[23]#8885L, MS[24]#8886L, MS[25]#8887L, MS[26]#8888L, MS[27]#8889L, MS[28]#8890L, MS[29]#8891L, MS[30]#8892L, MS[31]#8893L, MS[32]#8894L, MS[33]#8895L, MS[34]#8896L, MS[35]#8897L, MS[36]#8898L, MS[37]#8899L, MS[38]#8900L, MS[39]#8901L, MS[40]#8902L, MS[41]#8903L, MS[42]#8904L, MS[43]#8905L, MS[44]#8906L, MS[45]#8907L, MS[46]#8908L, MS[47]#8909L, MS[48]#8910L, MS[49]#8911L, MS[50]#8912L, MS[51]#8913L, sum#9075L, sum#9076, sum#9077, count#9078L]
Results [59]: [segment#8847, processing_day#8849, count#9079L, MS[0]#8914L, MS[1]#8915L, MS[2]#8916L, MS[3]#8917L, MS[4]#8918L, MS[5]#8919L, MS[6]#8920L, MS[7]#8921L, MS[8]#8922L, MS[9]#8923L, MS[10]#8924L, MS[11]#8925L, MS[12]#8926L, MS[13]#8927L, MS[14]#8928L, MS[15]#8929L, MS[16]#8930L, MS[17]#8931L, MS[18]#8932L, MS[19]#8933L, MS[20]#8934L, MS[21]#8935L, MS[22]#8936L, MS[23]#8937L, MS[24]#8938L, MS[25]#8939L, MS[26]#8940L, MS[27]#8941L, MS[28]#8942L, MS[29]#8943L, MS[30]#8944L, MS[31]#8945L, MS[32]#8946L, MS[33]#8947L, MS[34]#8948L, MS[35]#8949L, MS[36]#8950L, MS[37]#8951L, MS[38]#8952L, MS[39]#8953L, MS[40]#8954L, MS[41]#8955L, MS[42]#8956L, MS[43]#8957L, MS[44]#8958L, MS[45]#8959L, MS[46]#8960L, MS[47]#8961L, MS[48]#8962L, MS[49]#8963L, MS[50]#8964L, MS[51]#8965L, sum#9080L, sum#9081, sum#9082, count#9083L]
(5) Exchange
Input [59]: [segment#8847, processing_day#8849, count#9079L, MS[0]#8914L, MS[1]#8915L, MS[2]#8916L, MS[3]#8917L, MS[4]#8918L, MS[5]#8919L, MS[6]#8920L, MS[7]#8921L, MS[8]#8922L, MS[9]#8923L, MS[10]#8924L, MS[11]#8925L, MS[12]#8926L, MS[13]#8927L, MS[14]#8928L, MS[15]#8929L, MS[16]#8930L, MS[17]#8931L, MS[18]#8932L, MS[19]#8933L, MS[20]#8934L, MS[21]#8935L, MS[22]#8936L, MS[23]#8937L, MS[24]#8938L, MS[25]#8939L, MS[26]#8940L, MS[27]#8941L, MS[28]#8942L, MS[29]#8943L, MS[30]#8944L, MS[31]#8945L, MS[32]#8946L, MS[33]#8947L, MS[34]#8948L, MS[35]#8949L, MS[36]#8950L, MS[37]#8951L, MS[38]#8952L, MS[39]#8953L, MS[40]#8954L, MS[41]#8955L, MS[42]#8956L, MS[43]#8957L, MS[44]#8958L, MS[45]#8959L, MS[46]#8960L, MS[47]#8961L, MS[48]#8962L, MS[49]#8963L, MS[50]#8964L, MS[51]#8965L, sum#9080L, sum#9081, sum#9082, count#9083L]
Arguments: hashpartitioning(segment#8847, processing_day#8849, 200), ENSURE_REQUIREMENTS, [plan_id=873]
(6) ShuffleQueryStage
Output [59]: [segment#8847, processing_day#8849, count#9079L, MS[0]#8914L, MS[1]#8915L, MS[2]#8916L, MS[3]#8917L, MS[4]#8918L, MS[5]#8919L, MS[6]#8920L, MS[7]#8921L, MS[8]#8922L, MS[9]#8923L, MS[10]#8924L, MS[11]#8925L, MS[12]#8926L, MS[13]#8927L, MS[14]#8928L, MS[15]#8929L, MS[16]#8930L, MS[17]#8931L, MS[18]#8932L, MS[19]#8933L, MS[20]#8934L, MS[21]#8935L, MS[22]#8936L, MS[23]#8937L, MS[24]#8938L, MS[25]#8939L, MS[26]#8940L, MS[27]#8941L, MS[28]#8942L, MS[29]#8943L, MS[30]#8944L, MS[31]#8945L, MS[32]#8946L, MS[33]#8947L, MS[34]#8948L, MS[35]#8949L, MS[36]#8950L, MS[37]#8951L, MS[38]#8952L, MS[39]#8953L, MS[40]#8954L, MS[41]#8955L, MS[42]#8956L, MS[43]#8957L, MS[44]#8958L, MS[45]#8959L, MS[46]#8960L, MS[47]#8961L, MS[48]#8962L, MS[49]#8963L, MS[50]#8964L, MS[51]#8965L, sum#9080L, sum#9081, sum#9082, count#9083L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#8847, processing_day#8849, count#9079L, MS[0]#8914L, MS[1]#8915L, MS[2]#8916L, MS[3]#8917L, MS[4]#8918L, MS[5]#8919L, MS[6]#8920L, MS[7]#8921L, MS[8]#8922L, MS[9]#8923L, MS[10]#8924L, MS[11]#8925L, MS[12]#8926L, MS[13]#8927L, MS[14]#8928L, MS[15]#8929L, MS[16]#8930L, MS[17]#8931L, MS[18]#8932L, MS[19]#8933L, MS[20]#8934L, MS[21]#8935L, MS[22]#8936L, MS[23]#8937L, MS[24]#8938L, MS[25]#8939L, MS[26]#8940L, MS[27]#8941L, MS[28]#8942L, MS[29]#8943L, MS[30]#8944L, MS[31]#8945L, MS[32]#8946L, MS[33]#8947L, MS[34]#8948L, MS[35]#8949L, MS[36]#8950L, MS[37]#8951L, MS[38]#8952L, MS[39]#8953L, MS[40]#8954L, MS[41]#8955L, MS[42]#8956L, MS[43]#8957L, MS[44]#8958L, MS[45]#8959L, MS[46]#8960L, MS[47]#8961L, MS[48]#8962L, MS[49]#8963L, MS[50]#8964L, MS[51]#8965L, sum#9080L, sum#9081, sum#9082, count#9083L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#8847, processing_day#8849, count#9079L, MS[0]#8914L, MS[1]#8915L, MS[2]#8916L, MS[3]#8917L, MS[4]#8918L, MS[5]#8919L, MS[6]#8920L, MS[7]#8921L, MS[8]#8922L, MS[9]#8923L, MS[10]#8924L, MS[11]#8925L, MS[12]#8926L, MS[13]#8927L, MS[14]#8928L, MS[15]#8929L, MS[16]#8930L, MS[17]#8931L, MS[18]#8932L, MS[19]#8933L, MS[20]#8934L, MS[21]#8935L, MS[22]#8936L, MS[23]#8937L, MS[24]#8938L, MS[25]#8939L, MS[26]#8940L, MS[27]#8941L, MS[28]#8942L, MS[29]#8943L, MS[30]#8944L, MS[31]#8945L, MS[32]#8946L, MS[33]#8947L, MS[34]#8948L, MS[35]#8949L, MS[36]#8950L, MS[37]#8951L, MS[38]#8952L, MS[39]#8953L, MS[40]#8954L, MS[41]#8955L, MS[42]#8956L, MS[43]#8957L, MS[44]#8958L, MS[45]#8959L, MS[46]#8960L, MS[47]#8961L, MS[48]#8962L, MS[49]#8963L, MS[50]#8964L, MS[51]#8965L, sum#9080L, sum#9081, sum#9082, count#9083L]
Keys [2]: [segment#8847, processing_day#8849]
Functions [5]: [count(1), approx_count_distinct(customer_id#8843L, 0.05, 0, 0), sum(events#8853), sum(weighted_amount#8855), avg(amount#8851)]
Aggregate Attributes [5]: [count(1)#8861L, approx_count_distinct(customer_id#8843L, 0.05, 0, 0)#8966L, sum(events#8853)#8967L, sum(weighted_amount#8855)#8968, avg(amount#8851)#8969]
Results [7]: [segment#8847, processing_day#8849, count(1)#8861L AS row_count#8856L, approx_count_distinct(customer_id#8843L, 0.05, 0, 0)#8966L AS unique_customers#8857L, sum(events#8853)#8967L AS event_sum#8858L, sum(weighted_amount#8855)#8968 AS weighted_amount_sum#8859, avg(amount#8851)#8969 AS avg_amount#8860]
(9) Exchange
Input [7]: [segment#8847, processing_day#8849, row_count#8856L, unique_customers#8857L, event_sum#8858L, weighted_amount_sum#8859, avg_amount#8860]
Arguments: rangepartitioning(segment#8847 ASC NULLS FIRST, processing_day#8849 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=895]
(10) ShuffleQueryStage
Output [7]: [segment#8847, processing_day#8849, row_count#8856L, unique_customers#8857L, event_sum#8858L, weighted_amount_sum#8859, avg_amount#8860]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#8847, processing_day#8849, row_count#8856L, unique_customers#8857L, event_sum#8858L, weighted_amount_sum#8859, avg_amount#8860]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#8847, processing_day#8849, row_count#8856L, unique_customers#8857L, event_sum#8858L, weighted_amount_sum#8859, avg_amount#8860]
Arguments: [segment#8847 ASC NULLS FIRST, processing_day#8849 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#8847, processing_day#8849, row_count#8856L, unique_customers#8857L, event_sum#8858L, weighted_amount_sum#8859, avg_amount#8860]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#8843L, segment#8847, processing_day#8849, amount#8851, events#8853, weighted_amount#8855]
Keys [2]: [segment#8847, processing_day#8849]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#8843L, 0.05, 0, 0), partial_sum(events#8853), partial_sum(weighted_amount#8855), partial_avg(amount#8851)]
Aggregate Attributes [57]: [count#9074L, MS[0]#8862L, MS[1]#8863L, MS[2]#8864L, MS[3]#8865L, MS[4]#8866L, MS[5]#8867L, MS[6]#8868L, MS[7]#8869L, MS[8]#8870L, MS[9]#8871L, MS[10]#8872L, MS[11]#8873L, MS[12]#8874L, MS[13]#8875L, MS[14]#8876L, MS[15]#8877L, MS[16]#8878L, MS[17]#8879L, MS[18]#8880L, MS[19]#8881L, MS[20]#8882L, MS[21]#8883L, MS[22]#8884L, MS[23]#8885L, MS[24]#8886L, MS[25]#8887L, MS[26]#8888L, MS[27]#8889L, MS[28]#8890L, MS[29]#8891L, MS[30]#8892L, MS[31]#8893L, MS[32]#8894L, MS[33]#8895L, MS[34]#8896L, MS[35]#8897L, MS[36]#8898L, MS[37]#8899L, MS[38]#8900L, MS[39]#8901L, MS[40]#8902L, MS[41]#8903L, MS[42]#8904L, MS[43]#8905L, MS[44]#8906L, MS[45]#8907L, MS[46]#8908L, MS[47]#8909L, MS[48]#8910L, MS[49]#8911L, MS[50]#8912L, MS[51]#8913L, sum#9075L, sum#9076, sum#9077, count#9078L]
Results [59]: [segment#8847, processing_day#8849, count#9079L, MS[0]#8914L, MS[1]#8915L, MS[2]#8916L, MS[3]#8917L, MS[4]#8918L, MS[5]#8919L, MS[6]#8920L, MS[7]#8921L, MS[8]#8922L, MS[9]#8923L, MS[10]#8924L, MS[11]#8925L, MS[12]#8926L, MS[13]#8927L, MS[14]#8928L, MS[15]#8929L, MS[16]#8930L, MS[17]#8931L, MS[18]#8932L, MS[19]#8933L, MS[20]#8934L, MS[21]#8935L, MS[22]#8936L, MS[23]#8937L, MS[24]#8938L, MS[25]#8939L, MS[26]#8940L, MS[27]#8941L, MS[28]#8942L, MS[29]#8943L, MS[30]#8944L, MS[31]#8945L, MS[32]#8946L, MS[33]#8947L, MS[34]#8948L, MS[35]#8949L, MS[36]#8950L, MS[37]#8951L, MS[38]#8952L, MS[39]#8953L, MS[40]#8954L, MS[41]#8955L, MS[42]#8956L, MS[43]#8957L, MS[44]#8958L, MS[45]#8959L, MS[46]#8960L, MS[47]#8961L, MS[48]#8962L, MS[49]#8963L, MS[50]#8964L, MS[51]#8965L, sum#9080L, sum#9081, sum#9082, count#9083L]
(15) Exchange
Input [59]: [segment#8847, processing_day#8849, count#9079L, MS[0]#8914L, MS[1]#8915L, MS[2]#8916L, MS[3]#8917L, MS[4]#8918L, MS[5]#8919L, MS[6]#8920L, MS[7]#8921L, MS[8]#8922L, MS[9]#8923L, MS[10]#8924L, MS[11]#8925L, MS[12]#8926L, MS[13]#8927L, MS[14]#8928L, MS[15]#8929L, MS[16]#8930L, MS[17]#8931L, MS[18]#8932L, MS[19]#8933L, MS[20]#8934L, MS[21]#8935L, MS[22]#8936L, MS[23]#8937L, MS[24]#8938L, MS[25]#8939L, MS[26]#8940L, MS[27]#8941L, MS[28]#8942L, MS[29]#8943L, MS[30]#8944L, MS[31]#8945L, MS[32]#8946L, MS[33]#8947L, MS[34]#8948L, MS[35]#8949L, MS[36]#8950L, MS[37]#8951L, MS[38]#8952L, MS[39]#8953L, MS[40]#8954L, MS[41]#8955L, MS[42]#8956L, MS[43]#8957L, MS[44]#8958L, MS[45]#8959L, MS[46]#8960L, MS[47]#8961L, MS[48]#8962L, MS[49]#8963L, MS[50]#8964L, MS[51]#8965L, sum#9080L, sum#9081, sum#9082, count#9083L]
Arguments: hashpartitioning(segment#8847, processing_day#8849, 200), ENSURE_REQUIREMENTS, [plan_id=853]
(16) HashAggregate
Input [59]: [segment#8847, processing_day#8849, count#9079L, MS[0]#8914L, MS[1]#8915L, MS[2]#8916L, MS[3]#8917L, MS[4]#8918L, MS[5]#8919L, MS[6]#8920L, MS[7]#8921L, MS[8]#8922L, MS[9]#8923L, MS[10]#8924L, MS[11]#8925L, MS[12]#8926L, MS[13]#8927L, MS[14]#8928L, MS[15]#8929L, MS[16]#8930L, MS[17]#8931L, MS[18]#8932L, MS[19]#8933L, MS[20]#8934L, MS[21]#8935L, MS[22]#8936L, MS[23]#8937L, MS[24]#8938L, MS[25]#8939L, MS[26]#8940L, MS[27]#8941L, MS[28]#8942L, MS[29]#8943L, MS[30]#8944L, MS[31]#8945L, MS[32]#8946L, MS[33]#8947L, MS[34]#8948L, MS[35]#8949L, MS[36]#8950L, MS[37]#8951L, MS[38]#8952L, MS[39]#8953L, MS[40]#8954L, MS[41]#8955L, MS[42]#8956L, MS[43]#8957L, MS[44]#8958L, MS[45]#8959L, MS[46]#8960L, MS[47]#8961L, MS[48]#8962L, MS[49]#8963L, MS[50]#8964L, MS[51]#8965L, sum#9080L, sum#9081, sum#9082, count#9083L]
Keys [2]: [segment#8847, processing_day#8849]
Functions [5]: [count(1), approx_count_distinct(customer_id#8843L, 0.05, 0, 0), sum(events#8853), sum(weighted_amount#8855), avg(amount#8851)]
Aggregate Attributes [5]: [count(1)#8861L, approx_count_distinct(customer_id#8843L, 0.05, 0, 0)#8966L, sum(events#8853)#8967L, sum(weighted_amount#8855)#8968, avg(amount#8851)#8969]
Results [7]: [segment#8847, processing_day#8849, count(1)#8861L AS row_count#8856L, approx_count_distinct(customer_id#8843L, 0.05, 0, 0)#8966L AS unique_customers#8857L, sum(events#8853)#8967L AS event_sum#8858L, sum(weighted_amount#8855)#8968 AS weighted_amount_sum#8859, avg(amount#8851)#8969 AS avg_amount#8860]
(17) Exchange
Input [7]: [segment#8847, processing_day#8849, row_count#8856L, unique_customers#8857L, event_sum#8858L, weighted_amount_sum#8859, avg_amount#8860]
Arguments: rangepartitioning(segment#8847 ASC NULLS FIRST, processing_day#8849 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=856]
(18) Sort
Input [7]: [segment#8847, processing_day#8849, row_count#8856L, unique_customers#8857L, event_sum#8858L, weighted_amount_sum#8859, avg_amount#8860]
Arguments: [segment#8847 ASC NULLS FIRST, processing_day#8849 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#8847, processing_day#8849, row_count#8856L, unique_customers#8857L, event_sum#8858L, weighted_amount_sum#8859, avg_amount#8860]
Arguments: isFinalPlan=true