== 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#20333L]
Arguments: Range (23000000, 24000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#20333L % 250000) AS customer_id#20335L, concat(segment-, cast(cast((id#20333L % 12) as int) as string)) AS segment#20339, cast((id#20333L % 14) as int) AS processing_day#20341, ((cast(((id#20333L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#20343, cast((((id#20333L * 29) % 7) + 1) as int) AS events#20345]
Input [1]: [id#20333L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#20335L, segment#20339, processing_day#20341, amount#20343, events#20345, (amount#20343 * cast(events#20345 as double)) AS weighted_amount#20347]
Input [5]: [customer_id#20335L, segment#20339, processing_day#20341, amount#20343, events#20345]
(4) HashAggregate
Input [6]: [customer_id#20335L, segment#20339, processing_day#20341, amount#20343, events#20345, weighted_amount#20347]
Keys [2]: [segment#20339, processing_day#20341]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#20335L, 0.05, 0, 0), partial_sum(events#20345), partial_sum(weighted_amount#20347), partial_avg(amount#20343)]
Aggregate Attributes [57]: [count#20566L, MS[0]#20354L, MS[1]#20355L, MS[2]#20356L, MS[3]#20357L, MS[4]#20358L, MS[5]#20359L, MS[6]#20360L, MS[7]#20361L, MS[8]#20362L, MS[9]#20363L, MS[10]#20364L, MS[11]#20365L, MS[12]#20366L, MS[13]#20367L, MS[14]#20368L, MS[15]#20369L, MS[16]#20370L, MS[17]#20371L, MS[18]#20372L, MS[19]#20373L, MS[20]#20374L, MS[21]#20375L, MS[22]#20376L, MS[23]#20377L, MS[24]#20378L, MS[25]#20379L, MS[26]#20380L, MS[27]#20381L, MS[28]#20382L, MS[29]#20383L, MS[30]#20384L, MS[31]#20385L, MS[32]#20386L, MS[33]#20387L, MS[34]#20388L, MS[35]#20389L, MS[36]#20390L, MS[37]#20391L, MS[38]#20392L, MS[39]#20393L, MS[40]#20394L, MS[41]#20395L, MS[42]#20396L, MS[43]#20397L, MS[44]#20398L, MS[45]#20399L, MS[46]#20400L, MS[47]#20401L, MS[48]#20402L, MS[49]#20403L, MS[50]#20404L, MS[51]#20405L, sum#20567L, sum#20568, sum#20569, count#20570L]
Results [59]: [segment#20339, processing_day#20341, count#20571L, MS[0]#20406L, MS[1]#20407L, MS[2]#20408L, MS[3]#20409L, MS[4]#20410L, MS[5]#20411L, MS[6]#20412L, MS[7]#20413L, MS[8]#20414L, MS[9]#20415L, MS[10]#20416L, MS[11]#20417L, MS[12]#20418L, MS[13]#20419L, MS[14]#20420L, MS[15]#20421L, MS[16]#20422L, MS[17]#20423L, MS[18]#20424L, MS[19]#20425L, MS[20]#20426L, MS[21]#20427L, MS[22]#20428L, MS[23]#20429L, MS[24]#20430L, MS[25]#20431L, MS[26]#20432L, MS[27]#20433L, MS[28]#20434L, MS[29]#20435L, MS[30]#20436L, MS[31]#20437L, MS[32]#20438L, MS[33]#20439L, MS[34]#20440L, MS[35]#20441L, MS[36]#20442L, MS[37]#20443L, MS[38]#20444L, MS[39]#20445L, MS[40]#20446L, MS[41]#20447L, MS[42]#20448L, MS[43]#20449L, MS[44]#20450L, MS[45]#20451L, MS[46]#20452L, MS[47]#20453L, MS[48]#20454L, MS[49]#20455L, MS[50]#20456L, MS[51]#20457L, sum#20572L, sum#20573, sum#20574, count#20575L]
(5) Exchange
Input [59]: [segment#20339, processing_day#20341, count#20571L, MS[0]#20406L, MS[1]#20407L, MS[2]#20408L, MS[3]#20409L, MS[4]#20410L, MS[5]#20411L, MS[6]#20412L, MS[7]#20413L, MS[8]#20414L, MS[9]#20415L, MS[10]#20416L, MS[11]#20417L, MS[12]#20418L, MS[13]#20419L, MS[14]#20420L, MS[15]#20421L, MS[16]#20422L, MS[17]#20423L, MS[18]#20424L, MS[19]#20425L, MS[20]#20426L, MS[21]#20427L, MS[22]#20428L, MS[23]#20429L, MS[24]#20430L, MS[25]#20431L, MS[26]#20432L, MS[27]#20433L, MS[28]#20434L, MS[29]#20435L, MS[30]#20436L, MS[31]#20437L, MS[32]#20438L, MS[33]#20439L, MS[34]#20440L, MS[35]#20441L, MS[36]#20442L, MS[37]#20443L, MS[38]#20444L, MS[39]#20445L, MS[40]#20446L, MS[41]#20447L, MS[42]#20448L, MS[43]#20449L, MS[44]#20450L, MS[45]#20451L, MS[46]#20452L, MS[47]#20453L, MS[48]#20454L, MS[49]#20455L, MS[50]#20456L, MS[51]#20457L, sum#20572L, sum#20573, sum#20574, count#20575L]
Arguments: hashpartitioning(segment#20339, processing_day#20341, 200), ENSURE_REQUIREMENTS, [plan_id=1952]
(6) ShuffleQueryStage
Output [59]: [segment#20339, processing_day#20341, count#20571L, MS[0]#20406L, MS[1]#20407L, MS[2]#20408L, MS[3]#20409L, MS[4]#20410L, MS[5]#20411L, MS[6]#20412L, MS[7]#20413L, MS[8]#20414L, MS[9]#20415L, MS[10]#20416L, MS[11]#20417L, MS[12]#20418L, MS[13]#20419L, MS[14]#20420L, MS[15]#20421L, MS[16]#20422L, MS[17]#20423L, MS[18]#20424L, MS[19]#20425L, MS[20]#20426L, MS[21]#20427L, MS[22]#20428L, MS[23]#20429L, MS[24]#20430L, MS[25]#20431L, MS[26]#20432L, MS[27]#20433L, MS[28]#20434L, MS[29]#20435L, MS[30]#20436L, MS[31]#20437L, MS[32]#20438L, MS[33]#20439L, MS[34]#20440L, MS[35]#20441L, MS[36]#20442L, MS[37]#20443L, MS[38]#20444L, MS[39]#20445L, MS[40]#20446L, MS[41]#20447L, MS[42]#20448L, MS[43]#20449L, MS[44]#20450L, MS[45]#20451L, MS[46]#20452L, MS[47]#20453L, MS[48]#20454L, MS[49]#20455L, MS[50]#20456L, MS[51]#20457L, sum#20572L, sum#20573, sum#20574, count#20575L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#20339, processing_day#20341, count#20571L, MS[0]#20406L, MS[1]#20407L, MS[2]#20408L, MS[3]#20409L, MS[4]#20410L, MS[5]#20411L, MS[6]#20412L, MS[7]#20413L, MS[8]#20414L, MS[9]#20415L, MS[10]#20416L, MS[11]#20417L, MS[12]#20418L, MS[13]#20419L, MS[14]#20420L, MS[15]#20421L, MS[16]#20422L, MS[17]#20423L, MS[18]#20424L, MS[19]#20425L, MS[20]#20426L, MS[21]#20427L, MS[22]#20428L, MS[23]#20429L, MS[24]#20430L, MS[25]#20431L, MS[26]#20432L, MS[27]#20433L, MS[28]#20434L, MS[29]#20435L, MS[30]#20436L, MS[31]#20437L, MS[32]#20438L, MS[33]#20439L, MS[34]#20440L, MS[35]#20441L, MS[36]#20442L, MS[37]#20443L, MS[38]#20444L, MS[39]#20445L, MS[40]#20446L, MS[41]#20447L, MS[42]#20448L, MS[43]#20449L, MS[44]#20450L, MS[45]#20451L, MS[46]#20452L, MS[47]#20453L, MS[48]#20454L, MS[49]#20455L, MS[50]#20456L, MS[51]#20457L, sum#20572L, sum#20573, sum#20574, count#20575L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#20339, processing_day#20341, count#20571L, MS[0]#20406L, MS[1]#20407L, MS[2]#20408L, MS[3]#20409L, MS[4]#20410L, MS[5]#20411L, MS[6]#20412L, MS[7]#20413L, MS[8]#20414L, MS[9]#20415L, MS[10]#20416L, MS[11]#20417L, MS[12]#20418L, MS[13]#20419L, MS[14]#20420L, MS[15]#20421L, MS[16]#20422L, MS[17]#20423L, MS[18]#20424L, MS[19]#20425L, MS[20]#20426L, MS[21]#20427L, MS[22]#20428L, MS[23]#20429L, MS[24]#20430L, MS[25]#20431L, MS[26]#20432L, MS[27]#20433L, MS[28]#20434L, MS[29]#20435L, MS[30]#20436L, MS[31]#20437L, MS[32]#20438L, MS[33]#20439L, MS[34]#20440L, MS[35]#20441L, MS[36]#20442L, MS[37]#20443L, MS[38]#20444L, MS[39]#20445L, MS[40]#20446L, MS[41]#20447L, MS[42]#20448L, MS[43]#20449L, MS[44]#20450L, MS[45]#20451L, MS[46]#20452L, MS[47]#20453L, MS[48]#20454L, MS[49]#20455L, MS[50]#20456L, MS[51]#20457L, sum#20572L, sum#20573, sum#20574, count#20575L]
Keys [2]: [segment#20339, processing_day#20341]
Functions [5]: [count(1), approx_count_distinct(customer_id#20335L, 0.05, 0, 0), sum(events#20345), sum(weighted_amount#20347), avg(amount#20343)]
Aggregate Attributes [5]: [count(1)#20353L, approx_count_distinct(customer_id#20335L, 0.05, 0, 0)#20458L, sum(events#20345)#20459L, sum(weighted_amount#20347)#20460, avg(amount#20343)#20461]
Results [7]: [segment#20339, processing_day#20341, count(1)#20353L AS row_count#20348L, approx_count_distinct(customer_id#20335L, 0.05, 0, 0)#20458L AS unique_customers#20349L, sum(events#20345)#20459L AS event_sum#20350L, sum(weighted_amount#20347)#20460 AS weighted_amount_sum#20351, avg(amount#20343)#20461 AS avg_amount#20352]
(9) Exchange
Input [7]: [segment#20339, processing_day#20341, row_count#20348L, unique_customers#20349L, event_sum#20350L, weighted_amount_sum#20351, avg_amount#20352]
Arguments: rangepartitioning(segment#20339 ASC NULLS FIRST, processing_day#20341 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1974]
(10) ShuffleQueryStage
Output [7]: [segment#20339, processing_day#20341, row_count#20348L, unique_customers#20349L, event_sum#20350L, weighted_amount_sum#20351, avg_amount#20352]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#20339, processing_day#20341, row_count#20348L, unique_customers#20349L, event_sum#20350L, weighted_amount_sum#20351, avg_amount#20352]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#20339, processing_day#20341, row_count#20348L, unique_customers#20349L, event_sum#20350L, weighted_amount_sum#20351, avg_amount#20352]
Arguments: [segment#20339 ASC NULLS FIRST, processing_day#20341 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#20339, processing_day#20341, row_count#20348L, unique_customers#20349L, event_sum#20350L, weighted_amount_sum#20351, avg_amount#20352]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#20335L, segment#20339, processing_day#20341, amount#20343, events#20345, weighted_amount#20347]
Keys [2]: [segment#20339, processing_day#20341]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#20335L, 0.05, 0, 0), partial_sum(events#20345), partial_sum(weighted_amount#20347), partial_avg(amount#20343)]
Aggregate Attributes [57]: [count#20566L, MS[0]#20354L, MS[1]#20355L, MS[2]#20356L, MS[3]#20357L, MS[4]#20358L, MS[5]#20359L, MS[6]#20360L, MS[7]#20361L, MS[8]#20362L, MS[9]#20363L, MS[10]#20364L, MS[11]#20365L, MS[12]#20366L, MS[13]#20367L, MS[14]#20368L, MS[15]#20369L, MS[16]#20370L, MS[17]#20371L, MS[18]#20372L, MS[19]#20373L, MS[20]#20374L, MS[21]#20375L, MS[22]#20376L, MS[23]#20377L, MS[24]#20378L, MS[25]#20379L, MS[26]#20380L, MS[27]#20381L, MS[28]#20382L, MS[29]#20383L, MS[30]#20384L, MS[31]#20385L, MS[32]#20386L, MS[33]#20387L, MS[34]#20388L, MS[35]#20389L, MS[36]#20390L, MS[37]#20391L, MS[38]#20392L, MS[39]#20393L, MS[40]#20394L, MS[41]#20395L, MS[42]#20396L, MS[43]#20397L, MS[44]#20398L, MS[45]#20399L, MS[46]#20400L, MS[47]#20401L, MS[48]#20402L, MS[49]#20403L, MS[50]#20404L, MS[51]#20405L, sum#20567L, sum#20568, sum#20569, count#20570L]
Results [59]: [segment#20339, processing_day#20341, count#20571L, MS[0]#20406L, MS[1]#20407L, MS[2]#20408L, MS[3]#20409L, MS[4]#20410L, MS[5]#20411L, MS[6]#20412L, MS[7]#20413L, MS[8]#20414L, MS[9]#20415L, MS[10]#20416L, MS[11]#20417L, MS[12]#20418L, MS[13]#20419L, MS[14]#20420L, MS[15]#20421L, MS[16]#20422L, MS[17]#20423L, MS[18]#20424L, MS[19]#20425L, MS[20]#20426L, MS[21]#20427L, MS[22]#20428L, MS[23]#20429L, MS[24]#20430L, MS[25]#20431L, MS[26]#20432L, MS[27]#20433L, MS[28]#20434L, MS[29]#20435L, MS[30]#20436L, MS[31]#20437L, MS[32]#20438L, MS[33]#20439L, MS[34]#20440L, MS[35]#20441L, MS[36]#20442L, MS[37]#20443L, MS[38]#20444L, MS[39]#20445L, MS[40]#20446L, MS[41]#20447L, MS[42]#20448L, MS[43]#20449L, MS[44]#20450L, MS[45]#20451L, MS[46]#20452L, MS[47]#20453L, MS[48]#20454L, MS[49]#20455L, MS[50]#20456L, MS[51]#20457L, sum#20572L, sum#20573, sum#20574, count#20575L]
(15) Exchange
Input [59]: [segment#20339, processing_day#20341, count#20571L, MS[0]#20406L, MS[1]#20407L, MS[2]#20408L, MS[3]#20409L, MS[4]#20410L, MS[5]#20411L, MS[6]#20412L, MS[7]#20413L, MS[8]#20414L, MS[9]#20415L, MS[10]#20416L, MS[11]#20417L, MS[12]#20418L, MS[13]#20419L, MS[14]#20420L, MS[15]#20421L, MS[16]#20422L, MS[17]#20423L, MS[18]#20424L, MS[19]#20425L, MS[20]#20426L, MS[21]#20427L, MS[22]#20428L, MS[23]#20429L, MS[24]#20430L, MS[25]#20431L, MS[26]#20432L, MS[27]#20433L, MS[28]#20434L, MS[29]#20435L, MS[30]#20436L, MS[31]#20437L, MS[32]#20438L, MS[33]#20439L, MS[34]#20440L, MS[35]#20441L, MS[36]#20442L, MS[37]#20443L, MS[38]#20444L, MS[39]#20445L, MS[40]#20446L, MS[41]#20447L, MS[42]#20448L, MS[43]#20449L, MS[44]#20450L, MS[45]#20451L, MS[46]#20452L, MS[47]#20453L, MS[48]#20454L, MS[49]#20455L, MS[50]#20456L, MS[51]#20457L, sum#20572L, sum#20573, sum#20574, count#20575L]
Arguments: hashpartitioning(segment#20339, processing_day#20341, 200), ENSURE_REQUIREMENTS, [plan_id=1932]
(16) HashAggregate
Input [59]: [segment#20339, processing_day#20341, count#20571L, MS[0]#20406L, MS[1]#20407L, MS[2]#20408L, MS[3]#20409L, MS[4]#20410L, MS[5]#20411L, MS[6]#20412L, MS[7]#20413L, MS[8]#20414L, MS[9]#20415L, MS[10]#20416L, MS[11]#20417L, MS[12]#20418L, MS[13]#20419L, MS[14]#20420L, MS[15]#20421L, MS[16]#20422L, MS[17]#20423L, MS[18]#20424L, MS[19]#20425L, MS[20]#20426L, MS[21]#20427L, MS[22]#20428L, MS[23]#20429L, MS[24]#20430L, MS[25]#20431L, MS[26]#20432L, MS[27]#20433L, MS[28]#20434L, MS[29]#20435L, MS[30]#20436L, MS[31]#20437L, MS[32]#20438L, MS[33]#20439L, MS[34]#20440L, MS[35]#20441L, MS[36]#20442L, MS[37]#20443L, MS[38]#20444L, MS[39]#20445L, MS[40]#20446L, MS[41]#20447L, MS[42]#20448L, MS[43]#20449L, MS[44]#20450L, MS[45]#20451L, MS[46]#20452L, MS[47]#20453L, MS[48]#20454L, MS[49]#20455L, MS[50]#20456L, MS[51]#20457L, sum#20572L, sum#20573, sum#20574, count#20575L]
Keys [2]: [segment#20339, processing_day#20341]
Functions [5]: [count(1), approx_count_distinct(customer_id#20335L, 0.05, 0, 0), sum(events#20345), sum(weighted_amount#20347), avg(amount#20343)]
Aggregate Attributes [5]: [count(1)#20353L, approx_count_distinct(customer_id#20335L, 0.05, 0, 0)#20458L, sum(events#20345)#20459L, sum(weighted_amount#20347)#20460, avg(amount#20343)#20461]
Results [7]: [segment#20339, processing_day#20341, count(1)#20353L AS row_count#20348L, approx_count_distinct(customer_id#20335L, 0.05, 0, 0)#20458L AS unique_customers#20349L, sum(events#20345)#20459L AS event_sum#20350L, sum(weighted_amount#20347)#20460 AS weighted_amount_sum#20351, avg(amount#20343)#20461 AS avg_amount#20352]
(17) Exchange
Input [7]: [segment#20339, processing_day#20341, row_count#20348L, unique_customers#20349L, event_sum#20350L, weighted_amount_sum#20351, avg_amount#20352]
Arguments: rangepartitioning(segment#20339 ASC NULLS FIRST, processing_day#20341 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1935]
(18) Sort
Input [7]: [segment#20339, processing_day#20341, row_count#20348L, unique_customers#20349L, event_sum#20350L, weighted_amount_sum#20351, avg_amount#20352]
Arguments: [segment#20339 ASC NULLS FIRST, processing_day#20341 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#20339, processing_day#20341, row_count#20348L, unique_customers#20349L, event_sum#20350L, weighted_amount_sum#20351, avg_amount#20352]
Arguments: isFinalPlan=true