== 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#86771L]
Arguments: Range (2000000, 3000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#86771L % 250000) AS customer_id#86773L, concat(segment-, cast(cast((id#86771L % 12) as int) as string)) AS segment#86777, cast((id#86771L % 14) as int) AS processing_day#86779, ((cast(((id#86771L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#86781, cast((((id#86771L * 29) % 7) + 1) as int) AS events#86783]
Input [1]: [id#86771L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#86773L, segment#86777, processing_day#86779, amount#86781, events#86783, (amount#86781 * cast(events#86783 as double)) AS weighted_amount#86785]
Input [5]: [customer_id#86773L, segment#86777, processing_day#86779, amount#86781, events#86783]
(4) HashAggregate
Input [6]: [customer_id#86773L, segment#86777, processing_day#86779, amount#86781, events#86783, weighted_amount#86785]
Keys [2]: [segment#86777, processing_day#86779]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#86773L, 0.05, 0, 0), partial_sum(events#86783), partial_sum(weighted_amount#86785), partial_avg(amount#86781)]
Aggregate Attributes [57]: [count#87004L, MS[0]#86792L, MS[1]#86793L, MS[2]#86794L, MS[3]#86795L, MS[4]#86796L, MS[5]#86797L, MS[6]#86798L, MS[7]#86799L, MS[8]#86800L, MS[9]#86801L, MS[10]#86802L, MS[11]#86803L, MS[12]#86804L, MS[13]#86805L, MS[14]#86806L, MS[15]#86807L, MS[16]#86808L, MS[17]#86809L, MS[18]#86810L, MS[19]#86811L, MS[20]#86812L, MS[21]#86813L, MS[22]#86814L, MS[23]#86815L, MS[24]#86816L, MS[25]#86817L, MS[26]#86818L, MS[27]#86819L, MS[28]#86820L, MS[29]#86821L, MS[30]#86822L, MS[31]#86823L, MS[32]#86824L, MS[33]#86825L, MS[34]#86826L, MS[35]#86827L, MS[36]#86828L, MS[37]#86829L, MS[38]#86830L, MS[39]#86831L, MS[40]#86832L, MS[41]#86833L, MS[42]#86834L, MS[43]#86835L, MS[44]#86836L, MS[45]#86837L, MS[46]#86838L, MS[47]#86839L, MS[48]#86840L, MS[49]#86841L, MS[50]#86842L, MS[51]#86843L, sum#87005L, sum#87006, sum#87007, count#87008L]
Results [59]: [segment#86777, processing_day#86779, count#87009L, MS[0]#86844L, MS[1]#86845L, MS[2]#86846L, MS[3]#86847L, MS[4]#86848L, MS[5]#86849L, MS[6]#86850L, MS[7]#86851L, MS[8]#86852L, MS[9]#86853L, MS[10]#86854L, MS[11]#86855L, MS[12]#86856L, MS[13]#86857L, MS[14]#86858L, MS[15]#86859L, MS[16]#86860L, MS[17]#86861L, MS[18]#86862L, MS[19]#86863L, MS[20]#86864L, MS[21]#86865L, MS[22]#86866L, MS[23]#86867L, MS[24]#86868L, MS[25]#86869L, MS[26]#86870L, MS[27]#86871L, MS[28]#86872L, MS[29]#86873L, MS[30]#86874L, MS[31]#86875L, MS[32]#86876L, MS[33]#86877L, MS[34]#86878L, MS[35]#86879L, MS[36]#86880L, MS[37]#86881L, MS[38]#86882L, MS[39]#86883L, MS[40]#86884L, MS[41]#86885L, MS[42]#86886L, MS[43]#86887L, MS[44]#86888L, MS[45]#86889L, MS[46]#86890L, MS[47]#86891L, MS[48]#86892L, MS[49]#86893L, MS[50]#86894L, MS[51]#86895L, sum#87010L, sum#87011, sum#87012, count#87013L]
(5) Exchange
Input [59]: [segment#86777, processing_day#86779, count#87009L, MS[0]#86844L, MS[1]#86845L, MS[2]#86846L, MS[3]#86847L, MS[4]#86848L, MS[5]#86849L, MS[6]#86850L, MS[7]#86851L, MS[8]#86852L, MS[9]#86853L, MS[10]#86854L, MS[11]#86855L, MS[12]#86856L, MS[13]#86857L, MS[14]#86858L, MS[15]#86859L, MS[16]#86860L, MS[17]#86861L, MS[18]#86862L, MS[19]#86863L, MS[20]#86864L, MS[21]#86865L, MS[22]#86866L, MS[23]#86867L, MS[24]#86868L, MS[25]#86869L, MS[26]#86870L, MS[27]#86871L, MS[28]#86872L, MS[29]#86873L, MS[30]#86874L, MS[31]#86875L, MS[32]#86876L, MS[33]#86877L, MS[34]#86878L, MS[35]#86879L, MS[36]#86880L, MS[37]#86881L, MS[38]#86882L, MS[39]#86883L, MS[40]#86884L, MS[41]#86885L, MS[42]#86886L, MS[43]#86887L, MS[44]#86888L, MS[45]#86889L, MS[46]#86890L, MS[47]#86891L, MS[48]#86892L, MS[49]#86893L, MS[50]#86894L, MS[51]#86895L, sum#87010L, sum#87011, sum#87012, count#87013L]
Arguments: hashpartitioning(segment#86777, processing_day#86779, 200), ENSURE_REQUIREMENTS, [plan_id=8201]
(6) ShuffleQueryStage
Output [59]: [segment#86777, processing_day#86779, count#87009L, MS[0]#86844L, MS[1]#86845L, MS[2]#86846L, MS[3]#86847L, MS[4]#86848L, MS[5]#86849L, MS[6]#86850L, MS[7]#86851L, MS[8]#86852L, MS[9]#86853L, MS[10]#86854L, MS[11]#86855L, MS[12]#86856L, MS[13]#86857L, MS[14]#86858L, MS[15]#86859L, MS[16]#86860L, MS[17]#86861L, MS[18]#86862L, MS[19]#86863L, MS[20]#86864L, MS[21]#86865L, MS[22]#86866L, MS[23]#86867L, MS[24]#86868L, MS[25]#86869L, MS[26]#86870L, MS[27]#86871L, MS[28]#86872L, MS[29]#86873L, MS[30]#86874L, MS[31]#86875L, MS[32]#86876L, MS[33]#86877L, MS[34]#86878L, MS[35]#86879L, MS[36]#86880L, MS[37]#86881L, MS[38]#86882L, MS[39]#86883L, MS[40]#86884L, MS[41]#86885L, MS[42]#86886L, MS[43]#86887L, MS[44]#86888L, MS[45]#86889L, MS[46]#86890L, MS[47]#86891L, MS[48]#86892L, MS[49]#86893L, MS[50]#86894L, MS[51]#86895L, sum#87010L, sum#87011, sum#87012, count#87013L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#86777, processing_day#86779, count#87009L, MS[0]#86844L, MS[1]#86845L, MS[2]#86846L, MS[3]#86847L, MS[4]#86848L, MS[5]#86849L, MS[6]#86850L, MS[7]#86851L, MS[8]#86852L, MS[9]#86853L, MS[10]#86854L, MS[11]#86855L, MS[12]#86856L, MS[13]#86857L, MS[14]#86858L, MS[15]#86859L, MS[16]#86860L, MS[17]#86861L, MS[18]#86862L, MS[19]#86863L, MS[20]#86864L, MS[21]#86865L, MS[22]#86866L, MS[23]#86867L, MS[24]#86868L, MS[25]#86869L, MS[26]#86870L, MS[27]#86871L, MS[28]#86872L, MS[29]#86873L, MS[30]#86874L, MS[31]#86875L, MS[32]#86876L, MS[33]#86877L, MS[34]#86878L, MS[35]#86879L, MS[36]#86880L, MS[37]#86881L, MS[38]#86882L, MS[39]#86883L, MS[40]#86884L, MS[41]#86885L, MS[42]#86886L, MS[43]#86887L, MS[44]#86888L, MS[45]#86889L, MS[46]#86890L, MS[47]#86891L, MS[48]#86892L, MS[49]#86893L, MS[50]#86894L, MS[51]#86895L, sum#87010L, sum#87011, sum#87012, count#87013L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#86777, processing_day#86779, count#87009L, MS[0]#86844L, MS[1]#86845L, MS[2]#86846L, MS[3]#86847L, MS[4]#86848L, MS[5]#86849L, MS[6]#86850L, MS[7]#86851L, MS[8]#86852L, MS[9]#86853L, MS[10]#86854L, MS[11]#86855L, MS[12]#86856L, MS[13]#86857L, MS[14]#86858L, MS[15]#86859L, MS[16]#86860L, MS[17]#86861L, MS[18]#86862L, MS[19]#86863L, MS[20]#86864L, MS[21]#86865L, MS[22]#86866L, MS[23]#86867L, MS[24]#86868L, MS[25]#86869L, MS[26]#86870L, MS[27]#86871L, MS[28]#86872L, MS[29]#86873L, MS[30]#86874L, MS[31]#86875L, MS[32]#86876L, MS[33]#86877L, MS[34]#86878L, MS[35]#86879L, MS[36]#86880L, MS[37]#86881L, MS[38]#86882L, MS[39]#86883L, MS[40]#86884L, MS[41]#86885L, MS[42]#86886L, MS[43]#86887L, MS[44]#86888L, MS[45]#86889L, MS[46]#86890L, MS[47]#86891L, MS[48]#86892L, MS[49]#86893L, MS[50]#86894L, MS[51]#86895L, sum#87010L, sum#87011, sum#87012, count#87013L]
Keys [2]: [segment#86777, processing_day#86779]
Functions [5]: [count(1), approx_count_distinct(customer_id#86773L, 0.05, 0, 0), sum(events#86783), sum(weighted_amount#86785), avg(amount#86781)]
Aggregate Attributes [5]: [count(1)#86791L, approx_count_distinct(customer_id#86773L, 0.05, 0, 0)#86896L, sum(events#86783)#86897L, sum(weighted_amount#86785)#86898, avg(amount#86781)#86899]
Results [7]: [segment#86777, processing_day#86779, count(1)#86791L AS row_count#86786L, approx_count_distinct(customer_id#86773L, 0.05, 0, 0)#86896L AS unique_customers#86787L, sum(events#86783)#86897L AS event_sum#86788L, sum(weighted_amount#86785)#86898 AS weighted_amount_sum#86789, avg(amount#86781)#86899 AS avg_amount#86790]
(9) Exchange
Input [7]: [segment#86777, processing_day#86779, row_count#86786L, unique_customers#86787L, event_sum#86788L, weighted_amount_sum#86789, avg_amount#86790]
Arguments: rangepartitioning(segment#86777 ASC NULLS FIRST, processing_day#86779 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8223]
(10) ShuffleQueryStage
Output [7]: [segment#86777, processing_day#86779, row_count#86786L, unique_customers#86787L, event_sum#86788L, weighted_amount_sum#86789, avg_amount#86790]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#86777, processing_day#86779, row_count#86786L, unique_customers#86787L, event_sum#86788L, weighted_amount_sum#86789, avg_amount#86790]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#86777, processing_day#86779, row_count#86786L, unique_customers#86787L, event_sum#86788L, weighted_amount_sum#86789, avg_amount#86790]
Arguments: [segment#86777 ASC NULLS FIRST, processing_day#86779 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#86777, processing_day#86779, row_count#86786L, unique_customers#86787L, event_sum#86788L, weighted_amount_sum#86789, avg_amount#86790]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#86773L, segment#86777, processing_day#86779, amount#86781, events#86783, weighted_amount#86785]
Keys [2]: [segment#86777, processing_day#86779]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#86773L, 0.05, 0, 0), partial_sum(events#86783), partial_sum(weighted_amount#86785), partial_avg(amount#86781)]
Aggregate Attributes [57]: [count#87004L, MS[0]#86792L, MS[1]#86793L, MS[2]#86794L, MS[3]#86795L, MS[4]#86796L, MS[5]#86797L, MS[6]#86798L, MS[7]#86799L, MS[8]#86800L, MS[9]#86801L, MS[10]#86802L, MS[11]#86803L, MS[12]#86804L, MS[13]#86805L, MS[14]#86806L, MS[15]#86807L, MS[16]#86808L, MS[17]#86809L, MS[18]#86810L, MS[19]#86811L, MS[20]#86812L, MS[21]#86813L, MS[22]#86814L, MS[23]#86815L, MS[24]#86816L, MS[25]#86817L, MS[26]#86818L, MS[27]#86819L, MS[28]#86820L, MS[29]#86821L, MS[30]#86822L, MS[31]#86823L, MS[32]#86824L, MS[33]#86825L, MS[34]#86826L, MS[35]#86827L, MS[36]#86828L, MS[37]#86829L, MS[38]#86830L, MS[39]#86831L, MS[40]#86832L, MS[41]#86833L, MS[42]#86834L, MS[43]#86835L, MS[44]#86836L, MS[45]#86837L, MS[46]#86838L, MS[47]#86839L, MS[48]#86840L, MS[49]#86841L, MS[50]#86842L, MS[51]#86843L, sum#87005L, sum#87006, sum#87007, count#87008L]
Results [59]: [segment#86777, processing_day#86779, count#87009L, MS[0]#86844L, MS[1]#86845L, MS[2]#86846L, MS[3]#86847L, MS[4]#86848L, MS[5]#86849L, MS[6]#86850L, MS[7]#86851L, MS[8]#86852L, MS[9]#86853L, MS[10]#86854L, MS[11]#86855L, MS[12]#86856L, MS[13]#86857L, MS[14]#86858L, MS[15]#86859L, MS[16]#86860L, MS[17]#86861L, MS[18]#86862L, MS[19]#86863L, MS[20]#86864L, MS[21]#86865L, MS[22]#86866L, MS[23]#86867L, MS[24]#86868L, MS[25]#86869L, MS[26]#86870L, MS[27]#86871L, MS[28]#86872L, MS[29]#86873L, MS[30]#86874L, MS[31]#86875L, MS[32]#86876L, MS[33]#86877L, MS[34]#86878L, MS[35]#86879L, MS[36]#86880L, MS[37]#86881L, MS[38]#86882L, MS[39]#86883L, MS[40]#86884L, MS[41]#86885L, MS[42]#86886L, MS[43]#86887L, MS[44]#86888L, MS[45]#86889L, MS[46]#86890L, MS[47]#86891L, MS[48]#86892L, MS[49]#86893L, MS[50]#86894L, MS[51]#86895L, sum#87010L, sum#87011, sum#87012, count#87013L]
(15) Exchange
Input [59]: [segment#86777, processing_day#86779, count#87009L, MS[0]#86844L, MS[1]#86845L, MS[2]#86846L, MS[3]#86847L, MS[4]#86848L, MS[5]#86849L, MS[6]#86850L, MS[7]#86851L, MS[8]#86852L, MS[9]#86853L, MS[10]#86854L, MS[11]#86855L, MS[12]#86856L, MS[13]#86857L, MS[14]#86858L, MS[15]#86859L, MS[16]#86860L, MS[17]#86861L, MS[18]#86862L, MS[19]#86863L, MS[20]#86864L, MS[21]#86865L, MS[22]#86866L, MS[23]#86867L, MS[24]#86868L, MS[25]#86869L, MS[26]#86870L, MS[27]#86871L, MS[28]#86872L, MS[29]#86873L, MS[30]#86874L, MS[31]#86875L, MS[32]#86876L, MS[33]#86877L, MS[34]#86878L, MS[35]#86879L, MS[36]#86880L, MS[37]#86881L, MS[38]#86882L, MS[39]#86883L, MS[40]#86884L, MS[41]#86885L, MS[42]#86886L, MS[43]#86887L, MS[44]#86888L, MS[45]#86889L, MS[46]#86890L, MS[47]#86891L, MS[48]#86892L, MS[49]#86893L, MS[50]#86894L, MS[51]#86895L, sum#87010L, sum#87011, sum#87012, count#87013L]
Arguments: hashpartitioning(segment#86777, processing_day#86779, 200), ENSURE_REQUIREMENTS, [plan_id=8181]
(16) HashAggregate
Input [59]: [segment#86777, processing_day#86779, count#87009L, MS[0]#86844L, MS[1]#86845L, MS[2]#86846L, MS[3]#86847L, MS[4]#86848L, MS[5]#86849L, MS[6]#86850L, MS[7]#86851L, MS[8]#86852L, MS[9]#86853L, MS[10]#86854L, MS[11]#86855L, MS[12]#86856L, MS[13]#86857L, MS[14]#86858L, MS[15]#86859L, MS[16]#86860L, MS[17]#86861L, MS[18]#86862L, MS[19]#86863L, MS[20]#86864L, MS[21]#86865L, MS[22]#86866L, MS[23]#86867L, MS[24]#86868L, MS[25]#86869L, MS[26]#86870L, MS[27]#86871L, MS[28]#86872L, MS[29]#86873L, MS[30]#86874L, MS[31]#86875L, MS[32]#86876L, MS[33]#86877L, MS[34]#86878L, MS[35]#86879L, MS[36]#86880L, MS[37]#86881L, MS[38]#86882L, MS[39]#86883L, MS[40]#86884L, MS[41]#86885L, MS[42]#86886L, MS[43]#86887L, MS[44]#86888L, MS[45]#86889L, MS[46]#86890L, MS[47]#86891L, MS[48]#86892L, MS[49]#86893L, MS[50]#86894L, MS[51]#86895L, sum#87010L, sum#87011, sum#87012, count#87013L]
Keys [2]: [segment#86777, processing_day#86779]
Functions [5]: [count(1), approx_count_distinct(customer_id#86773L, 0.05, 0, 0), sum(events#86783), sum(weighted_amount#86785), avg(amount#86781)]
Aggregate Attributes [5]: [count(1)#86791L, approx_count_distinct(customer_id#86773L, 0.05, 0, 0)#86896L, sum(events#86783)#86897L, sum(weighted_amount#86785)#86898, avg(amount#86781)#86899]
Results [7]: [segment#86777, processing_day#86779, count(1)#86791L AS row_count#86786L, approx_count_distinct(customer_id#86773L, 0.05, 0, 0)#86896L AS unique_customers#86787L, sum(events#86783)#86897L AS event_sum#86788L, sum(weighted_amount#86785)#86898 AS weighted_amount_sum#86789, avg(amount#86781)#86899 AS avg_amount#86790]
(17) Exchange
Input [7]: [segment#86777, processing_day#86779, row_count#86786L, unique_customers#86787L, event_sum#86788L, weighted_amount_sum#86789, avg_amount#86790]
Arguments: rangepartitioning(segment#86777 ASC NULLS FIRST, processing_day#86779 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8184]
(18) Sort
Input [7]: [segment#86777, processing_day#86779, row_count#86786L, unique_customers#86787L, event_sum#86788L, weighted_amount_sum#86789, avg_amount#86790]
Arguments: [segment#86777 ASC NULLS FIRST, processing_day#86779 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#86777, processing_day#86779, row_count#86786L, unique_customers#86787L, event_sum#86788L, weighted_amount_sum#86789, avg_amount#86790]
Arguments: isFinalPlan=true