== 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#29209L]
Arguments: Range (9000000, 10000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#29209L % 250000) AS customer_id#29211L, concat(segment-, cast(cast((id#29209L % 12) as int) as string)) AS segment#29215, cast((id#29209L % 14) as int) AS processing_day#29217, ((cast(((id#29209L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#29219, cast((((id#29209L * 29) % 7) + 1) as int) AS events#29221]
Input [1]: [id#29209L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#29211L, segment#29215, processing_day#29217, amount#29219, events#29221, (amount#29219 * cast(events#29221 as double)) AS weighted_amount#29223]
Input [5]: [customer_id#29211L, segment#29215, processing_day#29217, amount#29219, events#29221]
(4) HashAggregate
Input [6]: [customer_id#29211L, segment#29215, processing_day#29217, amount#29219, events#29221, weighted_amount#29223]
Keys [2]: [segment#29215, processing_day#29217]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#29211L, 0.05, 0, 0), partial_sum(events#29221), partial_sum(weighted_amount#29223), partial_avg(amount#29219)]
Aggregate Attributes [57]: [count#29442L, MS[0]#29230L, MS[1]#29231L, MS[2]#29232L, MS[3]#29233L, MS[4]#29234L, MS[5]#29235L, MS[6]#29236L, MS[7]#29237L, MS[8]#29238L, MS[9]#29239L, MS[10]#29240L, MS[11]#29241L, MS[12]#29242L, MS[13]#29243L, MS[14]#29244L, MS[15]#29245L, MS[16]#29246L, MS[17]#29247L, MS[18]#29248L, MS[19]#29249L, MS[20]#29250L, MS[21]#29251L, MS[22]#29252L, MS[23]#29253L, MS[24]#29254L, MS[25]#29255L, MS[26]#29256L, MS[27]#29257L, MS[28]#29258L, MS[29]#29259L, MS[30]#29260L, MS[31]#29261L, MS[32]#29262L, MS[33]#29263L, MS[34]#29264L, MS[35]#29265L, MS[36]#29266L, MS[37]#29267L, MS[38]#29268L, MS[39]#29269L, MS[40]#29270L, MS[41]#29271L, MS[42]#29272L, MS[43]#29273L, MS[44]#29274L, MS[45]#29275L, MS[46]#29276L, MS[47]#29277L, MS[48]#29278L, MS[49]#29279L, MS[50]#29280L, MS[51]#29281L, sum#29443L, sum#29444, sum#29445, count#29446L]
Results [59]: [segment#29215, processing_day#29217, count#29447L, MS[0]#29282L, MS[1]#29283L, MS[2]#29284L, MS[3]#29285L, MS[4]#29286L, MS[5]#29287L, MS[6]#29288L, MS[7]#29289L, MS[8]#29290L, MS[9]#29291L, MS[10]#29292L, MS[11]#29293L, MS[12]#29294L, MS[13]#29295L, MS[14]#29296L, MS[15]#29297L, MS[16]#29298L, MS[17]#29299L, MS[18]#29300L, MS[19]#29301L, MS[20]#29302L, MS[21]#29303L, MS[22]#29304L, MS[23]#29305L, MS[24]#29306L, MS[25]#29307L, MS[26]#29308L, MS[27]#29309L, MS[28]#29310L, MS[29]#29311L, MS[30]#29312L, MS[31]#29313L, MS[32]#29314L, MS[33]#29315L, MS[34]#29316L, MS[35]#29317L, MS[36]#29318L, MS[37]#29319L, MS[38]#29320L, MS[39]#29321L, MS[40]#29322L, MS[41]#29323L, MS[42]#29324L, MS[43]#29325L, MS[44]#29326L, MS[45]#29327L, MS[46]#29328L, MS[47]#29329L, MS[48]#29330L, MS[49]#29331L, MS[50]#29332L, MS[51]#29333L, sum#29448L, sum#29449, sum#29450, count#29451L]
(5) Exchange
Input [59]: [segment#29215, processing_day#29217, count#29447L, MS[0]#29282L, MS[1]#29283L, MS[2]#29284L, MS[3]#29285L, MS[4]#29286L, MS[5]#29287L, MS[6]#29288L, MS[7]#29289L, MS[8]#29290L, MS[9]#29291L, MS[10]#29292L, MS[11]#29293L, MS[12]#29294L, MS[13]#29295L, MS[14]#29296L, MS[15]#29297L, MS[16]#29298L, MS[17]#29299L, MS[18]#29300L, MS[19]#29301L, MS[20]#29302L, MS[21]#29303L, MS[22]#29304L, MS[23]#29305L, MS[24]#29306L, MS[25]#29307L, MS[26]#29308L, MS[27]#29309L, MS[28]#29310L, MS[29]#29311L, MS[30]#29312L, MS[31]#29313L, MS[32]#29314L, MS[33]#29315L, MS[34]#29316L, MS[35]#29317L, MS[36]#29318L, MS[37]#29319L, MS[38]#29320L, MS[39]#29321L, MS[40]#29322L, MS[41]#29323L, MS[42]#29324L, MS[43]#29325L, MS[44]#29326L, MS[45]#29327L, MS[46]#29328L, MS[47]#29329L, MS[48]#29330L, MS[49]#29331L, MS[50]#29332L, MS[51]#29333L, sum#29448L, sum#29449, sum#29450, count#29451L]
Arguments: hashpartitioning(segment#29215, processing_day#29217, 200), ENSURE_REQUIREMENTS, [plan_id=2788]
(6) ShuffleQueryStage
Output [59]: [segment#29215, processing_day#29217, count#29447L, MS[0]#29282L, MS[1]#29283L, MS[2]#29284L, MS[3]#29285L, MS[4]#29286L, MS[5]#29287L, MS[6]#29288L, MS[7]#29289L, MS[8]#29290L, MS[9]#29291L, MS[10]#29292L, MS[11]#29293L, MS[12]#29294L, MS[13]#29295L, MS[14]#29296L, MS[15]#29297L, MS[16]#29298L, MS[17]#29299L, MS[18]#29300L, MS[19]#29301L, MS[20]#29302L, MS[21]#29303L, MS[22]#29304L, MS[23]#29305L, MS[24]#29306L, MS[25]#29307L, MS[26]#29308L, MS[27]#29309L, MS[28]#29310L, MS[29]#29311L, MS[30]#29312L, MS[31]#29313L, MS[32]#29314L, MS[33]#29315L, MS[34]#29316L, MS[35]#29317L, MS[36]#29318L, MS[37]#29319L, MS[38]#29320L, MS[39]#29321L, MS[40]#29322L, MS[41]#29323L, MS[42]#29324L, MS[43]#29325L, MS[44]#29326L, MS[45]#29327L, MS[46]#29328L, MS[47]#29329L, MS[48]#29330L, MS[49]#29331L, MS[50]#29332L, MS[51]#29333L, sum#29448L, sum#29449, sum#29450, count#29451L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#29215, processing_day#29217, count#29447L, MS[0]#29282L, MS[1]#29283L, MS[2]#29284L, MS[3]#29285L, MS[4]#29286L, MS[5]#29287L, MS[6]#29288L, MS[7]#29289L, MS[8]#29290L, MS[9]#29291L, MS[10]#29292L, MS[11]#29293L, MS[12]#29294L, MS[13]#29295L, MS[14]#29296L, MS[15]#29297L, MS[16]#29298L, MS[17]#29299L, MS[18]#29300L, MS[19]#29301L, MS[20]#29302L, MS[21]#29303L, MS[22]#29304L, MS[23]#29305L, MS[24]#29306L, MS[25]#29307L, MS[26]#29308L, MS[27]#29309L, MS[28]#29310L, MS[29]#29311L, MS[30]#29312L, MS[31]#29313L, MS[32]#29314L, MS[33]#29315L, MS[34]#29316L, MS[35]#29317L, MS[36]#29318L, MS[37]#29319L, MS[38]#29320L, MS[39]#29321L, MS[40]#29322L, MS[41]#29323L, MS[42]#29324L, MS[43]#29325L, MS[44]#29326L, MS[45]#29327L, MS[46]#29328L, MS[47]#29329L, MS[48]#29330L, MS[49]#29331L, MS[50]#29332L, MS[51]#29333L, sum#29448L, sum#29449, sum#29450, count#29451L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#29215, processing_day#29217, count#29447L, MS[0]#29282L, MS[1]#29283L, MS[2]#29284L, MS[3]#29285L, MS[4]#29286L, MS[5]#29287L, MS[6]#29288L, MS[7]#29289L, MS[8]#29290L, MS[9]#29291L, MS[10]#29292L, MS[11]#29293L, MS[12]#29294L, MS[13]#29295L, MS[14]#29296L, MS[15]#29297L, MS[16]#29298L, MS[17]#29299L, MS[18]#29300L, MS[19]#29301L, MS[20]#29302L, MS[21]#29303L, MS[22]#29304L, MS[23]#29305L, MS[24]#29306L, MS[25]#29307L, MS[26]#29308L, MS[27]#29309L, MS[28]#29310L, MS[29]#29311L, MS[30]#29312L, MS[31]#29313L, MS[32]#29314L, MS[33]#29315L, MS[34]#29316L, MS[35]#29317L, MS[36]#29318L, MS[37]#29319L, MS[38]#29320L, MS[39]#29321L, MS[40]#29322L, MS[41]#29323L, MS[42]#29324L, MS[43]#29325L, MS[44]#29326L, MS[45]#29327L, MS[46]#29328L, MS[47]#29329L, MS[48]#29330L, MS[49]#29331L, MS[50]#29332L, MS[51]#29333L, sum#29448L, sum#29449, sum#29450, count#29451L]
Keys [2]: [segment#29215, processing_day#29217]
Functions [5]: [count(1), approx_count_distinct(customer_id#29211L, 0.05, 0, 0), sum(events#29221), sum(weighted_amount#29223), avg(amount#29219)]
Aggregate Attributes [5]: [count(1)#29229L, approx_count_distinct(customer_id#29211L, 0.05, 0, 0)#29334L, sum(events#29221)#29335L, sum(weighted_amount#29223)#29336, avg(amount#29219)#29337]
Results [7]: [segment#29215, processing_day#29217, count(1)#29229L AS row_count#29224L, approx_count_distinct(customer_id#29211L, 0.05, 0, 0)#29334L AS unique_customers#29225L, sum(events#29221)#29335L AS event_sum#29226L, sum(weighted_amount#29223)#29336 AS weighted_amount_sum#29227, avg(amount#29219)#29337 AS avg_amount#29228]
(9) Exchange
Input [7]: [segment#29215, processing_day#29217, row_count#29224L, unique_customers#29225L, event_sum#29226L, weighted_amount_sum#29227, avg_amount#29228]
Arguments: rangepartitioning(segment#29215 ASC NULLS FIRST, processing_day#29217 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2810]
(10) ShuffleQueryStage
Output [7]: [segment#29215, processing_day#29217, row_count#29224L, unique_customers#29225L, event_sum#29226L, weighted_amount_sum#29227, avg_amount#29228]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#29215, processing_day#29217, row_count#29224L, unique_customers#29225L, event_sum#29226L, weighted_amount_sum#29227, avg_amount#29228]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#29215, processing_day#29217, row_count#29224L, unique_customers#29225L, event_sum#29226L, weighted_amount_sum#29227, avg_amount#29228]
Arguments: [segment#29215 ASC NULLS FIRST, processing_day#29217 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#29215, processing_day#29217, row_count#29224L, unique_customers#29225L, event_sum#29226L, weighted_amount_sum#29227, avg_amount#29228]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#29211L, segment#29215, processing_day#29217, amount#29219, events#29221, weighted_amount#29223]
Keys [2]: [segment#29215, processing_day#29217]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#29211L, 0.05, 0, 0), partial_sum(events#29221), partial_sum(weighted_amount#29223), partial_avg(amount#29219)]
Aggregate Attributes [57]: [count#29442L, MS[0]#29230L, MS[1]#29231L, MS[2]#29232L, MS[3]#29233L, MS[4]#29234L, MS[5]#29235L, MS[6]#29236L, MS[7]#29237L, MS[8]#29238L, MS[9]#29239L, MS[10]#29240L, MS[11]#29241L, MS[12]#29242L, MS[13]#29243L, MS[14]#29244L, MS[15]#29245L, MS[16]#29246L, MS[17]#29247L, MS[18]#29248L, MS[19]#29249L, MS[20]#29250L, MS[21]#29251L, MS[22]#29252L, MS[23]#29253L, MS[24]#29254L, MS[25]#29255L, MS[26]#29256L, MS[27]#29257L, MS[28]#29258L, MS[29]#29259L, MS[30]#29260L, MS[31]#29261L, MS[32]#29262L, MS[33]#29263L, MS[34]#29264L, MS[35]#29265L, MS[36]#29266L, MS[37]#29267L, MS[38]#29268L, MS[39]#29269L, MS[40]#29270L, MS[41]#29271L, MS[42]#29272L, MS[43]#29273L, MS[44]#29274L, MS[45]#29275L, MS[46]#29276L, MS[47]#29277L, MS[48]#29278L, MS[49]#29279L, MS[50]#29280L, MS[51]#29281L, sum#29443L, sum#29444, sum#29445, count#29446L]
Results [59]: [segment#29215, processing_day#29217, count#29447L, MS[0]#29282L, MS[1]#29283L, MS[2]#29284L, MS[3]#29285L, MS[4]#29286L, MS[5]#29287L, MS[6]#29288L, MS[7]#29289L, MS[8]#29290L, MS[9]#29291L, MS[10]#29292L, MS[11]#29293L, MS[12]#29294L, MS[13]#29295L, MS[14]#29296L, MS[15]#29297L, MS[16]#29298L, MS[17]#29299L, MS[18]#29300L, MS[19]#29301L, MS[20]#29302L, MS[21]#29303L, MS[22]#29304L, MS[23]#29305L, MS[24]#29306L, MS[25]#29307L, MS[26]#29308L, MS[27]#29309L, MS[28]#29310L, MS[29]#29311L, MS[30]#29312L, MS[31]#29313L, MS[32]#29314L, MS[33]#29315L, MS[34]#29316L, MS[35]#29317L, MS[36]#29318L, MS[37]#29319L, MS[38]#29320L, MS[39]#29321L, MS[40]#29322L, MS[41]#29323L, MS[42]#29324L, MS[43]#29325L, MS[44]#29326L, MS[45]#29327L, MS[46]#29328L, MS[47]#29329L, MS[48]#29330L, MS[49]#29331L, MS[50]#29332L, MS[51]#29333L, sum#29448L, sum#29449, sum#29450, count#29451L]
(15) Exchange
Input [59]: [segment#29215, processing_day#29217, count#29447L, MS[0]#29282L, MS[1]#29283L, MS[2]#29284L, MS[3]#29285L, MS[4]#29286L, MS[5]#29287L, MS[6]#29288L, MS[7]#29289L, MS[8]#29290L, MS[9]#29291L, MS[10]#29292L, MS[11]#29293L, MS[12]#29294L, MS[13]#29295L, MS[14]#29296L, MS[15]#29297L, MS[16]#29298L, MS[17]#29299L, MS[18]#29300L, MS[19]#29301L, MS[20]#29302L, MS[21]#29303L, MS[22]#29304L, MS[23]#29305L, MS[24]#29306L, MS[25]#29307L, MS[26]#29308L, MS[27]#29309L, MS[28]#29310L, MS[29]#29311L, MS[30]#29312L, MS[31]#29313L, MS[32]#29314L, MS[33]#29315L, MS[34]#29316L, MS[35]#29317L, MS[36]#29318L, MS[37]#29319L, MS[38]#29320L, MS[39]#29321L, MS[40]#29322L, MS[41]#29323L, MS[42]#29324L, MS[43]#29325L, MS[44]#29326L, MS[45]#29327L, MS[46]#29328L, MS[47]#29329L, MS[48]#29330L, MS[49]#29331L, MS[50]#29332L, MS[51]#29333L, sum#29448L, sum#29449, sum#29450, count#29451L]
Arguments: hashpartitioning(segment#29215, processing_day#29217, 200), ENSURE_REQUIREMENTS, [plan_id=2768]
(16) HashAggregate
Input [59]: [segment#29215, processing_day#29217, count#29447L, MS[0]#29282L, MS[1]#29283L, MS[2]#29284L, MS[3]#29285L, MS[4]#29286L, MS[5]#29287L, MS[6]#29288L, MS[7]#29289L, MS[8]#29290L, MS[9]#29291L, MS[10]#29292L, MS[11]#29293L, MS[12]#29294L, MS[13]#29295L, MS[14]#29296L, MS[15]#29297L, MS[16]#29298L, MS[17]#29299L, MS[18]#29300L, MS[19]#29301L, MS[20]#29302L, MS[21]#29303L, MS[22]#29304L, MS[23]#29305L, MS[24]#29306L, MS[25]#29307L, MS[26]#29308L, MS[27]#29309L, MS[28]#29310L, MS[29]#29311L, MS[30]#29312L, MS[31]#29313L, MS[32]#29314L, MS[33]#29315L, MS[34]#29316L, MS[35]#29317L, MS[36]#29318L, MS[37]#29319L, MS[38]#29320L, MS[39]#29321L, MS[40]#29322L, MS[41]#29323L, MS[42]#29324L, MS[43]#29325L, MS[44]#29326L, MS[45]#29327L, MS[46]#29328L, MS[47]#29329L, MS[48]#29330L, MS[49]#29331L, MS[50]#29332L, MS[51]#29333L, sum#29448L, sum#29449, sum#29450, count#29451L]
Keys [2]: [segment#29215, processing_day#29217]
Functions [5]: [count(1), approx_count_distinct(customer_id#29211L, 0.05, 0, 0), sum(events#29221), sum(weighted_amount#29223), avg(amount#29219)]
Aggregate Attributes [5]: [count(1)#29229L, approx_count_distinct(customer_id#29211L, 0.05, 0, 0)#29334L, sum(events#29221)#29335L, sum(weighted_amount#29223)#29336, avg(amount#29219)#29337]
Results [7]: [segment#29215, processing_day#29217, count(1)#29229L AS row_count#29224L, approx_count_distinct(customer_id#29211L, 0.05, 0, 0)#29334L AS unique_customers#29225L, sum(events#29221)#29335L AS event_sum#29226L, sum(weighted_amount#29223)#29336 AS weighted_amount_sum#29227, avg(amount#29219)#29337 AS avg_amount#29228]
(17) Exchange
Input [7]: [segment#29215, processing_day#29217, row_count#29224L, unique_customers#29225L, event_sum#29226L, weighted_amount_sum#29227, avg_amount#29228]
Arguments: rangepartitioning(segment#29215 ASC NULLS FIRST, processing_day#29217 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2771]
(18) Sort
Input [7]: [segment#29215, processing_day#29217, row_count#29224L, unique_customers#29225L, event_sum#29226L, weighted_amount_sum#29227, avg_amount#29228]
Arguments: [segment#29215 ASC NULLS FIRST, processing_day#29217 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#29215, processing_day#29217, row_count#29224L, unique_customers#29225L, event_sum#29226L, weighted_amount_sum#29227, avg_amount#29228]
Arguments: isFinalPlan=true