== 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#16797L]
Arguments: Range (19000000, 20000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#16797L % 250000) AS customer_id#16799L, concat(segment-, cast(cast((id#16797L % 12) as int) as string)) AS segment#16803, cast((id#16797L % 14) as int) AS processing_day#16805, ((cast(((id#16797L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#16807, cast((((id#16797L * 29) % 7) + 1) as int) AS events#16809]
Input [1]: [id#16797L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#16799L, segment#16803, processing_day#16805, amount#16807, events#16809, (amount#16807 * cast(events#16809 as double)) AS weighted_amount#16811]
Input [5]: [customer_id#16799L, segment#16803, processing_day#16805, amount#16807, events#16809]
(4) HashAggregate
Input [6]: [customer_id#16799L, segment#16803, processing_day#16805, amount#16807, events#16809, weighted_amount#16811]
Keys [2]: [segment#16803, processing_day#16805]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#16799L, 0.05, 0, 0), partial_sum(events#16809), partial_sum(weighted_amount#16811), partial_avg(amount#16807)]
Aggregate Attributes [57]: [count#17030L, MS[0]#16818L, MS[1]#16819L, MS[2]#16820L, MS[3]#16821L, MS[4]#16822L, MS[5]#16823L, MS[6]#16824L, MS[7]#16825L, MS[8]#16826L, MS[9]#16827L, MS[10]#16828L, MS[11]#16829L, MS[12]#16830L, MS[13]#16831L, MS[14]#16832L, MS[15]#16833L, MS[16]#16834L, MS[17]#16835L, MS[18]#16836L, MS[19]#16837L, MS[20]#16838L, MS[21]#16839L, MS[22]#16840L, MS[23]#16841L, MS[24]#16842L, MS[25]#16843L, MS[26]#16844L, MS[27]#16845L, MS[28]#16846L, MS[29]#16847L, MS[30]#16848L, MS[31]#16849L, MS[32]#16850L, MS[33]#16851L, MS[34]#16852L, MS[35]#16853L, MS[36]#16854L, MS[37]#16855L, MS[38]#16856L, MS[39]#16857L, MS[40]#16858L, MS[41]#16859L, MS[42]#16860L, MS[43]#16861L, MS[44]#16862L, MS[45]#16863L, MS[46]#16864L, MS[47]#16865L, MS[48]#16866L, MS[49]#16867L, MS[50]#16868L, MS[51]#16869L, sum#17031L, sum#17032, sum#17033, count#17034L]
Results [59]: [segment#16803, processing_day#16805, count#17035L, MS[0]#16870L, MS[1]#16871L, MS[2]#16872L, MS[3]#16873L, MS[4]#16874L, MS[5]#16875L, MS[6]#16876L, MS[7]#16877L, MS[8]#16878L, MS[9]#16879L, MS[10]#16880L, MS[11]#16881L, MS[12]#16882L, MS[13]#16883L, MS[14]#16884L, MS[15]#16885L, MS[16]#16886L, MS[17]#16887L, MS[18]#16888L, MS[19]#16889L, MS[20]#16890L, MS[21]#16891L, MS[22]#16892L, MS[23]#16893L, MS[24]#16894L, MS[25]#16895L, MS[26]#16896L, MS[27]#16897L, MS[28]#16898L, MS[29]#16899L, MS[30]#16900L, MS[31]#16901L, MS[32]#16902L, MS[33]#16903L, MS[34]#16904L, MS[35]#16905L, MS[36]#16906L, MS[37]#16907L, MS[38]#16908L, MS[39]#16909L, MS[40]#16910L, MS[41]#16911L, MS[42]#16912L, MS[43]#16913L, MS[44]#16914L, MS[45]#16915L, MS[46]#16916L, MS[47]#16917L, MS[48]#16918L, MS[49]#16919L, MS[50]#16920L, MS[51]#16921L, sum#17036L, sum#17037, sum#17038, count#17039L]
(5) Exchange
Input [59]: [segment#16803, processing_day#16805, count#17035L, MS[0]#16870L, MS[1]#16871L, MS[2]#16872L, MS[3]#16873L, MS[4]#16874L, MS[5]#16875L, MS[6]#16876L, MS[7]#16877L, MS[8]#16878L, MS[9]#16879L, MS[10]#16880L, MS[11]#16881L, MS[12]#16882L, MS[13]#16883L, MS[14]#16884L, MS[15]#16885L, MS[16]#16886L, MS[17]#16887L, MS[18]#16888L, MS[19]#16889L, MS[20]#16890L, MS[21]#16891L, MS[22]#16892L, MS[23]#16893L, MS[24]#16894L, MS[25]#16895L, MS[26]#16896L, MS[27]#16897L, MS[28]#16898L, MS[29]#16899L, MS[30]#16900L, MS[31]#16901L, MS[32]#16902L, MS[33]#16903L, MS[34]#16904L, MS[35]#16905L, MS[36]#16906L, MS[37]#16907L, MS[38]#16908L, MS[39]#16909L, MS[40]#16910L, MS[41]#16911L, MS[42]#16912L, MS[43]#16913L, MS[44]#16914L, MS[45]#16915L, MS[46]#16916L, MS[47]#16917L, MS[48]#16918L, MS[49]#16919L, MS[50]#16920L, MS[51]#16921L, sum#17036L, sum#17037, sum#17038, count#17039L]
Arguments: hashpartitioning(segment#16803, processing_day#16805, 200), ENSURE_REQUIREMENTS, [plan_id=1620]
(6) ShuffleQueryStage
Output [59]: [segment#16803, processing_day#16805, count#17035L, MS[0]#16870L, MS[1]#16871L, MS[2]#16872L, MS[3]#16873L, MS[4]#16874L, MS[5]#16875L, MS[6]#16876L, MS[7]#16877L, MS[8]#16878L, MS[9]#16879L, MS[10]#16880L, MS[11]#16881L, MS[12]#16882L, MS[13]#16883L, MS[14]#16884L, MS[15]#16885L, MS[16]#16886L, MS[17]#16887L, MS[18]#16888L, MS[19]#16889L, MS[20]#16890L, MS[21]#16891L, MS[22]#16892L, MS[23]#16893L, MS[24]#16894L, MS[25]#16895L, MS[26]#16896L, MS[27]#16897L, MS[28]#16898L, MS[29]#16899L, MS[30]#16900L, MS[31]#16901L, MS[32]#16902L, MS[33]#16903L, MS[34]#16904L, MS[35]#16905L, MS[36]#16906L, MS[37]#16907L, MS[38]#16908L, MS[39]#16909L, MS[40]#16910L, MS[41]#16911L, MS[42]#16912L, MS[43]#16913L, MS[44]#16914L, MS[45]#16915L, MS[46]#16916L, MS[47]#16917L, MS[48]#16918L, MS[49]#16919L, MS[50]#16920L, MS[51]#16921L, sum#17036L, sum#17037, sum#17038, count#17039L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#16803, processing_day#16805, count#17035L, MS[0]#16870L, MS[1]#16871L, MS[2]#16872L, MS[3]#16873L, MS[4]#16874L, MS[5]#16875L, MS[6]#16876L, MS[7]#16877L, MS[8]#16878L, MS[9]#16879L, MS[10]#16880L, MS[11]#16881L, MS[12]#16882L, MS[13]#16883L, MS[14]#16884L, MS[15]#16885L, MS[16]#16886L, MS[17]#16887L, MS[18]#16888L, MS[19]#16889L, MS[20]#16890L, MS[21]#16891L, MS[22]#16892L, MS[23]#16893L, MS[24]#16894L, MS[25]#16895L, MS[26]#16896L, MS[27]#16897L, MS[28]#16898L, MS[29]#16899L, MS[30]#16900L, MS[31]#16901L, MS[32]#16902L, MS[33]#16903L, MS[34]#16904L, MS[35]#16905L, MS[36]#16906L, MS[37]#16907L, MS[38]#16908L, MS[39]#16909L, MS[40]#16910L, MS[41]#16911L, MS[42]#16912L, MS[43]#16913L, MS[44]#16914L, MS[45]#16915L, MS[46]#16916L, MS[47]#16917L, MS[48]#16918L, MS[49]#16919L, MS[50]#16920L, MS[51]#16921L, sum#17036L, sum#17037, sum#17038, count#17039L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#16803, processing_day#16805, count#17035L, MS[0]#16870L, MS[1]#16871L, MS[2]#16872L, MS[3]#16873L, MS[4]#16874L, MS[5]#16875L, MS[6]#16876L, MS[7]#16877L, MS[8]#16878L, MS[9]#16879L, MS[10]#16880L, MS[11]#16881L, MS[12]#16882L, MS[13]#16883L, MS[14]#16884L, MS[15]#16885L, MS[16]#16886L, MS[17]#16887L, MS[18]#16888L, MS[19]#16889L, MS[20]#16890L, MS[21]#16891L, MS[22]#16892L, MS[23]#16893L, MS[24]#16894L, MS[25]#16895L, MS[26]#16896L, MS[27]#16897L, MS[28]#16898L, MS[29]#16899L, MS[30]#16900L, MS[31]#16901L, MS[32]#16902L, MS[33]#16903L, MS[34]#16904L, MS[35]#16905L, MS[36]#16906L, MS[37]#16907L, MS[38]#16908L, MS[39]#16909L, MS[40]#16910L, MS[41]#16911L, MS[42]#16912L, MS[43]#16913L, MS[44]#16914L, MS[45]#16915L, MS[46]#16916L, MS[47]#16917L, MS[48]#16918L, MS[49]#16919L, MS[50]#16920L, MS[51]#16921L, sum#17036L, sum#17037, sum#17038, count#17039L]
Keys [2]: [segment#16803, processing_day#16805]
Functions [5]: [count(1), approx_count_distinct(customer_id#16799L, 0.05, 0, 0), sum(events#16809), sum(weighted_amount#16811), avg(amount#16807)]
Aggregate Attributes [5]: [count(1)#16817L, approx_count_distinct(customer_id#16799L, 0.05, 0, 0)#16922L, sum(events#16809)#16923L, sum(weighted_amount#16811)#16924, avg(amount#16807)#16925]
Results [7]: [segment#16803, processing_day#16805, count(1)#16817L AS row_count#16812L, approx_count_distinct(customer_id#16799L, 0.05, 0, 0)#16922L AS unique_customers#16813L, sum(events#16809)#16923L AS event_sum#16814L, sum(weighted_amount#16811)#16924 AS weighted_amount_sum#16815, avg(amount#16807)#16925 AS avg_amount#16816]
(9) Exchange
Input [7]: [segment#16803, processing_day#16805, row_count#16812L, unique_customers#16813L, event_sum#16814L, weighted_amount_sum#16815, avg_amount#16816]
Arguments: rangepartitioning(segment#16803 ASC NULLS FIRST, processing_day#16805 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1642]
(10) ShuffleQueryStage
Output [7]: [segment#16803, processing_day#16805, row_count#16812L, unique_customers#16813L, event_sum#16814L, weighted_amount_sum#16815, avg_amount#16816]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#16803, processing_day#16805, row_count#16812L, unique_customers#16813L, event_sum#16814L, weighted_amount_sum#16815, avg_amount#16816]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#16803, processing_day#16805, row_count#16812L, unique_customers#16813L, event_sum#16814L, weighted_amount_sum#16815, avg_amount#16816]
Arguments: [segment#16803 ASC NULLS FIRST, processing_day#16805 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#16803, processing_day#16805, row_count#16812L, unique_customers#16813L, event_sum#16814L, weighted_amount_sum#16815, avg_amount#16816]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#16799L, segment#16803, processing_day#16805, amount#16807, events#16809, weighted_amount#16811]
Keys [2]: [segment#16803, processing_day#16805]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#16799L, 0.05, 0, 0), partial_sum(events#16809), partial_sum(weighted_amount#16811), partial_avg(amount#16807)]
Aggregate Attributes [57]: [count#17030L, MS[0]#16818L, MS[1]#16819L, MS[2]#16820L, MS[3]#16821L, MS[4]#16822L, MS[5]#16823L, MS[6]#16824L, MS[7]#16825L, MS[8]#16826L, MS[9]#16827L, MS[10]#16828L, MS[11]#16829L, MS[12]#16830L, MS[13]#16831L, MS[14]#16832L, MS[15]#16833L, MS[16]#16834L, MS[17]#16835L, MS[18]#16836L, MS[19]#16837L, MS[20]#16838L, MS[21]#16839L, MS[22]#16840L, MS[23]#16841L, MS[24]#16842L, MS[25]#16843L, MS[26]#16844L, MS[27]#16845L, MS[28]#16846L, MS[29]#16847L, MS[30]#16848L, MS[31]#16849L, MS[32]#16850L, MS[33]#16851L, MS[34]#16852L, MS[35]#16853L, MS[36]#16854L, MS[37]#16855L, MS[38]#16856L, MS[39]#16857L, MS[40]#16858L, MS[41]#16859L, MS[42]#16860L, MS[43]#16861L, MS[44]#16862L, MS[45]#16863L, MS[46]#16864L, MS[47]#16865L, MS[48]#16866L, MS[49]#16867L, MS[50]#16868L, MS[51]#16869L, sum#17031L, sum#17032, sum#17033, count#17034L]
Results [59]: [segment#16803, processing_day#16805, count#17035L, MS[0]#16870L, MS[1]#16871L, MS[2]#16872L, MS[3]#16873L, MS[4]#16874L, MS[5]#16875L, MS[6]#16876L, MS[7]#16877L, MS[8]#16878L, MS[9]#16879L, MS[10]#16880L, MS[11]#16881L, MS[12]#16882L, MS[13]#16883L, MS[14]#16884L, MS[15]#16885L, MS[16]#16886L, MS[17]#16887L, MS[18]#16888L, MS[19]#16889L, MS[20]#16890L, MS[21]#16891L, MS[22]#16892L, MS[23]#16893L, MS[24]#16894L, MS[25]#16895L, MS[26]#16896L, MS[27]#16897L, MS[28]#16898L, MS[29]#16899L, MS[30]#16900L, MS[31]#16901L, MS[32]#16902L, MS[33]#16903L, MS[34]#16904L, MS[35]#16905L, MS[36]#16906L, MS[37]#16907L, MS[38]#16908L, MS[39]#16909L, MS[40]#16910L, MS[41]#16911L, MS[42]#16912L, MS[43]#16913L, MS[44]#16914L, MS[45]#16915L, MS[46]#16916L, MS[47]#16917L, MS[48]#16918L, MS[49]#16919L, MS[50]#16920L, MS[51]#16921L, sum#17036L, sum#17037, sum#17038, count#17039L]
(15) Exchange
Input [59]: [segment#16803, processing_day#16805, count#17035L, MS[0]#16870L, MS[1]#16871L, MS[2]#16872L, MS[3]#16873L, MS[4]#16874L, MS[5]#16875L, MS[6]#16876L, MS[7]#16877L, MS[8]#16878L, MS[9]#16879L, MS[10]#16880L, MS[11]#16881L, MS[12]#16882L, MS[13]#16883L, MS[14]#16884L, MS[15]#16885L, MS[16]#16886L, MS[17]#16887L, MS[18]#16888L, MS[19]#16889L, MS[20]#16890L, MS[21]#16891L, MS[22]#16892L, MS[23]#16893L, MS[24]#16894L, MS[25]#16895L, MS[26]#16896L, MS[27]#16897L, MS[28]#16898L, MS[29]#16899L, MS[30]#16900L, MS[31]#16901L, MS[32]#16902L, MS[33]#16903L, MS[34]#16904L, MS[35]#16905L, MS[36]#16906L, MS[37]#16907L, MS[38]#16908L, MS[39]#16909L, MS[40]#16910L, MS[41]#16911L, MS[42]#16912L, MS[43]#16913L, MS[44]#16914L, MS[45]#16915L, MS[46]#16916L, MS[47]#16917L, MS[48]#16918L, MS[49]#16919L, MS[50]#16920L, MS[51]#16921L, sum#17036L, sum#17037, sum#17038, count#17039L]
Arguments: hashpartitioning(segment#16803, processing_day#16805, 200), ENSURE_REQUIREMENTS, [plan_id=1600]
(16) HashAggregate
Input [59]: [segment#16803, processing_day#16805, count#17035L, MS[0]#16870L, MS[1]#16871L, MS[2]#16872L, MS[3]#16873L, MS[4]#16874L, MS[5]#16875L, MS[6]#16876L, MS[7]#16877L, MS[8]#16878L, MS[9]#16879L, MS[10]#16880L, MS[11]#16881L, MS[12]#16882L, MS[13]#16883L, MS[14]#16884L, MS[15]#16885L, MS[16]#16886L, MS[17]#16887L, MS[18]#16888L, MS[19]#16889L, MS[20]#16890L, MS[21]#16891L, MS[22]#16892L, MS[23]#16893L, MS[24]#16894L, MS[25]#16895L, MS[26]#16896L, MS[27]#16897L, MS[28]#16898L, MS[29]#16899L, MS[30]#16900L, MS[31]#16901L, MS[32]#16902L, MS[33]#16903L, MS[34]#16904L, MS[35]#16905L, MS[36]#16906L, MS[37]#16907L, MS[38]#16908L, MS[39]#16909L, MS[40]#16910L, MS[41]#16911L, MS[42]#16912L, MS[43]#16913L, MS[44]#16914L, MS[45]#16915L, MS[46]#16916L, MS[47]#16917L, MS[48]#16918L, MS[49]#16919L, MS[50]#16920L, MS[51]#16921L, sum#17036L, sum#17037, sum#17038, count#17039L]
Keys [2]: [segment#16803, processing_day#16805]
Functions [5]: [count(1), approx_count_distinct(customer_id#16799L, 0.05, 0, 0), sum(events#16809), sum(weighted_amount#16811), avg(amount#16807)]
Aggregate Attributes [5]: [count(1)#16817L, approx_count_distinct(customer_id#16799L, 0.05, 0, 0)#16922L, sum(events#16809)#16923L, sum(weighted_amount#16811)#16924, avg(amount#16807)#16925]
Results [7]: [segment#16803, processing_day#16805, count(1)#16817L AS row_count#16812L, approx_count_distinct(customer_id#16799L, 0.05, 0, 0)#16922L AS unique_customers#16813L, sum(events#16809)#16923L AS event_sum#16814L, sum(weighted_amount#16811)#16924 AS weighted_amount_sum#16815, avg(amount#16807)#16925 AS avg_amount#16816]
(17) Exchange
Input [7]: [segment#16803, processing_day#16805, row_count#16812L, unique_customers#16813L, event_sum#16814L, weighted_amount_sum#16815, avg_amount#16816]
Arguments: rangepartitioning(segment#16803 ASC NULLS FIRST, processing_day#16805 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1603]
(18) Sort
Input [7]: [segment#16803, processing_day#16805, row_count#16812L, unique_customers#16813L, event_sum#16814L, weighted_amount_sum#16815, avg_amount#16816]
Arguments: [segment#16803 ASC NULLS FIRST, processing_day#16805 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#16803, processing_day#16805, row_count#16812L, unique_customers#16813L, event_sum#16814L, weighted_amount_sum#16815, avg_amount#16816]
Arguments: isFinalPlan=true