== 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#4421L]
Arguments: Range (5000000, 6000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#4421L % 250000) AS customer_id#4423L, concat(segment-, cast(cast((id#4421L % 12) as int) as string)) AS segment#4427, cast((id#4421L % 14) as int) AS processing_day#4429, ((cast(((id#4421L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#4431, cast((((id#4421L * 29) % 7) + 1) as int) AS events#4433]
Input [1]: [id#4421L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#4423L, segment#4427, processing_day#4429, amount#4431, events#4433, (amount#4431 * cast(events#4433 as double)) AS weighted_amount#4435]
Input [5]: [customer_id#4423L, segment#4427, processing_day#4429, amount#4431, events#4433]
(4) HashAggregate
Input [6]: [customer_id#4423L, segment#4427, processing_day#4429, amount#4431, events#4433, weighted_amount#4435]
Keys [2]: [segment#4427, processing_day#4429]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#4423L, 0.05, 0, 0), partial_sum(events#4433), partial_sum(weighted_amount#4435), partial_avg(amount#4431)]
Aggregate Attributes [57]: [count#4654L, MS[0]#4442L, MS[1]#4443L, MS[2]#4444L, MS[3]#4445L, MS[4]#4446L, MS[5]#4447L, MS[6]#4448L, MS[7]#4449L, MS[8]#4450L, MS[9]#4451L, MS[10]#4452L, MS[11]#4453L, MS[12]#4454L, MS[13]#4455L, MS[14]#4456L, MS[15]#4457L, MS[16]#4458L, MS[17]#4459L, MS[18]#4460L, MS[19]#4461L, MS[20]#4462L, MS[21]#4463L, MS[22]#4464L, MS[23]#4465L, MS[24]#4466L, MS[25]#4467L, MS[26]#4468L, MS[27]#4469L, MS[28]#4470L, MS[29]#4471L, MS[30]#4472L, MS[31]#4473L, MS[32]#4474L, MS[33]#4475L, MS[34]#4476L, MS[35]#4477L, MS[36]#4478L, MS[37]#4479L, MS[38]#4480L, MS[39]#4481L, MS[40]#4482L, MS[41]#4483L, MS[42]#4484L, MS[43]#4485L, MS[44]#4486L, MS[45]#4487L, MS[46]#4488L, MS[47]#4489L, MS[48]#4490L, MS[49]#4491L, MS[50]#4492L, MS[51]#4493L, sum#4655L, sum#4656, sum#4657, count#4658L]
Results [59]: [segment#4427, processing_day#4429, count#4659L, MS[0]#4494L, MS[1]#4495L, MS[2]#4496L, MS[3]#4497L, MS[4]#4498L, MS[5]#4499L, MS[6]#4500L, MS[7]#4501L, MS[8]#4502L, MS[9]#4503L, MS[10]#4504L, MS[11]#4505L, MS[12]#4506L, MS[13]#4507L, MS[14]#4508L, MS[15]#4509L, MS[16]#4510L, MS[17]#4511L, MS[18]#4512L, MS[19]#4513L, MS[20]#4514L, MS[21]#4515L, MS[22]#4516L, MS[23]#4517L, MS[24]#4518L, MS[25]#4519L, MS[26]#4520L, MS[27]#4521L, MS[28]#4522L, MS[29]#4523L, MS[30]#4524L, MS[31]#4525L, MS[32]#4526L, MS[33]#4527L, MS[34]#4528L, MS[35]#4529L, MS[36]#4530L, MS[37]#4531L, MS[38]#4532L, MS[39]#4533L, MS[40]#4534L, MS[41]#4535L, MS[42]#4536L, MS[43]#4537L, MS[44]#4538L, MS[45]#4539L, MS[46]#4540L, MS[47]#4541L, MS[48]#4542L, MS[49]#4543L, MS[50]#4544L, MS[51]#4545L, sum#4660L, sum#4661, sum#4662, count#4663L]
(5) Exchange
Input [59]: [segment#4427, processing_day#4429, count#4659L, MS[0]#4494L, MS[1]#4495L, MS[2]#4496L, MS[3]#4497L, MS[4]#4498L, MS[5]#4499L, MS[6]#4500L, MS[7]#4501L, MS[8]#4502L, MS[9]#4503L, MS[10]#4504L, MS[11]#4505L, MS[12]#4506L, MS[13]#4507L, MS[14]#4508L, MS[15]#4509L, MS[16]#4510L, MS[17]#4511L, MS[18]#4512L, MS[19]#4513L, MS[20]#4514L, MS[21]#4515L, MS[22]#4516L, MS[23]#4517L, MS[24]#4518L, MS[25]#4519L, MS[26]#4520L, MS[27]#4521L, MS[28]#4522L, MS[29]#4523L, MS[30]#4524L, MS[31]#4525L, MS[32]#4526L, MS[33]#4527L, MS[34]#4528L, MS[35]#4529L, MS[36]#4530L, MS[37]#4531L, MS[38]#4532L, MS[39]#4533L, MS[40]#4534L, MS[41]#4535L, MS[42]#4536L, MS[43]#4537L, MS[44]#4538L, MS[45]#4539L, MS[46]#4540L, MS[47]#4541L, MS[48]#4542L, MS[49]#4543L, MS[50]#4544L, MS[51]#4545L, sum#4660L, sum#4661, sum#4662, count#4663L]
Arguments: hashpartitioning(segment#4427, processing_day#4429, 200), ENSURE_REQUIREMENTS, [plan_id=458]
(6) ShuffleQueryStage
Output [59]: [segment#4427, processing_day#4429, count#4659L, MS[0]#4494L, MS[1]#4495L, MS[2]#4496L, MS[3]#4497L, MS[4]#4498L, MS[5]#4499L, MS[6]#4500L, MS[7]#4501L, MS[8]#4502L, MS[9]#4503L, MS[10]#4504L, MS[11]#4505L, MS[12]#4506L, MS[13]#4507L, MS[14]#4508L, MS[15]#4509L, MS[16]#4510L, MS[17]#4511L, MS[18]#4512L, MS[19]#4513L, MS[20]#4514L, MS[21]#4515L, MS[22]#4516L, MS[23]#4517L, MS[24]#4518L, MS[25]#4519L, MS[26]#4520L, MS[27]#4521L, MS[28]#4522L, MS[29]#4523L, MS[30]#4524L, MS[31]#4525L, MS[32]#4526L, MS[33]#4527L, MS[34]#4528L, MS[35]#4529L, MS[36]#4530L, MS[37]#4531L, MS[38]#4532L, MS[39]#4533L, MS[40]#4534L, MS[41]#4535L, MS[42]#4536L, MS[43]#4537L, MS[44]#4538L, MS[45]#4539L, MS[46]#4540L, MS[47]#4541L, MS[48]#4542L, MS[49]#4543L, MS[50]#4544L, MS[51]#4545L, sum#4660L, sum#4661, sum#4662, count#4663L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#4427, processing_day#4429, count#4659L, MS[0]#4494L, MS[1]#4495L, MS[2]#4496L, MS[3]#4497L, MS[4]#4498L, MS[5]#4499L, MS[6]#4500L, MS[7]#4501L, MS[8]#4502L, MS[9]#4503L, MS[10]#4504L, MS[11]#4505L, MS[12]#4506L, MS[13]#4507L, MS[14]#4508L, MS[15]#4509L, MS[16]#4510L, MS[17]#4511L, MS[18]#4512L, MS[19]#4513L, MS[20]#4514L, MS[21]#4515L, MS[22]#4516L, MS[23]#4517L, MS[24]#4518L, MS[25]#4519L, MS[26]#4520L, MS[27]#4521L, MS[28]#4522L, MS[29]#4523L, MS[30]#4524L, MS[31]#4525L, MS[32]#4526L, MS[33]#4527L, MS[34]#4528L, MS[35]#4529L, MS[36]#4530L, MS[37]#4531L, MS[38]#4532L, MS[39]#4533L, MS[40]#4534L, MS[41]#4535L, MS[42]#4536L, MS[43]#4537L, MS[44]#4538L, MS[45]#4539L, MS[46]#4540L, MS[47]#4541L, MS[48]#4542L, MS[49]#4543L, MS[50]#4544L, MS[51]#4545L, sum#4660L, sum#4661, sum#4662, count#4663L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#4427, processing_day#4429, count#4659L, MS[0]#4494L, MS[1]#4495L, MS[2]#4496L, MS[3]#4497L, MS[4]#4498L, MS[5]#4499L, MS[6]#4500L, MS[7]#4501L, MS[8]#4502L, MS[9]#4503L, MS[10]#4504L, MS[11]#4505L, MS[12]#4506L, MS[13]#4507L, MS[14]#4508L, MS[15]#4509L, MS[16]#4510L, MS[17]#4511L, MS[18]#4512L, MS[19]#4513L, MS[20]#4514L, MS[21]#4515L, MS[22]#4516L, MS[23]#4517L, MS[24]#4518L, MS[25]#4519L, MS[26]#4520L, MS[27]#4521L, MS[28]#4522L, MS[29]#4523L, MS[30]#4524L, MS[31]#4525L, MS[32]#4526L, MS[33]#4527L, MS[34]#4528L, MS[35]#4529L, MS[36]#4530L, MS[37]#4531L, MS[38]#4532L, MS[39]#4533L, MS[40]#4534L, MS[41]#4535L, MS[42]#4536L, MS[43]#4537L, MS[44]#4538L, MS[45]#4539L, MS[46]#4540L, MS[47]#4541L, MS[48]#4542L, MS[49]#4543L, MS[50]#4544L, MS[51]#4545L, sum#4660L, sum#4661, sum#4662, count#4663L]
Keys [2]: [segment#4427, processing_day#4429]
Functions [5]: [count(1), approx_count_distinct(customer_id#4423L, 0.05, 0, 0), sum(events#4433), sum(weighted_amount#4435), avg(amount#4431)]
Aggregate Attributes [5]: [count(1)#4441L, approx_count_distinct(customer_id#4423L, 0.05, 0, 0)#4546L, sum(events#4433)#4547L, sum(weighted_amount#4435)#4548, avg(amount#4431)#4549]
Results [7]: [segment#4427, processing_day#4429, count(1)#4441L AS row_count#4436L, approx_count_distinct(customer_id#4423L, 0.05, 0, 0)#4546L AS unique_customers#4437L, sum(events#4433)#4547L AS event_sum#4438L, sum(weighted_amount#4435)#4548 AS weighted_amount_sum#4439, avg(amount#4431)#4549 AS avg_amount#4440]
(9) Exchange
Input [7]: [segment#4427, processing_day#4429, row_count#4436L, unique_customers#4437L, event_sum#4438L, weighted_amount_sum#4439, avg_amount#4440]
Arguments: rangepartitioning(segment#4427 ASC NULLS FIRST, processing_day#4429 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=480]
(10) ShuffleQueryStage
Output [7]: [segment#4427, processing_day#4429, row_count#4436L, unique_customers#4437L, event_sum#4438L, weighted_amount_sum#4439, avg_amount#4440]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#4427, processing_day#4429, row_count#4436L, unique_customers#4437L, event_sum#4438L, weighted_amount_sum#4439, avg_amount#4440]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#4427, processing_day#4429, row_count#4436L, unique_customers#4437L, event_sum#4438L, weighted_amount_sum#4439, avg_amount#4440]
Arguments: [segment#4427 ASC NULLS FIRST, processing_day#4429 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#4427, processing_day#4429, row_count#4436L, unique_customers#4437L, event_sum#4438L, weighted_amount_sum#4439, avg_amount#4440]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#4423L, segment#4427, processing_day#4429, amount#4431, events#4433, weighted_amount#4435]
Keys [2]: [segment#4427, processing_day#4429]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#4423L, 0.05, 0, 0), partial_sum(events#4433), partial_sum(weighted_amount#4435), partial_avg(amount#4431)]
Aggregate Attributes [57]: [count#4654L, MS[0]#4442L, MS[1]#4443L, MS[2]#4444L, MS[3]#4445L, MS[4]#4446L, MS[5]#4447L, MS[6]#4448L, MS[7]#4449L, MS[8]#4450L, MS[9]#4451L, MS[10]#4452L, MS[11]#4453L, MS[12]#4454L, MS[13]#4455L, MS[14]#4456L, MS[15]#4457L, MS[16]#4458L, MS[17]#4459L, MS[18]#4460L, MS[19]#4461L, MS[20]#4462L, MS[21]#4463L, MS[22]#4464L, MS[23]#4465L, MS[24]#4466L, MS[25]#4467L, MS[26]#4468L, MS[27]#4469L, MS[28]#4470L, MS[29]#4471L, MS[30]#4472L, MS[31]#4473L, MS[32]#4474L, MS[33]#4475L, MS[34]#4476L, MS[35]#4477L, MS[36]#4478L, MS[37]#4479L, MS[38]#4480L, MS[39]#4481L, MS[40]#4482L, MS[41]#4483L, MS[42]#4484L, MS[43]#4485L, MS[44]#4486L, MS[45]#4487L, MS[46]#4488L, MS[47]#4489L, MS[48]#4490L, MS[49]#4491L, MS[50]#4492L, MS[51]#4493L, sum#4655L, sum#4656, sum#4657, count#4658L]
Results [59]: [segment#4427, processing_day#4429, count#4659L, MS[0]#4494L, MS[1]#4495L, MS[2]#4496L, MS[3]#4497L, MS[4]#4498L, MS[5]#4499L, MS[6]#4500L, MS[7]#4501L, MS[8]#4502L, MS[9]#4503L, MS[10]#4504L, MS[11]#4505L, MS[12]#4506L, MS[13]#4507L, MS[14]#4508L, MS[15]#4509L, MS[16]#4510L, MS[17]#4511L, MS[18]#4512L, MS[19]#4513L, MS[20]#4514L, MS[21]#4515L, MS[22]#4516L, MS[23]#4517L, MS[24]#4518L, MS[25]#4519L, MS[26]#4520L, MS[27]#4521L, MS[28]#4522L, MS[29]#4523L, MS[30]#4524L, MS[31]#4525L, MS[32]#4526L, MS[33]#4527L, MS[34]#4528L, MS[35]#4529L, MS[36]#4530L, MS[37]#4531L, MS[38]#4532L, MS[39]#4533L, MS[40]#4534L, MS[41]#4535L, MS[42]#4536L, MS[43]#4537L, MS[44]#4538L, MS[45]#4539L, MS[46]#4540L, MS[47]#4541L, MS[48]#4542L, MS[49]#4543L, MS[50]#4544L, MS[51]#4545L, sum#4660L, sum#4661, sum#4662, count#4663L]
(15) Exchange
Input [59]: [segment#4427, processing_day#4429, count#4659L, MS[0]#4494L, MS[1]#4495L, MS[2]#4496L, MS[3]#4497L, MS[4]#4498L, MS[5]#4499L, MS[6]#4500L, MS[7]#4501L, MS[8]#4502L, MS[9]#4503L, MS[10]#4504L, MS[11]#4505L, MS[12]#4506L, MS[13]#4507L, MS[14]#4508L, MS[15]#4509L, MS[16]#4510L, MS[17]#4511L, MS[18]#4512L, MS[19]#4513L, MS[20]#4514L, MS[21]#4515L, MS[22]#4516L, MS[23]#4517L, MS[24]#4518L, MS[25]#4519L, MS[26]#4520L, MS[27]#4521L, MS[28]#4522L, MS[29]#4523L, MS[30]#4524L, MS[31]#4525L, MS[32]#4526L, MS[33]#4527L, MS[34]#4528L, MS[35]#4529L, MS[36]#4530L, MS[37]#4531L, MS[38]#4532L, MS[39]#4533L, MS[40]#4534L, MS[41]#4535L, MS[42]#4536L, MS[43]#4537L, MS[44]#4538L, MS[45]#4539L, MS[46]#4540L, MS[47]#4541L, MS[48]#4542L, MS[49]#4543L, MS[50]#4544L, MS[51]#4545L, sum#4660L, sum#4661, sum#4662, count#4663L]
Arguments: hashpartitioning(segment#4427, processing_day#4429, 200), ENSURE_REQUIREMENTS, [plan_id=438]
(16) HashAggregate
Input [59]: [segment#4427, processing_day#4429, count#4659L, MS[0]#4494L, MS[1]#4495L, MS[2]#4496L, MS[3]#4497L, MS[4]#4498L, MS[5]#4499L, MS[6]#4500L, MS[7]#4501L, MS[8]#4502L, MS[9]#4503L, MS[10]#4504L, MS[11]#4505L, MS[12]#4506L, MS[13]#4507L, MS[14]#4508L, MS[15]#4509L, MS[16]#4510L, MS[17]#4511L, MS[18]#4512L, MS[19]#4513L, MS[20]#4514L, MS[21]#4515L, MS[22]#4516L, MS[23]#4517L, MS[24]#4518L, MS[25]#4519L, MS[26]#4520L, MS[27]#4521L, MS[28]#4522L, MS[29]#4523L, MS[30]#4524L, MS[31]#4525L, MS[32]#4526L, MS[33]#4527L, MS[34]#4528L, MS[35]#4529L, MS[36]#4530L, MS[37]#4531L, MS[38]#4532L, MS[39]#4533L, MS[40]#4534L, MS[41]#4535L, MS[42]#4536L, MS[43]#4537L, MS[44]#4538L, MS[45]#4539L, MS[46]#4540L, MS[47]#4541L, MS[48]#4542L, MS[49]#4543L, MS[50]#4544L, MS[51]#4545L, sum#4660L, sum#4661, sum#4662, count#4663L]
Keys [2]: [segment#4427, processing_day#4429]
Functions [5]: [count(1), approx_count_distinct(customer_id#4423L, 0.05, 0, 0), sum(events#4433), sum(weighted_amount#4435), avg(amount#4431)]
Aggregate Attributes [5]: [count(1)#4441L, approx_count_distinct(customer_id#4423L, 0.05, 0, 0)#4546L, sum(events#4433)#4547L, sum(weighted_amount#4435)#4548, avg(amount#4431)#4549]
Results [7]: [segment#4427, processing_day#4429, count(1)#4441L AS row_count#4436L, approx_count_distinct(customer_id#4423L, 0.05, 0, 0)#4546L AS unique_customers#4437L, sum(events#4433)#4547L AS event_sum#4438L, sum(weighted_amount#4435)#4548 AS weighted_amount_sum#4439, avg(amount#4431)#4549 AS avg_amount#4440]
(17) Exchange
Input [7]: [segment#4427, processing_day#4429, row_count#4436L, unique_customers#4437L, event_sum#4438L, weighted_amount_sum#4439, avg_amount#4440]
Arguments: rangepartitioning(segment#4427 ASC NULLS FIRST, processing_day#4429 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=441]
(18) Sort
Input [7]: [segment#4427, processing_day#4429, row_count#4436L, unique_customers#4437L, event_sum#4438L, weighted_amount_sum#4439, avg_amount#4440]
Arguments: [segment#4427 ASC NULLS FIRST, processing_day#4429 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#4427, processing_day#4429, row_count#4436L, unique_customers#4437L, event_sum#4438L, weighted_amount_sum#4439, avg_amount#4440]
Arguments: isFinalPlan=true