== 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#28325L]
Arguments: Range (8000000, 9000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#28325L % 250000) AS customer_id#28327L, concat(segment-, cast(cast((id#28325L % 12) as int) as string)) AS segment#28331, cast((id#28325L % 14) as int) AS processing_day#28333, ((cast(((id#28325L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#28335, cast((((id#28325L * 29) % 7) + 1) as int) AS events#28337]
Input [1]: [id#28325L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#28327L, segment#28331, processing_day#28333, amount#28335, events#28337, (amount#28335 * cast(events#28337 as double)) AS weighted_amount#28339]
Input [5]: [customer_id#28327L, segment#28331, processing_day#28333, amount#28335, events#28337]
(4) HashAggregate
Input [6]: [customer_id#28327L, segment#28331, processing_day#28333, amount#28335, events#28337, weighted_amount#28339]
Keys [2]: [segment#28331, processing_day#28333]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#28327L, 0.05, 0, 0), partial_sum(events#28337), partial_sum(weighted_amount#28339), partial_avg(amount#28335)]
Aggregate Attributes [57]: [count#28558L, MS[0]#28346L, MS[1]#28347L, MS[2]#28348L, MS[3]#28349L, MS[4]#28350L, MS[5]#28351L, MS[6]#28352L, MS[7]#28353L, MS[8]#28354L, MS[9]#28355L, MS[10]#28356L, MS[11]#28357L, MS[12]#28358L, MS[13]#28359L, MS[14]#28360L, MS[15]#28361L, MS[16]#28362L, MS[17]#28363L, MS[18]#28364L, MS[19]#28365L, MS[20]#28366L, MS[21]#28367L, MS[22]#28368L, MS[23]#28369L, MS[24]#28370L, MS[25]#28371L, MS[26]#28372L, MS[27]#28373L, MS[28]#28374L, MS[29]#28375L, MS[30]#28376L, MS[31]#28377L, MS[32]#28378L, MS[33]#28379L, MS[34]#28380L, MS[35]#28381L, MS[36]#28382L, MS[37]#28383L, MS[38]#28384L, MS[39]#28385L, MS[40]#28386L, MS[41]#28387L, MS[42]#28388L, MS[43]#28389L, MS[44]#28390L, MS[45]#28391L, MS[46]#28392L, MS[47]#28393L, MS[48]#28394L, MS[49]#28395L, MS[50]#28396L, MS[51]#28397L, sum#28559L, sum#28560, sum#28561, count#28562L]
Results [59]: [segment#28331, processing_day#28333, count#28563L, MS[0]#28398L, MS[1]#28399L, MS[2]#28400L, MS[3]#28401L, MS[4]#28402L, MS[5]#28403L, MS[6]#28404L, MS[7]#28405L, MS[8]#28406L, MS[9]#28407L, MS[10]#28408L, MS[11]#28409L, MS[12]#28410L, MS[13]#28411L, MS[14]#28412L, MS[15]#28413L, MS[16]#28414L, MS[17]#28415L, MS[18]#28416L, MS[19]#28417L, MS[20]#28418L, MS[21]#28419L, MS[22]#28420L, MS[23]#28421L, MS[24]#28422L, MS[25]#28423L, MS[26]#28424L, MS[27]#28425L, MS[28]#28426L, MS[29]#28427L, MS[30]#28428L, MS[31]#28429L, MS[32]#28430L, MS[33]#28431L, MS[34]#28432L, MS[35]#28433L, MS[36]#28434L, MS[37]#28435L, MS[38]#28436L, MS[39]#28437L, MS[40]#28438L, MS[41]#28439L, MS[42]#28440L, MS[43]#28441L, MS[44]#28442L, MS[45]#28443L, MS[46]#28444L, MS[47]#28445L, MS[48]#28446L, MS[49]#28447L, MS[50]#28448L, MS[51]#28449L, sum#28564L, sum#28565, sum#28566, count#28567L]
(5) Exchange
Input [59]: [segment#28331, processing_day#28333, count#28563L, MS[0]#28398L, MS[1]#28399L, MS[2]#28400L, MS[3]#28401L, MS[4]#28402L, MS[5]#28403L, MS[6]#28404L, MS[7]#28405L, MS[8]#28406L, MS[9]#28407L, MS[10]#28408L, MS[11]#28409L, MS[12]#28410L, MS[13]#28411L, MS[14]#28412L, MS[15]#28413L, MS[16]#28414L, MS[17]#28415L, MS[18]#28416L, MS[19]#28417L, MS[20]#28418L, MS[21]#28419L, MS[22]#28420L, MS[23]#28421L, MS[24]#28422L, MS[25]#28423L, MS[26]#28424L, MS[27]#28425L, MS[28]#28426L, MS[29]#28427L, MS[30]#28428L, MS[31]#28429L, MS[32]#28430L, MS[33]#28431L, MS[34]#28432L, MS[35]#28433L, MS[36]#28434L, MS[37]#28435L, MS[38]#28436L, MS[39]#28437L, MS[40]#28438L, MS[41]#28439L, MS[42]#28440L, MS[43]#28441L, MS[44]#28442L, MS[45]#28443L, MS[46]#28444L, MS[47]#28445L, MS[48]#28446L, MS[49]#28447L, MS[50]#28448L, MS[51]#28449L, sum#28564L, sum#28565, sum#28566, count#28567L]
Arguments: hashpartitioning(segment#28331, processing_day#28333, 200), ENSURE_REQUIREMENTS, [plan_id=2705]
(6) ShuffleQueryStage
Output [59]: [segment#28331, processing_day#28333, count#28563L, MS[0]#28398L, MS[1]#28399L, MS[2]#28400L, MS[3]#28401L, MS[4]#28402L, MS[5]#28403L, MS[6]#28404L, MS[7]#28405L, MS[8]#28406L, MS[9]#28407L, MS[10]#28408L, MS[11]#28409L, MS[12]#28410L, MS[13]#28411L, MS[14]#28412L, MS[15]#28413L, MS[16]#28414L, MS[17]#28415L, MS[18]#28416L, MS[19]#28417L, MS[20]#28418L, MS[21]#28419L, MS[22]#28420L, MS[23]#28421L, MS[24]#28422L, MS[25]#28423L, MS[26]#28424L, MS[27]#28425L, MS[28]#28426L, MS[29]#28427L, MS[30]#28428L, MS[31]#28429L, MS[32]#28430L, MS[33]#28431L, MS[34]#28432L, MS[35]#28433L, MS[36]#28434L, MS[37]#28435L, MS[38]#28436L, MS[39]#28437L, MS[40]#28438L, MS[41]#28439L, MS[42]#28440L, MS[43]#28441L, MS[44]#28442L, MS[45]#28443L, MS[46]#28444L, MS[47]#28445L, MS[48]#28446L, MS[49]#28447L, MS[50]#28448L, MS[51]#28449L, sum#28564L, sum#28565, sum#28566, count#28567L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#28331, processing_day#28333, count#28563L, MS[0]#28398L, MS[1]#28399L, MS[2]#28400L, MS[3]#28401L, MS[4]#28402L, MS[5]#28403L, MS[6]#28404L, MS[7]#28405L, MS[8]#28406L, MS[9]#28407L, MS[10]#28408L, MS[11]#28409L, MS[12]#28410L, MS[13]#28411L, MS[14]#28412L, MS[15]#28413L, MS[16]#28414L, MS[17]#28415L, MS[18]#28416L, MS[19]#28417L, MS[20]#28418L, MS[21]#28419L, MS[22]#28420L, MS[23]#28421L, MS[24]#28422L, MS[25]#28423L, MS[26]#28424L, MS[27]#28425L, MS[28]#28426L, MS[29]#28427L, MS[30]#28428L, MS[31]#28429L, MS[32]#28430L, MS[33]#28431L, MS[34]#28432L, MS[35]#28433L, MS[36]#28434L, MS[37]#28435L, MS[38]#28436L, MS[39]#28437L, MS[40]#28438L, MS[41]#28439L, MS[42]#28440L, MS[43]#28441L, MS[44]#28442L, MS[45]#28443L, MS[46]#28444L, MS[47]#28445L, MS[48]#28446L, MS[49]#28447L, MS[50]#28448L, MS[51]#28449L, sum#28564L, sum#28565, sum#28566, count#28567L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#28331, processing_day#28333, count#28563L, MS[0]#28398L, MS[1]#28399L, MS[2]#28400L, MS[3]#28401L, MS[4]#28402L, MS[5]#28403L, MS[6]#28404L, MS[7]#28405L, MS[8]#28406L, MS[9]#28407L, MS[10]#28408L, MS[11]#28409L, MS[12]#28410L, MS[13]#28411L, MS[14]#28412L, MS[15]#28413L, MS[16]#28414L, MS[17]#28415L, MS[18]#28416L, MS[19]#28417L, MS[20]#28418L, MS[21]#28419L, MS[22]#28420L, MS[23]#28421L, MS[24]#28422L, MS[25]#28423L, MS[26]#28424L, MS[27]#28425L, MS[28]#28426L, MS[29]#28427L, MS[30]#28428L, MS[31]#28429L, MS[32]#28430L, MS[33]#28431L, MS[34]#28432L, MS[35]#28433L, MS[36]#28434L, MS[37]#28435L, MS[38]#28436L, MS[39]#28437L, MS[40]#28438L, MS[41]#28439L, MS[42]#28440L, MS[43]#28441L, MS[44]#28442L, MS[45]#28443L, MS[46]#28444L, MS[47]#28445L, MS[48]#28446L, MS[49]#28447L, MS[50]#28448L, MS[51]#28449L, sum#28564L, sum#28565, sum#28566, count#28567L]
Keys [2]: [segment#28331, processing_day#28333]
Functions [5]: [count(1), approx_count_distinct(customer_id#28327L, 0.05, 0, 0), sum(events#28337), sum(weighted_amount#28339), avg(amount#28335)]
Aggregate Attributes [5]: [count(1)#28345L, approx_count_distinct(customer_id#28327L, 0.05, 0, 0)#28450L, sum(events#28337)#28451L, sum(weighted_amount#28339)#28452, avg(amount#28335)#28453]
Results [7]: [segment#28331, processing_day#28333, count(1)#28345L AS row_count#28340L, approx_count_distinct(customer_id#28327L, 0.05, 0, 0)#28450L AS unique_customers#28341L, sum(events#28337)#28451L AS event_sum#28342L, sum(weighted_amount#28339)#28452 AS weighted_amount_sum#28343, avg(amount#28335)#28453 AS avg_amount#28344]
(9) Exchange
Input [7]: [segment#28331, processing_day#28333, row_count#28340L, unique_customers#28341L, event_sum#28342L, weighted_amount_sum#28343, avg_amount#28344]
Arguments: rangepartitioning(segment#28331 ASC NULLS FIRST, processing_day#28333 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2727]
(10) ShuffleQueryStage
Output [7]: [segment#28331, processing_day#28333, row_count#28340L, unique_customers#28341L, event_sum#28342L, weighted_amount_sum#28343, avg_amount#28344]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#28331, processing_day#28333, row_count#28340L, unique_customers#28341L, event_sum#28342L, weighted_amount_sum#28343, avg_amount#28344]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#28331, processing_day#28333, row_count#28340L, unique_customers#28341L, event_sum#28342L, weighted_amount_sum#28343, avg_amount#28344]
Arguments: [segment#28331 ASC NULLS FIRST, processing_day#28333 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#28331, processing_day#28333, row_count#28340L, unique_customers#28341L, event_sum#28342L, weighted_amount_sum#28343, avg_amount#28344]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#28327L, segment#28331, processing_day#28333, amount#28335, events#28337, weighted_amount#28339]
Keys [2]: [segment#28331, processing_day#28333]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#28327L, 0.05, 0, 0), partial_sum(events#28337), partial_sum(weighted_amount#28339), partial_avg(amount#28335)]
Aggregate Attributes [57]: [count#28558L, MS[0]#28346L, MS[1]#28347L, MS[2]#28348L, MS[3]#28349L, MS[4]#28350L, MS[5]#28351L, MS[6]#28352L, MS[7]#28353L, MS[8]#28354L, MS[9]#28355L, MS[10]#28356L, MS[11]#28357L, MS[12]#28358L, MS[13]#28359L, MS[14]#28360L, MS[15]#28361L, MS[16]#28362L, MS[17]#28363L, MS[18]#28364L, MS[19]#28365L, MS[20]#28366L, MS[21]#28367L, MS[22]#28368L, MS[23]#28369L, MS[24]#28370L, MS[25]#28371L, MS[26]#28372L, MS[27]#28373L, MS[28]#28374L, MS[29]#28375L, MS[30]#28376L, MS[31]#28377L, MS[32]#28378L, MS[33]#28379L, MS[34]#28380L, MS[35]#28381L, MS[36]#28382L, MS[37]#28383L, MS[38]#28384L, MS[39]#28385L, MS[40]#28386L, MS[41]#28387L, MS[42]#28388L, MS[43]#28389L, MS[44]#28390L, MS[45]#28391L, MS[46]#28392L, MS[47]#28393L, MS[48]#28394L, MS[49]#28395L, MS[50]#28396L, MS[51]#28397L, sum#28559L, sum#28560, sum#28561, count#28562L]
Results [59]: [segment#28331, processing_day#28333, count#28563L, MS[0]#28398L, MS[1]#28399L, MS[2]#28400L, MS[3]#28401L, MS[4]#28402L, MS[5]#28403L, MS[6]#28404L, MS[7]#28405L, MS[8]#28406L, MS[9]#28407L, MS[10]#28408L, MS[11]#28409L, MS[12]#28410L, MS[13]#28411L, MS[14]#28412L, MS[15]#28413L, MS[16]#28414L, MS[17]#28415L, MS[18]#28416L, MS[19]#28417L, MS[20]#28418L, MS[21]#28419L, MS[22]#28420L, MS[23]#28421L, MS[24]#28422L, MS[25]#28423L, MS[26]#28424L, MS[27]#28425L, MS[28]#28426L, MS[29]#28427L, MS[30]#28428L, MS[31]#28429L, MS[32]#28430L, MS[33]#28431L, MS[34]#28432L, MS[35]#28433L, MS[36]#28434L, MS[37]#28435L, MS[38]#28436L, MS[39]#28437L, MS[40]#28438L, MS[41]#28439L, MS[42]#28440L, MS[43]#28441L, MS[44]#28442L, MS[45]#28443L, MS[46]#28444L, MS[47]#28445L, MS[48]#28446L, MS[49]#28447L, MS[50]#28448L, MS[51]#28449L, sum#28564L, sum#28565, sum#28566, count#28567L]
(15) Exchange
Input [59]: [segment#28331, processing_day#28333, count#28563L, MS[0]#28398L, MS[1]#28399L, MS[2]#28400L, MS[3]#28401L, MS[4]#28402L, MS[5]#28403L, MS[6]#28404L, MS[7]#28405L, MS[8]#28406L, MS[9]#28407L, MS[10]#28408L, MS[11]#28409L, MS[12]#28410L, MS[13]#28411L, MS[14]#28412L, MS[15]#28413L, MS[16]#28414L, MS[17]#28415L, MS[18]#28416L, MS[19]#28417L, MS[20]#28418L, MS[21]#28419L, MS[22]#28420L, MS[23]#28421L, MS[24]#28422L, MS[25]#28423L, MS[26]#28424L, MS[27]#28425L, MS[28]#28426L, MS[29]#28427L, MS[30]#28428L, MS[31]#28429L, MS[32]#28430L, MS[33]#28431L, MS[34]#28432L, MS[35]#28433L, MS[36]#28434L, MS[37]#28435L, MS[38]#28436L, MS[39]#28437L, MS[40]#28438L, MS[41]#28439L, MS[42]#28440L, MS[43]#28441L, MS[44]#28442L, MS[45]#28443L, MS[46]#28444L, MS[47]#28445L, MS[48]#28446L, MS[49]#28447L, MS[50]#28448L, MS[51]#28449L, sum#28564L, sum#28565, sum#28566, count#28567L]
Arguments: hashpartitioning(segment#28331, processing_day#28333, 200), ENSURE_REQUIREMENTS, [plan_id=2685]
(16) HashAggregate
Input [59]: [segment#28331, processing_day#28333, count#28563L, MS[0]#28398L, MS[1]#28399L, MS[2]#28400L, MS[3]#28401L, MS[4]#28402L, MS[5]#28403L, MS[6]#28404L, MS[7]#28405L, MS[8]#28406L, MS[9]#28407L, MS[10]#28408L, MS[11]#28409L, MS[12]#28410L, MS[13]#28411L, MS[14]#28412L, MS[15]#28413L, MS[16]#28414L, MS[17]#28415L, MS[18]#28416L, MS[19]#28417L, MS[20]#28418L, MS[21]#28419L, MS[22]#28420L, MS[23]#28421L, MS[24]#28422L, MS[25]#28423L, MS[26]#28424L, MS[27]#28425L, MS[28]#28426L, MS[29]#28427L, MS[30]#28428L, MS[31]#28429L, MS[32]#28430L, MS[33]#28431L, MS[34]#28432L, MS[35]#28433L, MS[36]#28434L, MS[37]#28435L, MS[38]#28436L, MS[39]#28437L, MS[40]#28438L, MS[41]#28439L, MS[42]#28440L, MS[43]#28441L, MS[44]#28442L, MS[45]#28443L, MS[46]#28444L, MS[47]#28445L, MS[48]#28446L, MS[49]#28447L, MS[50]#28448L, MS[51]#28449L, sum#28564L, sum#28565, sum#28566, count#28567L]
Keys [2]: [segment#28331, processing_day#28333]
Functions [5]: [count(1), approx_count_distinct(customer_id#28327L, 0.05, 0, 0), sum(events#28337), sum(weighted_amount#28339), avg(amount#28335)]
Aggregate Attributes [5]: [count(1)#28345L, approx_count_distinct(customer_id#28327L, 0.05, 0, 0)#28450L, sum(events#28337)#28451L, sum(weighted_amount#28339)#28452, avg(amount#28335)#28453]
Results [7]: [segment#28331, processing_day#28333, count(1)#28345L AS row_count#28340L, approx_count_distinct(customer_id#28327L, 0.05, 0, 0)#28450L AS unique_customers#28341L, sum(events#28337)#28451L AS event_sum#28342L, sum(weighted_amount#28339)#28452 AS weighted_amount_sum#28343, avg(amount#28335)#28453 AS avg_amount#28344]
(17) Exchange
Input [7]: [segment#28331, processing_day#28333, row_count#28340L, unique_customers#28341L, event_sum#28342L, weighted_amount_sum#28343, avg_amount#28344]
Arguments: rangepartitioning(segment#28331 ASC NULLS FIRST, processing_day#28333 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2688]
(18) Sort
Input [7]: [segment#28331, processing_day#28333, row_count#28340L, unique_customers#28341L, event_sum#28342L, weighted_amount_sum#28343, avg_amount#28344]
Arguments: [segment#28331 ASC NULLS FIRST, processing_day#28333 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#28331, processing_day#28333, row_count#28340L, unique_customers#28341L, event_sum#28342L, weighted_amount_sum#28343, avg_amount#28344]
Arguments: isFinalPlan=true