== 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#36281L]
Arguments: Range (17000000, 18000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#36281L % 250000) AS customer_id#36283L, concat(segment-, cast(cast((id#36281L % 12) as int) as string)) AS segment#36287, cast((id#36281L % 14) as int) AS processing_day#36289, ((cast(((id#36281L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#36291, cast((((id#36281L * 29) % 7) + 1) as int) AS events#36293]
Input [1]: [id#36281L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#36283L, segment#36287, processing_day#36289, amount#36291, events#36293, (amount#36291 * cast(events#36293 as double)) AS weighted_amount#36295]
Input [5]: [customer_id#36283L, segment#36287, processing_day#36289, amount#36291, events#36293]
(4) HashAggregate
Input [6]: [customer_id#36283L, segment#36287, processing_day#36289, amount#36291, events#36293, weighted_amount#36295]
Keys [2]: [segment#36287, processing_day#36289]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#36283L, 0.05, 0, 0), partial_sum(events#36293), partial_sum(weighted_amount#36295), partial_avg(amount#36291)]
Aggregate Attributes [57]: [count#36514L, MS[0]#36302L, MS[1]#36303L, MS[2]#36304L, MS[3]#36305L, MS[4]#36306L, MS[5]#36307L, MS[6]#36308L, MS[7]#36309L, MS[8]#36310L, MS[9]#36311L, MS[10]#36312L, MS[11]#36313L, MS[12]#36314L, MS[13]#36315L, MS[14]#36316L, MS[15]#36317L, MS[16]#36318L, MS[17]#36319L, MS[18]#36320L, MS[19]#36321L, MS[20]#36322L, MS[21]#36323L, MS[22]#36324L, MS[23]#36325L, MS[24]#36326L, MS[25]#36327L, MS[26]#36328L, MS[27]#36329L, MS[28]#36330L, MS[29]#36331L, MS[30]#36332L, MS[31]#36333L, MS[32]#36334L, MS[33]#36335L, MS[34]#36336L, MS[35]#36337L, MS[36]#36338L, MS[37]#36339L, MS[38]#36340L, MS[39]#36341L, MS[40]#36342L, MS[41]#36343L, MS[42]#36344L, MS[43]#36345L, MS[44]#36346L, MS[45]#36347L, MS[46]#36348L, MS[47]#36349L, MS[48]#36350L, MS[49]#36351L, MS[50]#36352L, MS[51]#36353L, sum#36515L, sum#36516, sum#36517, count#36518L]
Results [59]: [segment#36287, processing_day#36289, count#36519L, MS[0]#36354L, MS[1]#36355L, MS[2]#36356L, MS[3]#36357L, MS[4]#36358L, MS[5]#36359L, MS[6]#36360L, MS[7]#36361L, MS[8]#36362L, MS[9]#36363L, MS[10]#36364L, MS[11]#36365L, MS[12]#36366L, MS[13]#36367L, MS[14]#36368L, MS[15]#36369L, MS[16]#36370L, MS[17]#36371L, MS[18]#36372L, MS[19]#36373L, MS[20]#36374L, MS[21]#36375L, MS[22]#36376L, MS[23]#36377L, MS[24]#36378L, MS[25]#36379L, MS[26]#36380L, MS[27]#36381L, MS[28]#36382L, MS[29]#36383L, MS[30]#36384L, MS[31]#36385L, MS[32]#36386L, MS[33]#36387L, MS[34]#36388L, MS[35]#36389L, MS[36]#36390L, MS[37]#36391L, MS[38]#36392L, MS[39]#36393L, MS[40]#36394L, MS[41]#36395L, MS[42]#36396L, MS[43]#36397L, MS[44]#36398L, MS[45]#36399L, MS[46]#36400L, MS[47]#36401L, MS[48]#36402L, MS[49]#36403L, MS[50]#36404L, MS[51]#36405L, sum#36520L, sum#36521, sum#36522, count#36523L]
(5) Exchange
Input [59]: [segment#36287, processing_day#36289, count#36519L, MS[0]#36354L, MS[1]#36355L, MS[2]#36356L, MS[3]#36357L, MS[4]#36358L, MS[5]#36359L, MS[6]#36360L, MS[7]#36361L, MS[8]#36362L, MS[9]#36363L, MS[10]#36364L, MS[11]#36365L, MS[12]#36366L, MS[13]#36367L, MS[14]#36368L, MS[15]#36369L, MS[16]#36370L, MS[17]#36371L, MS[18]#36372L, MS[19]#36373L, MS[20]#36374L, MS[21]#36375L, MS[22]#36376L, MS[23]#36377L, MS[24]#36378L, MS[25]#36379L, MS[26]#36380L, MS[27]#36381L, MS[28]#36382L, MS[29]#36383L, MS[30]#36384L, MS[31]#36385L, MS[32]#36386L, MS[33]#36387L, MS[34]#36388L, MS[35]#36389L, MS[36]#36390L, MS[37]#36391L, MS[38]#36392L, MS[39]#36393L, MS[40]#36394L, MS[41]#36395L, MS[42]#36396L, MS[43]#36397L, MS[44]#36398L, MS[45]#36399L, MS[46]#36400L, MS[47]#36401L, MS[48]#36402L, MS[49]#36403L, MS[50]#36404L, MS[51]#36405L, sum#36520L, sum#36521, sum#36522, count#36523L]
Arguments: hashpartitioning(segment#36287, processing_day#36289, 200), ENSURE_REQUIREMENTS, [plan_id=3452]
(6) ShuffleQueryStage
Output [59]: [segment#36287, processing_day#36289, count#36519L, MS[0]#36354L, MS[1]#36355L, MS[2]#36356L, MS[3]#36357L, MS[4]#36358L, MS[5]#36359L, MS[6]#36360L, MS[7]#36361L, MS[8]#36362L, MS[9]#36363L, MS[10]#36364L, MS[11]#36365L, MS[12]#36366L, MS[13]#36367L, MS[14]#36368L, MS[15]#36369L, MS[16]#36370L, MS[17]#36371L, MS[18]#36372L, MS[19]#36373L, MS[20]#36374L, MS[21]#36375L, MS[22]#36376L, MS[23]#36377L, MS[24]#36378L, MS[25]#36379L, MS[26]#36380L, MS[27]#36381L, MS[28]#36382L, MS[29]#36383L, MS[30]#36384L, MS[31]#36385L, MS[32]#36386L, MS[33]#36387L, MS[34]#36388L, MS[35]#36389L, MS[36]#36390L, MS[37]#36391L, MS[38]#36392L, MS[39]#36393L, MS[40]#36394L, MS[41]#36395L, MS[42]#36396L, MS[43]#36397L, MS[44]#36398L, MS[45]#36399L, MS[46]#36400L, MS[47]#36401L, MS[48]#36402L, MS[49]#36403L, MS[50]#36404L, MS[51]#36405L, sum#36520L, sum#36521, sum#36522, count#36523L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#36287, processing_day#36289, count#36519L, MS[0]#36354L, MS[1]#36355L, MS[2]#36356L, MS[3]#36357L, MS[4]#36358L, MS[5]#36359L, MS[6]#36360L, MS[7]#36361L, MS[8]#36362L, MS[9]#36363L, MS[10]#36364L, MS[11]#36365L, MS[12]#36366L, MS[13]#36367L, MS[14]#36368L, MS[15]#36369L, MS[16]#36370L, MS[17]#36371L, MS[18]#36372L, MS[19]#36373L, MS[20]#36374L, MS[21]#36375L, MS[22]#36376L, MS[23]#36377L, MS[24]#36378L, MS[25]#36379L, MS[26]#36380L, MS[27]#36381L, MS[28]#36382L, MS[29]#36383L, MS[30]#36384L, MS[31]#36385L, MS[32]#36386L, MS[33]#36387L, MS[34]#36388L, MS[35]#36389L, MS[36]#36390L, MS[37]#36391L, MS[38]#36392L, MS[39]#36393L, MS[40]#36394L, MS[41]#36395L, MS[42]#36396L, MS[43]#36397L, MS[44]#36398L, MS[45]#36399L, MS[46]#36400L, MS[47]#36401L, MS[48]#36402L, MS[49]#36403L, MS[50]#36404L, MS[51]#36405L, sum#36520L, sum#36521, sum#36522, count#36523L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#36287, processing_day#36289, count#36519L, MS[0]#36354L, MS[1]#36355L, MS[2]#36356L, MS[3]#36357L, MS[4]#36358L, MS[5]#36359L, MS[6]#36360L, MS[7]#36361L, MS[8]#36362L, MS[9]#36363L, MS[10]#36364L, MS[11]#36365L, MS[12]#36366L, MS[13]#36367L, MS[14]#36368L, MS[15]#36369L, MS[16]#36370L, MS[17]#36371L, MS[18]#36372L, MS[19]#36373L, MS[20]#36374L, MS[21]#36375L, MS[22]#36376L, MS[23]#36377L, MS[24]#36378L, MS[25]#36379L, MS[26]#36380L, MS[27]#36381L, MS[28]#36382L, MS[29]#36383L, MS[30]#36384L, MS[31]#36385L, MS[32]#36386L, MS[33]#36387L, MS[34]#36388L, MS[35]#36389L, MS[36]#36390L, MS[37]#36391L, MS[38]#36392L, MS[39]#36393L, MS[40]#36394L, MS[41]#36395L, MS[42]#36396L, MS[43]#36397L, MS[44]#36398L, MS[45]#36399L, MS[46]#36400L, MS[47]#36401L, MS[48]#36402L, MS[49]#36403L, MS[50]#36404L, MS[51]#36405L, sum#36520L, sum#36521, sum#36522, count#36523L]
Keys [2]: [segment#36287, processing_day#36289]
Functions [5]: [count(1), approx_count_distinct(customer_id#36283L, 0.05, 0, 0), sum(events#36293), sum(weighted_amount#36295), avg(amount#36291)]
Aggregate Attributes [5]: [count(1)#36301L, approx_count_distinct(customer_id#36283L, 0.05, 0, 0)#36406L, sum(events#36293)#36407L, sum(weighted_amount#36295)#36408, avg(amount#36291)#36409]
Results [7]: [segment#36287, processing_day#36289, count(1)#36301L AS row_count#36296L, approx_count_distinct(customer_id#36283L, 0.05, 0, 0)#36406L AS unique_customers#36297L, sum(events#36293)#36407L AS event_sum#36298L, sum(weighted_amount#36295)#36408 AS weighted_amount_sum#36299, avg(amount#36291)#36409 AS avg_amount#36300]
(9) Exchange
Input [7]: [segment#36287, processing_day#36289, row_count#36296L, unique_customers#36297L, event_sum#36298L, weighted_amount_sum#36299, avg_amount#36300]
Arguments: rangepartitioning(segment#36287 ASC NULLS FIRST, processing_day#36289 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3474]
(10) ShuffleQueryStage
Output [7]: [segment#36287, processing_day#36289, row_count#36296L, unique_customers#36297L, event_sum#36298L, weighted_amount_sum#36299, avg_amount#36300]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#36287, processing_day#36289, row_count#36296L, unique_customers#36297L, event_sum#36298L, weighted_amount_sum#36299, avg_amount#36300]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#36287, processing_day#36289, row_count#36296L, unique_customers#36297L, event_sum#36298L, weighted_amount_sum#36299, avg_amount#36300]
Arguments: [segment#36287 ASC NULLS FIRST, processing_day#36289 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#36287, processing_day#36289, row_count#36296L, unique_customers#36297L, event_sum#36298L, weighted_amount_sum#36299, avg_amount#36300]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#36283L, segment#36287, processing_day#36289, amount#36291, events#36293, weighted_amount#36295]
Keys [2]: [segment#36287, processing_day#36289]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#36283L, 0.05, 0, 0), partial_sum(events#36293), partial_sum(weighted_amount#36295), partial_avg(amount#36291)]
Aggregate Attributes [57]: [count#36514L, MS[0]#36302L, MS[1]#36303L, MS[2]#36304L, MS[3]#36305L, MS[4]#36306L, MS[5]#36307L, MS[6]#36308L, MS[7]#36309L, MS[8]#36310L, MS[9]#36311L, MS[10]#36312L, MS[11]#36313L, MS[12]#36314L, MS[13]#36315L, MS[14]#36316L, MS[15]#36317L, MS[16]#36318L, MS[17]#36319L, MS[18]#36320L, MS[19]#36321L, MS[20]#36322L, MS[21]#36323L, MS[22]#36324L, MS[23]#36325L, MS[24]#36326L, MS[25]#36327L, MS[26]#36328L, MS[27]#36329L, MS[28]#36330L, MS[29]#36331L, MS[30]#36332L, MS[31]#36333L, MS[32]#36334L, MS[33]#36335L, MS[34]#36336L, MS[35]#36337L, MS[36]#36338L, MS[37]#36339L, MS[38]#36340L, MS[39]#36341L, MS[40]#36342L, MS[41]#36343L, MS[42]#36344L, MS[43]#36345L, MS[44]#36346L, MS[45]#36347L, MS[46]#36348L, MS[47]#36349L, MS[48]#36350L, MS[49]#36351L, MS[50]#36352L, MS[51]#36353L, sum#36515L, sum#36516, sum#36517, count#36518L]
Results [59]: [segment#36287, processing_day#36289, count#36519L, MS[0]#36354L, MS[1]#36355L, MS[2]#36356L, MS[3]#36357L, MS[4]#36358L, MS[5]#36359L, MS[6]#36360L, MS[7]#36361L, MS[8]#36362L, MS[9]#36363L, MS[10]#36364L, MS[11]#36365L, MS[12]#36366L, MS[13]#36367L, MS[14]#36368L, MS[15]#36369L, MS[16]#36370L, MS[17]#36371L, MS[18]#36372L, MS[19]#36373L, MS[20]#36374L, MS[21]#36375L, MS[22]#36376L, MS[23]#36377L, MS[24]#36378L, MS[25]#36379L, MS[26]#36380L, MS[27]#36381L, MS[28]#36382L, MS[29]#36383L, MS[30]#36384L, MS[31]#36385L, MS[32]#36386L, MS[33]#36387L, MS[34]#36388L, MS[35]#36389L, MS[36]#36390L, MS[37]#36391L, MS[38]#36392L, MS[39]#36393L, MS[40]#36394L, MS[41]#36395L, MS[42]#36396L, MS[43]#36397L, MS[44]#36398L, MS[45]#36399L, MS[46]#36400L, MS[47]#36401L, MS[48]#36402L, MS[49]#36403L, MS[50]#36404L, MS[51]#36405L, sum#36520L, sum#36521, sum#36522, count#36523L]
(15) Exchange
Input [59]: [segment#36287, processing_day#36289, count#36519L, MS[0]#36354L, MS[1]#36355L, MS[2]#36356L, MS[3]#36357L, MS[4]#36358L, MS[5]#36359L, MS[6]#36360L, MS[7]#36361L, MS[8]#36362L, MS[9]#36363L, MS[10]#36364L, MS[11]#36365L, MS[12]#36366L, MS[13]#36367L, MS[14]#36368L, MS[15]#36369L, MS[16]#36370L, MS[17]#36371L, MS[18]#36372L, MS[19]#36373L, MS[20]#36374L, MS[21]#36375L, MS[22]#36376L, MS[23]#36377L, MS[24]#36378L, MS[25]#36379L, MS[26]#36380L, MS[27]#36381L, MS[28]#36382L, MS[29]#36383L, MS[30]#36384L, MS[31]#36385L, MS[32]#36386L, MS[33]#36387L, MS[34]#36388L, MS[35]#36389L, MS[36]#36390L, MS[37]#36391L, MS[38]#36392L, MS[39]#36393L, MS[40]#36394L, MS[41]#36395L, MS[42]#36396L, MS[43]#36397L, MS[44]#36398L, MS[45]#36399L, MS[46]#36400L, MS[47]#36401L, MS[48]#36402L, MS[49]#36403L, MS[50]#36404L, MS[51]#36405L, sum#36520L, sum#36521, sum#36522, count#36523L]
Arguments: hashpartitioning(segment#36287, processing_day#36289, 200), ENSURE_REQUIREMENTS, [plan_id=3432]
(16) HashAggregate
Input [59]: [segment#36287, processing_day#36289, count#36519L, MS[0]#36354L, MS[1]#36355L, MS[2]#36356L, MS[3]#36357L, MS[4]#36358L, MS[5]#36359L, MS[6]#36360L, MS[7]#36361L, MS[8]#36362L, MS[9]#36363L, MS[10]#36364L, MS[11]#36365L, MS[12]#36366L, MS[13]#36367L, MS[14]#36368L, MS[15]#36369L, MS[16]#36370L, MS[17]#36371L, MS[18]#36372L, MS[19]#36373L, MS[20]#36374L, MS[21]#36375L, MS[22]#36376L, MS[23]#36377L, MS[24]#36378L, MS[25]#36379L, MS[26]#36380L, MS[27]#36381L, MS[28]#36382L, MS[29]#36383L, MS[30]#36384L, MS[31]#36385L, MS[32]#36386L, MS[33]#36387L, MS[34]#36388L, MS[35]#36389L, MS[36]#36390L, MS[37]#36391L, MS[38]#36392L, MS[39]#36393L, MS[40]#36394L, MS[41]#36395L, MS[42]#36396L, MS[43]#36397L, MS[44]#36398L, MS[45]#36399L, MS[46]#36400L, MS[47]#36401L, MS[48]#36402L, MS[49]#36403L, MS[50]#36404L, MS[51]#36405L, sum#36520L, sum#36521, sum#36522, count#36523L]
Keys [2]: [segment#36287, processing_day#36289]
Functions [5]: [count(1), approx_count_distinct(customer_id#36283L, 0.05, 0, 0), sum(events#36293), sum(weighted_amount#36295), avg(amount#36291)]
Aggregate Attributes [5]: [count(1)#36301L, approx_count_distinct(customer_id#36283L, 0.05, 0, 0)#36406L, sum(events#36293)#36407L, sum(weighted_amount#36295)#36408, avg(amount#36291)#36409]
Results [7]: [segment#36287, processing_day#36289, count(1)#36301L AS row_count#36296L, approx_count_distinct(customer_id#36283L, 0.05, 0, 0)#36406L AS unique_customers#36297L, sum(events#36293)#36407L AS event_sum#36298L, sum(weighted_amount#36295)#36408 AS weighted_amount_sum#36299, avg(amount#36291)#36409 AS avg_amount#36300]
(17) Exchange
Input [7]: [segment#36287, processing_day#36289, row_count#36296L, unique_customers#36297L, event_sum#36298L, weighted_amount_sum#36299, avg_amount#36300]
Arguments: rangepartitioning(segment#36287 ASC NULLS FIRST, processing_day#36289 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3435]
(18) Sort
Input [7]: [segment#36287, processing_day#36289, row_count#36296L, unique_customers#36297L, event_sum#36298L, weighted_amount_sum#36299, avg_amount#36300]
Arguments: [segment#36287 ASC NULLS FIRST, processing_day#36289 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#36287, processing_day#36289, row_count#36296L, unique_customers#36297L, event_sum#36298L, weighted_amount_sum#36299, avg_amount#36300]
Arguments: isFinalPlan=true