== 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#53111L]
Arguments: Range (12000000, 13000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#53111L % 250000) AS customer_id#53113L, concat(segment-, cast(cast((id#53111L % 12) as int) as string)) AS segment#53117, cast((id#53111L % 14) as int) AS processing_day#53119, ((cast(((id#53111L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#53121, cast((((id#53111L * 29) % 7) + 1) as int) AS events#53123]
Input [1]: [id#53111L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#53113L, segment#53117, processing_day#53119, amount#53121, events#53123, (amount#53121 * cast(events#53123 as double)) AS weighted_amount#53125]
Input [5]: [customer_id#53113L, segment#53117, processing_day#53119, amount#53121, events#53123]
(4) HashAggregate
Input [6]: [customer_id#53113L, segment#53117, processing_day#53119, amount#53121, events#53123, weighted_amount#53125]
Keys [2]: [segment#53117, processing_day#53119]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#53113L, 0.05, 0, 0), partial_sum(events#53123), partial_sum(weighted_amount#53125), partial_avg(amount#53121)]
Aggregate Attributes [57]: [count#53344L, MS[0]#53132L, MS[1]#53133L, MS[2]#53134L, MS[3]#53135L, MS[4]#53136L, MS[5]#53137L, MS[6]#53138L, MS[7]#53139L, MS[8]#53140L, MS[9]#53141L, MS[10]#53142L, MS[11]#53143L, MS[12]#53144L, MS[13]#53145L, MS[14]#53146L, MS[15]#53147L, MS[16]#53148L, MS[17]#53149L, MS[18]#53150L, MS[19]#53151L, MS[20]#53152L, MS[21]#53153L, MS[22]#53154L, MS[23]#53155L, MS[24]#53156L, MS[25]#53157L, MS[26]#53158L, MS[27]#53159L, MS[28]#53160L, MS[29]#53161L, MS[30]#53162L, MS[31]#53163L, MS[32]#53164L, MS[33]#53165L, MS[34]#53166L, MS[35]#53167L, MS[36]#53168L, MS[37]#53169L, MS[38]#53170L, MS[39]#53171L, MS[40]#53172L, MS[41]#53173L, MS[42]#53174L, MS[43]#53175L, MS[44]#53176L, MS[45]#53177L, MS[46]#53178L, MS[47]#53179L, MS[48]#53180L, MS[49]#53181L, MS[50]#53182L, MS[51]#53183L, sum#53345L, sum#53346, sum#53347, count#53348L]
Results [59]: [segment#53117, processing_day#53119, count#53349L, MS[0]#53184L, MS[1]#53185L, MS[2]#53186L, MS[3]#53187L, MS[4]#53188L, MS[5]#53189L, MS[6]#53190L, MS[7]#53191L, MS[8]#53192L, MS[9]#53193L, MS[10]#53194L, MS[11]#53195L, MS[12]#53196L, MS[13]#53197L, MS[14]#53198L, MS[15]#53199L, MS[16]#53200L, MS[17]#53201L, MS[18]#53202L, MS[19]#53203L, MS[20]#53204L, MS[21]#53205L, MS[22]#53206L, MS[23]#53207L, MS[24]#53208L, MS[25]#53209L, MS[26]#53210L, MS[27]#53211L, MS[28]#53212L, MS[29]#53213L, MS[30]#53214L, MS[31]#53215L, MS[32]#53216L, MS[33]#53217L, MS[34]#53218L, MS[35]#53219L, MS[36]#53220L, MS[37]#53221L, MS[38]#53222L, MS[39]#53223L, MS[40]#53224L, MS[41]#53225L, MS[42]#53226L, MS[43]#53227L, MS[44]#53228L, MS[45]#53229L, MS[46]#53230L, MS[47]#53231L, MS[48]#53232L, MS[49]#53233L, MS[50]#53234L, MS[51]#53235L, sum#53350L, sum#53351, sum#53352, count#53353L]
(5) Exchange
Input [59]: [segment#53117, processing_day#53119, count#53349L, MS[0]#53184L, MS[1]#53185L, MS[2]#53186L, MS[3]#53187L, MS[4]#53188L, MS[5]#53189L, MS[6]#53190L, MS[7]#53191L, MS[8]#53192L, MS[9]#53193L, MS[10]#53194L, MS[11]#53195L, MS[12]#53196L, MS[13]#53197L, MS[14]#53198L, MS[15]#53199L, MS[16]#53200L, MS[17]#53201L, MS[18]#53202L, MS[19]#53203L, MS[20]#53204L, MS[21]#53205L, MS[22]#53206L, MS[23]#53207L, MS[24]#53208L, MS[25]#53209L, MS[26]#53210L, MS[27]#53211L, MS[28]#53212L, MS[29]#53213L, MS[30]#53214L, MS[31]#53215L, MS[32]#53216L, MS[33]#53217L, MS[34]#53218L, MS[35]#53219L, MS[36]#53220L, MS[37]#53221L, MS[38]#53222L, MS[39]#53223L, MS[40]#53224L, MS[41]#53225L, MS[42]#53226L, MS[43]#53227L, MS[44]#53228L, MS[45]#53229L, MS[46]#53230L, MS[47]#53231L, MS[48]#53232L, MS[49]#53233L, MS[50]#53234L, MS[51]#53235L, sum#53350L, sum#53351, sum#53352, count#53353L]
Arguments: hashpartitioning(segment#53117, processing_day#53119, 200), ENSURE_REQUIREMENTS, [plan_id=5035]
(6) ShuffleQueryStage
Output [59]: [segment#53117, processing_day#53119, count#53349L, MS[0]#53184L, MS[1]#53185L, MS[2]#53186L, MS[3]#53187L, MS[4]#53188L, MS[5]#53189L, MS[6]#53190L, MS[7]#53191L, MS[8]#53192L, MS[9]#53193L, MS[10]#53194L, MS[11]#53195L, MS[12]#53196L, MS[13]#53197L, MS[14]#53198L, MS[15]#53199L, MS[16]#53200L, MS[17]#53201L, MS[18]#53202L, MS[19]#53203L, MS[20]#53204L, MS[21]#53205L, MS[22]#53206L, MS[23]#53207L, MS[24]#53208L, MS[25]#53209L, MS[26]#53210L, MS[27]#53211L, MS[28]#53212L, MS[29]#53213L, MS[30]#53214L, MS[31]#53215L, MS[32]#53216L, MS[33]#53217L, MS[34]#53218L, MS[35]#53219L, MS[36]#53220L, MS[37]#53221L, MS[38]#53222L, MS[39]#53223L, MS[40]#53224L, MS[41]#53225L, MS[42]#53226L, MS[43]#53227L, MS[44]#53228L, MS[45]#53229L, MS[46]#53230L, MS[47]#53231L, MS[48]#53232L, MS[49]#53233L, MS[50]#53234L, MS[51]#53235L, sum#53350L, sum#53351, sum#53352, count#53353L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#53117, processing_day#53119, count#53349L, MS[0]#53184L, MS[1]#53185L, MS[2]#53186L, MS[3]#53187L, MS[4]#53188L, MS[5]#53189L, MS[6]#53190L, MS[7]#53191L, MS[8]#53192L, MS[9]#53193L, MS[10]#53194L, MS[11]#53195L, MS[12]#53196L, MS[13]#53197L, MS[14]#53198L, MS[15]#53199L, MS[16]#53200L, MS[17]#53201L, MS[18]#53202L, MS[19]#53203L, MS[20]#53204L, MS[21]#53205L, MS[22]#53206L, MS[23]#53207L, MS[24]#53208L, MS[25]#53209L, MS[26]#53210L, MS[27]#53211L, MS[28]#53212L, MS[29]#53213L, MS[30]#53214L, MS[31]#53215L, MS[32]#53216L, MS[33]#53217L, MS[34]#53218L, MS[35]#53219L, MS[36]#53220L, MS[37]#53221L, MS[38]#53222L, MS[39]#53223L, MS[40]#53224L, MS[41]#53225L, MS[42]#53226L, MS[43]#53227L, MS[44]#53228L, MS[45]#53229L, MS[46]#53230L, MS[47]#53231L, MS[48]#53232L, MS[49]#53233L, MS[50]#53234L, MS[51]#53235L, sum#53350L, sum#53351, sum#53352, count#53353L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#53117, processing_day#53119, count#53349L, MS[0]#53184L, MS[1]#53185L, MS[2]#53186L, MS[3]#53187L, MS[4]#53188L, MS[5]#53189L, MS[6]#53190L, MS[7]#53191L, MS[8]#53192L, MS[9]#53193L, MS[10]#53194L, MS[11]#53195L, MS[12]#53196L, MS[13]#53197L, MS[14]#53198L, MS[15]#53199L, MS[16]#53200L, MS[17]#53201L, MS[18]#53202L, MS[19]#53203L, MS[20]#53204L, MS[21]#53205L, MS[22]#53206L, MS[23]#53207L, MS[24]#53208L, MS[25]#53209L, MS[26]#53210L, MS[27]#53211L, MS[28]#53212L, MS[29]#53213L, MS[30]#53214L, MS[31]#53215L, MS[32]#53216L, MS[33]#53217L, MS[34]#53218L, MS[35]#53219L, MS[36]#53220L, MS[37]#53221L, MS[38]#53222L, MS[39]#53223L, MS[40]#53224L, MS[41]#53225L, MS[42]#53226L, MS[43]#53227L, MS[44]#53228L, MS[45]#53229L, MS[46]#53230L, MS[47]#53231L, MS[48]#53232L, MS[49]#53233L, MS[50]#53234L, MS[51]#53235L, sum#53350L, sum#53351, sum#53352, count#53353L]
Keys [2]: [segment#53117, processing_day#53119]
Functions [5]: [count(1), approx_count_distinct(customer_id#53113L, 0.05, 0, 0), sum(events#53123), sum(weighted_amount#53125), avg(amount#53121)]
Aggregate Attributes [5]: [count(1)#53131L, approx_count_distinct(customer_id#53113L, 0.05, 0, 0)#53236L, sum(events#53123)#53237L, sum(weighted_amount#53125)#53238, avg(amount#53121)#53239]
Results [7]: [segment#53117, processing_day#53119, count(1)#53131L AS row_count#53126L, approx_count_distinct(customer_id#53113L, 0.05, 0, 0)#53236L AS unique_customers#53127L, sum(events#53123)#53237L AS event_sum#53128L, sum(weighted_amount#53125)#53238 AS weighted_amount_sum#53129, avg(amount#53121)#53239 AS avg_amount#53130]
(9) Exchange
Input [7]: [segment#53117, processing_day#53119, row_count#53126L, unique_customers#53127L, event_sum#53128L, weighted_amount_sum#53129, avg_amount#53130]
Arguments: rangepartitioning(segment#53117 ASC NULLS FIRST, processing_day#53119 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5057]
(10) ShuffleQueryStage
Output [7]: [segment#53117, processing_day#53119, row_count#53126L, unique_customers#53127L, event_sum#53128L, weighted_amount_sum#53129, avg_amount#53130]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#53117, processing_day#53119, row_count#53126L, unique_customers#53127L, event_sum#53128L, weighted_amount_sum#53129, avg_amount#53130]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#53117, processing_day#53119, row_count#53126L, unique_customers#53127L, event_sum#53128L, weighted_amount_sum#53129, avg_amount#53130]
Arguments: [segment#53117 ASC NULLS FIRST, processing_day#53119 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#53117, processing_day#53119, row_count#53126L, unique_customers#53127L, event_sum#53128L, weighted_amount_sum#53129, avg_amount#53130]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#53113L, segment#53117, processing_day#53119, amount#53121, events#53123, weighted_amount#53125]
Keys [2]: [segment#53117, processing_day#53119]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#53113L, 0.05, 0, 0), partial_sum(events#53123), partial_sum(weighted_amount#53125), partial_avg(amount#53121)]
Aggregate Attributes [57]: [count#53344L, MS[0]#53132L, MS[1]#53133L, MS[2]#53134L, MS[3]#53135L, MS[4]#53136L, MS[5]#53137L, MS[6]#53138L, MS[7]#53139L, MS[8]#53140L, MS[9]#53141L, MS[10]#53142L, MS[11]#53143L, MS[12]#53144L, MS[13]#53145L, MS[14]#53146L, MS[15]#53147L, MS[16]#53148L, MS[17]#53149L, MS[18]#53150L, MS[19]#53151L, MS[20]#53152L, MS[21]#53153L, MS[22]#53154L, MS[23]#53155L, MS[24]#53156L, MS[25]#53157L, MS[26]#53158L, MS[27]#53159L, MS[28]#53160L, MS[29]#53161L, MS[30]#53162L, MS[31]#53163L, MS[32]#53164L, MS[33]#53165L, MS[34]#53166L, MS[35]#53167L, MS[36]#53168L, MS[37]#53169L, MS[38]#53170L, MS[39]#53171L, MS[40]#53172L, MS[41]#53173L, MS[42]#53174L, MS[43]#53175L, MS[44]#53176L, MS[45]#53177L, MS[46]#53178L, MS[47]#53179L, MS[48]#53180L, MS[49]#53181L, MS[50]#53182L, MS[51]#53183L, sum#53345L, sum#53346, sum#53347, count#53348L]
Results [59]: [segment#53117, processing_day#53119, count#53349L, MS[0]#53184L, MS[1]#53185L, MS[2]#53186L, MS[3]#53187L, MS[4]#53188L, MS[5]#53189L, MS[6]#53190L, MS[7]#53191L, MS[8]#53192L, MS[9]#53193L, MS[10]#53194L, MS[11]#53195L, MS[12]#53196L, MS[13]#53197L, MS[14]#53198L, MS[15]#53199L, MS[16]#53200L, MS[17]#53201L, MS[18]#53202L, MS[19]#53203L, MS[20]#53204L, MS[21]#53205L, MS[22]#53206L, MS[23]#53207L, MS[24]#53208L, MS[25]#53209L, MS[26]#53210L, MS[27]#53211L, MS[28]#53212L, MS[29]#53213L, MS[30]#53214L, MS[31]#53215L, MS[32]#53216L, MS[33]#53217L, MS[34]#53218L, MS[35]#53219L, MS[36]#53220L, MS[37]#53221L, MS[38]#53222L, MS[39]#53223L, MS[40]#53224L, MS[41]#53225L, MS[42]#53226L, MS[43]#53227L, MS[44]#53228L, MS[45]#53229L, MS[46]#53230L, MS[47]#53231L, MS[48]#53232L, MS[49]#53233L, MS[50]#53234L, MS[51]#53235L, sum#53350L, sum#53351, sum#53352, count#53353L]
(15) Exchange
Input [59]: [segment#53117, processing_day#53119, count#53349L, MS[0]#53184L, MS[1]#53185L, MS[2]#53186L, MS[3]#53187L, MS[4]#53188L, MS[5]#53189L, MS[6]#53190L, MS[7]#53191L, MS[8]#53192L, MS[9]#53193L, MS[10]#53194L, MS[11]#53195L, MS[12]#53196L, MS[13]#53197L, MS[14]#53198L, MS[15]#53199L, MS[16]#53200L, MS[17]#53201L, MS[18]#53202L, MS[19]#53203L, MS[20]#53204L, MS[21]#53205L, MS[22]#53206L, MS[23]#53207L, MS[24]#53208L, MS[25]#53209L, MS[26]#53210L, MS[27]#53211L, MS[28]#53212L, MS[29]#53213L, MS[30]#53214L, MS[31]#53215L, MS[32]#53216L, MS[33]#53217L, MS[34]#53218L, MS[35]#53219L, MS[36]#53220L, MS[37]#53221L, MS[38]#53222L, MS[39]#53223L, MS[40]#53224L, MS[41]#53225L, MS[42]#53226L, MS[43]#53227L, MS[44]#53228L, MS[45]#53229L, MS[46]#53230L, MS[47]#53231L, MS[48]#53232L, MS[49]#53233L, MS[50]#53234L, MS[51]#53235L, sum#53350L, sum#53351, sum#53352, count#53353L]
Arguments: hashpartitioning(segment#53117, processing_day#53119, 200), ENSURE_REQUIREMENTS, [plan_id=5015]
(16) HashAggregate
Input [59]: [segment#53117, processing_day#53119, count#53349L, MS[0]#53184L, MS[1]#53185L, MS[2]#53186L, MS[3]#53187L, MS[4]#53188L, MS[5]#53189L, MS[6]#53190L, MS[7]#53191L, MS[8]#53192L, MS[9]#53193L, MS[10]#53194L, MS[11]#53195L, MS[12]#53196L, MS[13]#53197L, MS[14]#53198L, MS[15]#53199L, MS[16]#53200L, MS[17]#53201L, MS[18]#53202L, MS[19]#53203L, MS[20]#53204L, MS[21]#53205L, MS[22]#53206L, MS[23]#53207L, MS[24]#53208L, MS[25]#53209L, MS[26]#53210L, MS[27]#53211L, MS[28]#53212L, MS[29]#53213L, MS[30]#53214L, MS[31]#53215L, MS[32]#53216L, MS[33]#53217L, MS[34]#53218L, MS[35]#53219L, MS[36]#53220L, MS[37]#53221L, MS[38]#53222L, MS[39]#53223L, MS[40]#53224L, MS[41]#53225L, MS[42]#53226L, MS[43]#53227L, MS[44]#53228L, MS[45]#53229L, MS[46]#53230L, MS[47]#53231L, MS[48]#53232L, MS[49]#53233L, MS[50]#53234L, MS[51]#53235L, sum#53350L, sum#53351, sum#53352, count#53353L]
Keys [2]: [segment#53117, processing_day#53119]
Functions [5]: [count(1), approx_count_distinct(customer_id#53113L, 0.05, 0, 0), sum(events#53123), sum(weighted_amount#53125), avg(amount#53121)]
Aggregate Attributes [5]: [count(1)#53131L, approx_count_distinct(customer_id#53113L, 0.05, 0, 0)#53236L, sum(events#53123)#53237L, sum(weighted_amount#53125)#53238, avg(amount#53121)#53239]
Results [7]: [segment#53117, processing_day#53119, count(1)#53131L AS row_count#53126L, approx_count_distinct(customer_id#53113L, 0.05, 0, 0)#53236L AS unique_customers#53127L, sum(events#53123)#53237L AS event_sum#53128L, sum(weighted_amount#53125)#53238 AS weighted_amount_sum#53129, avg(amount#53121)#53239 AS avg_amount#53130]
(17) Exchange
Input [7]: [segment#53117, processing_day#53119, row_count#53126L, unique_customers#53127L, event_sum#53128L, weighted_amount_sum#53129, avg_amount#53130]
Arguments: rangepartitioning(segment#53117 ASC NULLS FIRST, processing_day#53119 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5018]
(18) Sort
Input [7]: [segment#53117, processing_day#53119, row_count#53126L, unique_customers#53127L, event_sum#53128L, weighted_amount_sum#53129, avg_amount#53130]
Arguments: [segment#53117 ASC NULLS FIRST, processing_day#53119 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#53117, processing_day#53119, row_count#53126L, unique_customers#53127L, event_sum#53128L, weighted_amount_sum#53129, avg_amount#53130]
Arguments: isFinalPlan=true