== 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#7957L]
Arguments: Range (9000000, 10000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#7957L % 250000) AS customer_id#7959L, concat(segment-, cast(cast((id#7957L % 12) as int) as string)) AS segment#7963, cast((id#7957L % 14) as int) AS processing_day#7965, ((cast(((id#7957L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#7967, cast((((id#7957L * 29) % 7) + 1) as int) AS events#7969]
Input [1]: [id#7957L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#7959L, segment#7963, processing_day#7965, amount#7967, events#7969, (amount#7967 * cast(events#7969 as double)) AS weighted_amount#7971]
Input [5]: [customer_id#7959L, segment#7963, processing_day#7965, amount#7967, events#7969]
(4) HashAggregate
Input [6]: [customer_id#7959L, segment#7963, processing_day#7965, amount#7967, events#7969, weighted_amount#7971]
Keys [2]: [segment#7963, processing_day#7965]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#7959L, 0.05, 0, 0), partial_sum(events#7969), partial_sum(weighted_amount#7971), partial_avg(amount#7967)]
Aggregate Attributes [57]: [count#8190L, MS[0]#7978L, MS[1]#7979L, MS[2]#7980L, MS[3]#7981L, MS[4]#7982L, MS[5]#7983L, MS[6]#7984L, MS[7]#7985L, MS[8]#7986L, MS[9]#7987L, MS[10]#7988L, MS[11]#7989L, MS[12]#7990L, MS[13]#7991L, MS[14]#7992L, MS[15]#7993L, MS[16]#7994L, MS[17]#7995L, MS[18]#7996L, MS[19]#7997L, MS[20]#7998L, MS[21]#7999L, MS[22]#8000L, MS[23]#8001L, MS[24]#8002L, MS[25]#8003L, MS[26]#8004L, MS[27]#8005L, MS[28]#8006L, MS[29]#8007L, MS[30]#8008L, MS[31]#8009L, MS[32]#8010L, MS[33]#8011L, MS[34]#8012L, MS[35]#8013L, MS[36]#8014L, MS[37]#8015L, MS[38]#8016L, MS[39]#8017L, MS[40]#8018L, MS[41]#8019L, MS[42]#8020L, MS[43]#8021L, MS[44]#8022L, MS[45]#8023L, MS[46]#8024L, MS[47]#8025L, MS[48]#8026L, MS[49]#8027L, MS[50]#8028L, MS[51]#8029L, sum#8191L, sum#8192, sum#8193, count#8194L]
Results [59]: [segment#7963, processing_day#7965, count#8195L, MS[0]#8030L, MS[1]#8031L, MS[2]#8032L, MS[3]#8033L, MS[4]#8034L, MS[5]#8035L, MS[6]#8036L, MS[7]#8037L, MS[8]#8038L, MS[9]#8039L, MS[10]#8040L, MS[11]#8041L, MS[12]#8042L, MS[13]#8043L, MS[14]#8044L, MS[15]#8045L, MS[16]#8046L, MS[17]#8047L, MS[18]#8048L, MS[19]#8049L, MS[20]#8050L, MS[21]#8051L, MS[22]#8052L, MS[23]#8053L, MS[24]#8054L, MS[25]#8055L, MS[26]#8056L, MS[27]#8057L, MS[28]#8058L, MS[29]#8059L, MS[30]#8060L, MS[31]#8061L, MS[32]#8062L, MS[33]#8063L, MS[34]#8064L, MS[35]#8065L, MS[36]#8066L, MS[37]#8067L, MS[38]#8068L, MS[39]#8069L, MS[40]#8070L, MS[41]#8071L, MS[42]#8072L, MS[43]#8073L, MS[44]#8074L, MS[45]#8075L, MS[46]#8076L, MS[47]#8077L, MS[48]#8078L, MS[49]#8079L, MS[50]#8080L, MS[51]#8081L, sum#8196L, sum#8197, sum#8198, count#8199L]
(5) Exchange
Input [59]: [segment#7963, processing_day#7965, count#8195L, MS[0]#8030L, MS[1]#8031L, MS[2]#8032L, MS[3]#8033L, MS[4]#8034L, MS[5]#8035L, MS[6]#8036L, MS[7]#8037L, MS[8]#8038L, MS[9]#8039L, MS[10]#8040L, MS[11]#8041L, MS[12]#8042L, MS[13]#8043L, MS[14]#8044L, MS[15]#8045L, MS[16]#8046L, MS[17]#8047L, MS[18]#8048L, MS[19]#8049L, MS[20]#8050L, MS[21]#8051L, MS[22]#8052L, MS[23]#8053L, MS[24]#8054L, MS[25]#8055L, MS[26]#8056L, MS[27]#8057L, MS[28]#8058L, MS[29]#8059L, MS[30]#8060L, MS[31]#8061L, MS[32]#8062L, MS[33]#8063L, MS[34]#8064L, MS[35]#8065L, MS[36]#8066L, MS[37]#8067L, MS[38]#8068L, MS[39]#8069L, MS[40]#8070L, MS[41]#8071L, MS[42]#8072L, MS[43]#8073L, MS[44]#8074L, MS[45]#8075L, MS[46]#8076L, MS[47]#8077L, MS[48]#8078L, MS[49]#8079L, MS[50]#8080L, MS[51]#8081L, sum#8196L, sum#8197, sum#8198, count#8199L]
Arguments: hashpartitioning(segment#7963, processing_day#7965, 200), ENSURE_REQUIREMENTS, [plan_id=790]
(6) ShuffleQueryStage
Output [59]: [segment#7963, processing_day#7965, count#8195L, MS[0]#8030L, MS[1]#8031L, MS[2]#8032L, MS[3]#8033L, MS[4]#8034L, MS[5]#8035L, MS[6]#8036L, MS[7]#8037L, MS[8]#8038L, MS[9]#8039L, MS[10]#8040L, MS[11]#8041L, MS[12]#8042L, MS[13]#8043L, MS[14]#8044L, MS[15]#8045L, MS[16]#8046L, MS[17]#8047L, MS[18]#8048L, MS[19]#8049L, MS[20]#8050L, MS[21]#8051L, MS[22]#8052L, MS[23]#8053L, MS[24]#8054L, MS[25]#8055L, MS[26]#8056L, MS[27]#8057L, MS[28]#8058L, MS[29]#8059L, MS[30]#8060L, MS[31]#8061L, MS[32]#8062L, MS[33]#8063L, MS[34]#8064L, MS[35]#8065L, MS[36]#8066L, MS[37]#8067L, MS[38]#8068L, MS[39]#8069L, MS[40]#8070L, MS[41]#8071L, MS[42]#8072L, MS[43]#8073L, MS[44]#8074L, MS[45]#8075L, MS[46]#8076L, MS[47]#8077L, MS[48]#8078L, MS[49]#8079L, MS[50]#8080L, MS[51]#8081L, sum#8196L, sum#8197, sum#8198, count#8199L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#7963, processing_day#7965, count#8195L, MS[0]#8030L, MS[1]#8031L, MS[2]#8032L, MS[3]#8033L, MS[4]#8034L, MS[5]#8035L, MS[6]#8036L, MS[7]#8037L, MS[8]#8038L, MS[9]#8039L, MS[10]#8040L, MS[11]#8041L, MS[12]#8042L, MS[13]#8043L, MS[14]#8044L, MS[15]#8045L, MS[16]#8046L, MS[17]#8047L, MS[18]#8048L, MS[19]#8049L, MS[20]#8050L, MS[21]#8051L, MS[22]#8052L, MS[23]#8053L, MS[24]#8054L, MS[25]#8055L, MS[26]#8056L, MS[27]#8057L, MS[28]#8058L, MS[29]#8059L, MS[30]#8060L, MS[31]#8061L, MS[32]#8062L, MS[33]#8063L, MS[34]#8064L, MS[35]#8065L, MS[36]#8066L, MS[37]#8067L, MS[38]#8068L, MS[39]#8069L, MS[40]#8070L, MS[41]#8071L, MS[42]#8072L, MS[43]#8073L, MS[44]#8074L, MS[45]#8075L, MS[46]#8076L, MS[47]#8077L, MS[48]#8078L, MS[49]#8079L, MS[50]#8080L, MS[51]#8081L, sum#8196L, sum#8197, sum#8198, count#8199L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#7963, processing_day#7965, count#8195L, MS[0]#8030L, MS[1]#8031L, MS[2]#8032L, MS[3]#8033L, MS[4]#8034L, MS[5]#8035L, MS[6]#8036L, MS[7]#8037L, MS[8]#8038L, MS[9]#8039L, MS[10]#8040L, MS[11]#8041L, MS[12]#8042L, MS[13]#8043L, MS[14]#8044L, MS[15]#8045L, MS[16]#8046L, MS[17]#8047L, MS[18]#8048L, MS[19]#8049L, MS[20]#8050L, MS[21]#8051L, MS[22]#8052L, MS[23]#8053L, MS[24]#8054L, MS[25]#8055L, MS[26]#8056L, MS[27]#8057L, MS[28]#8058L, MS[29]#8059L, MS[30]#8060L, MS[31]#8061L, MS[32]#8062L, MS[33]#8063L, MS[34]#8064L, MS[35]#8065L, MS[36]#8066L, MS[37]#8067L, MS[38]#8068L, MS[39]#8069L, MS[40]#8070L, MS[41]#8071L, MS[42]#8072L, MS[43]#8073L, MS[44]#8074L, MS[45]#8075L, MS[46]#8076L, MS[47]#8077L, MS[48]#8078L, MS[49]#8079L, MS[50]#8080L, MS[51]#8081L, sum#8196L, sum#8197, sum#8198, count#8199L]
Keys [2]: [segment#7963, processing_day#7965]
Functions [5]: [count(1), approx_count_distinct(customer_id#7959L, 0.05, 0, 0), sum(events#7969), sum(weighted_amount#7971), avg(amount#7967)]
Aggregate Attributes [5]: [count(1)#7977L, approx_count_distinct(customer_id#7959L, 0.05, 0, 0)#8082L, sum(events#7969)#8083L, sum(weighted_amount#7971)#8084, avg(amount#7967)#8085]
Results [7]: [segment#7963, processing_day#7965, count(1)#7977L AS row_count#7972L, approx_count_distinct(customer_id#7959L, 0.05, 0, 0)#8082L AS unique_customers#7973L, sum(events#7969)#8083L AS event_sum#7974L, sum(weighted_amount#7971)#8084 AS weighted_amount_sum#7975, avg(amount#7967)#8085 AS avg_amount#7976]
(9) Exchange
Input [7]: [segment#7963, processing_day#7965, row_count#7972L, unique_customers#7973L, event_sum#7974L, weighted_amount_sum#7975, avg_amount#7976]
Arguments: rangepartitioning(segment#7963 ASC NULLS FIRST, processing_day#7965 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=812]
(10) ShuffleQueryStage
Output [7]: [segment#7963, processing_day#7965, row_count#7972L, unique_customers#7973L, event_sum#7974L, weighted_amount_sum#7975, avg_amount#7976]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#7963, processing_day#7965, row_count#7972L, unique_customers#7973L, event_sum#7974L, weighted_amount_sum#7975, avg_amount#7976]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#7963, processing_day#7965, row_count#7972L, unique_customers#7973L, event_sum#7974L, weighted_amount_sum#7975, avg_amount#7976]
Arguments: [segment#7963 ASC NULLS FIRST, processing_day#7965 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#7963, processing_day#7965, row_count#7972L, unique_customers#7973L, event_sum#7974L, weighted_amount_sum#7975, avg_amount#7976]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#7959L, segment#7963, processing_day#7965, amount#7967, events#7969, weighted_amount#7971]
Keys [2]: [segment#7963, processing_day#7965]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#7959L, 0.05, 0, 0), partial_sum(events#7969), partial_sum(weighted_amount#7971), partial_avg(amount#7967)]
Aggregate Attributes [57]: [count#8190L, MS[0]#7978L, MS[1]#7979L, MS[2]#7980L, MS[3]#7981L, MS[4]#7982L, MS[5]#7983L, MS[6]#7984L, MS[7]#7985L, MS[8]#7986L, MS[9]#7987L, MS[10]#7988L, MS[11]#7989L, MS[12]#7990L, MS[13]#7991L, MS[14]#7992L, MS[15]#7993L, MS[16]#7994L, MS[17]#7995L, MS[18]#7996L, MS[19]#7997L, MS[20]#7998L, MS[21]#7999L, MS[22]#8000L, MS[23]#8001L, MS[24]#8002L, MS[25]#8003L, MS[26]#8004L, MS[27]#8005L, MS[28]#8006L, MS[29]#8007L, MS[30]#8008L, MS[31]#8009L, MS[32]#8010L, MS[33]#8011L, MS[34]#8012L, MS[35]#8013L, MS[36]#8014L, MS[37]#8015L, MS[38]#8016L, MS[39]#8017L, MS[40]#8018L, MS[41]#8019L, MS[42]#8020L, MS[43]#8021L, MS[44]#8022L, MS[45]#8023L, MS[46]#8024L, MS[47]#8025L, MS[48]#8026L, MS[49]#8027L, MS[50]#8028L, MS[51]#8029L, sum#8191L, sum#8192, sum#8193, count#8194L]
Results [59]: [segment#7963, processing_day#7965, count#8195L, MS[0]#8030L, MS[1]#8031L, MS[2]#8032L, MS[3]#8033L, MS[4]#8034L, MS[5]#8035L, MS[6]#8036L, MS[7]#8037L, MS[8]#8038L, MS[9]#8039L, MS[10]#8040L, MS[11]#8041L, MS[12]#8042L, MS[13]#8043L, MS[14]#8044L, MS[15]#8045L, MS[16]#8046L, MS[17]#8047L, MS[18]#8048L, MS[19]#8049L, MS[20]#8050L, MS[21]#8051L, MS[22]#8052L, MS[23]#8053L, MS[24]#8054L, MS[25]#8055L, MS[26]#8056L, MS[27]#8057L, MS[28]#8058L, MS[29]#8059L, MS[30]#8060L, MS[31]#8061L, MS[32]#8062L, MS[33]#8063L, MS[34]#8064L, MS[35]#8065L, MS[36]#8066L, MS[37]#8067L, MS[38]#8068L, MS[39]#8069L, MS[40]#8070L, MS[41]#8071L, MS[42]#8072L, MS[43]#8073L, MS[44]#8074L, MS[45]#8075L, MS[46]#8076L, MS[47]#8077L, MS[48]#8078L, MS[49]#8079L, MS[50]#8080L, MS[51]#8081L, sum#8196L, sum#8197, sum#8198, count#8199L]
(15) Exchange
Input [59]: [segment#7963, processing_day#7965, count#8195L, MS[0]#8030L, MS[1]#8031L, MS[2]#8032L, MS[3]#8033L, MS[4]#8034L, MS[5]#8035L, MS[6]#8036L, MS[7]#8037L, MS[8]#8038L, MS[9]#8039L, MS[10]#8040L, MS[11]#8041L, MS[12]#8042L, MS[13]#8043L, MS[14]#8044L, MS[15]#8045L, MS[16]#8046L, MS[17]#8047L, MS[18]#8048L, MS[19]#8049L, MS[20]#8050L, MS[21]#8051L, MS[22]#8052L, MS[23]#8053L, MS[24]#8054L, MS[25]#8055L, MS[26]#8056L, MS[27]#8057L, MS[28]#8058L, MS[29]#8059L, MS[30]#8060L, MS[31]#8061L, MS[32]#8062L, MS[33]#8063L, MS[34]#8064L, MS[35]#8065L, MS[36]#8066L, MS[37]#8067L, MS[38]#8068L, MS[39]#8069L, MS[40]#8070L, MS[41]#8071L, MS[42]#8072L, MS[43]#8073L, MS[44]#8074L, MS[45]#8075L, MS[46]#8076L, MS[47]#8077L, MS[48]#8078L, MS[49]#8079L, MS[50]#8080L, MS[51]#8081L, sum#8196L, sum#8197, sum#8198, count#8199L]
Arguments: hashpartitioning(segment#7963, processing_day#7965, 200), ENSURE_REQUIREMENTS, [plan_id=770]
(16) HashAggregate
Input [59]: [segment#7963, processing_day#7965, count#8195L, MS[0]#8030L, MS[1]#8031L, MS[2]#8032L, MS[3]#8033L, MS[4]#8034L, MS[5]#8035L, MS[6]#8036L, MS[7]#8037L, MS[8]#8038L, MS[9]#8039L, MS[10]#8040L, MS[11]#8041L, MS[12]#8042L, MS[13]#8043L, MS[14]#8044L, MS[15]#8045L, MS[16]#8046L, MS[17]#8047L, MS[18]#8048L, MS[19]#8049L, MS[20]#8050L, MS[21]#8051L, MS[22]#8052L, MS[23]#8053L, MS[24]#8054L, MS[25]#8055L, MS[26]#8056L, MS[27]#8057L, MS[28]#8058L, MS[29]#8059L, MS[30]#8060L, MS[31]#8061L, MS[32]#8062L, MS[33]#8063L, MS[34]#8064L, MS[35]#8065L, MS[36]#8066L, MS[37]#8067L, MS[38]#8068L, MS[39]#8069L, MS[40]#8070L, MS[41]#8071L, MS[42]#8072L, MS[43]#8073L, MS[44]#8074L, MS[45]#8075L, MS[46]#8076L, MS[47]#8077L, MS[48]#8078L, MS[49]#8079L, MS[50]#8080L, MS[51]#8081L, sum#8196L, sum#8197, sum#8198, count#8199L]
Keys [2]: [segment#7963, processing_day#7965]
Functions [5]: [count(1), approx_count_distinct(customer_id#7959L, 0.05, 0, 0), sum(events#7969), sum(weighted_amount#7971), avg(amount#7967)]
Aggregate Attributes [5]: [count(1)#7977L, approx_count_distinct(customer_id#7959L, 0.05, 0, 0)#8082L, sum(events#7969)#8083L, sum(weighted_amount#7971)#8084, avg(amount#7967)#8085]
Results [7]: [segment#7963, processing_day#7965, count(1)#7977L AS row_count#7972L, approx_count_distinct(customer_id#7959L, 0.05, 0, 0)#8082L AS unique_customers#7973L, sum(events#7969)#8083L AS event_sum#7974L, sum(weighted_amount#7971)#8084 AS weighted_amount_sum#7975, avg(amount#7967)#8085 AS avg_amount#7976]
(17) Exchange
Input [7]: [segment#7963, processing_day#7965, row_count#7972L, unique_customers#7973L, event_sum#7974L, weighted_amount_sum#7975, avg_amount#7976]
Arguments: rangepartitioning(segment#7963 ASC NULLS FIRST, processing_day#7965 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=773]
(18) Sort
Input [7]: [segment#7963, processing_day#7965, row_count#7972L, unique_customers#7973L, event_sum#7974L, weighted_amount_sum#7975, avg_amount#7976]
Arguments: [segment#7963 ASC NULLS FIRST, processing_day#7965 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#7963, processing_day#7965, row_count#7972L, unique_customers#7973L, event_sum#7974L, weighted_amount_sum#7975, avg_amount#7976]
Arguments: isFinalPlan=true