== 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#51343L]
Arguments: Range (10000000, 11000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#51343L % 250000) AS customer_id#51345L, concat(segment-, cast(cast((id#51343L % 12) as int) as string)) AS segment#51349, cast((id#51343L % 14) as int) AS processing_day#51351, ((cast(((id#51343L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#51353, cast((((id#51343L * 29) % 7) + 1) as int) AS events#51355]
Input [1]: [id#51343L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#51345L, segment#51349, processing_day#51351, amount#51353, events#51355, (amount#51353 * cast(events#51355 as double)) AS weighted_amount#51357]
Input [5]: [customer_id#51345L, segment#51349, processing_day#51351, amount#51353, events#51355]
(4) HashAggregate
Input [6]: [customer_id#51345L, segment#51349, processing_day#51351, amount#51353, events#51355, weighted_amount#51357]
Keys [2]: [segment#51349, processing_day#51351]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#51345L, 0.05, 0, 0), partial_sum(events#51355), partial_sum(weighted_amount#51357), partial_avg(amount#51353)]
Aggregate Attributes [57]: [count#51576L, MS[0]#51364L, MS[1]#51365L, MS[2]#51366L, MS[3]#51367L, MS[4]#51368L, MS[5]#51369L, MS[6]#51370L, MS[7]#51371L, MS[8]#51372L, MS[9]#51373L, MS[10]#51374L, MS[11]#51375L, MS[12]#51376L, MS[13]#51377L, MS[14]#51378L, MS[15]#51379L, MS[16]#51380L, MS[17]#51381L, MS[18]#51382L, MS[19]#51383L, MS[20]#51384L, MS[21]#51385L, MS[22]#51386L, MS[23]#51387L, MS[24]#51388L, MS[25]#51389L, MS[26]#51390L, MS[27]#51391L, MS[28]#51392L, MS[29]#51393L, MS[30]#51394L, MS[31]#51395L, MS[32]#51396L, MS[33]#51397L, MS[34]#51398L, MS[35]#51399L, MS[36]#51400L, MS[37]#51401L, MS[38]#51402L, MS[39]#51403L, MS[40]#51404L, MS[41]#51405L, MS[42]#51406L, MS[43]#51407L, MS[44]#51408L, MS[45]#51409L, MS[46]#51410L, MS[47]#51411L, MS[48]#51412L, MS[49]#51413L, MS[50]#51414L, MS[51]#51415L, sum#51577L, sum#51578, sum#51579, count#51580L]
Results [59]: [segment#51349, processing_day#51351, count#51581L, MS[0]#51416L, MS[1]#51417L, MS[2]#51418L, MS[3]#51419L, MS[4]#51420L, MS[5]#51421L, MS[6]#51422L, MS[7]#51423L, MS[8]#51424L, MS[9]#51425L, MS[10]#51426L, MS[11]#51427L, MS[12]#51428L, MS[13]#51429L, MS[14]#51430L, MS[15]#51431L, MS[16]#51432L, MS[17]#51433L, MS[18]#51434L, MS[19]#51435L, MS[20]#51436L, MS[21]#51437L, MS[22]#51438L, MS[23]#51439L, MS[24]#51440L, MS[25]#51441L, MS[26]#51442L, MS[27]#51443L, MS[28]#51444L, MS[29]#51445L, MS[30]#51446L, MS[31]#51447L, MS[32]#51448L, MS[33]#51449L, MS[34]#51450L, MS[35]#51451L, MS[36]#51452L, MS[37]#51453L, MS[38]#51454L, MS[39]#51455L, MS[40]#51456L, MS[41]#51457L, MS[42]#51458L, MS[43]#51459L, MS[44]#51460L, MS[45]#51461L, MS[46]#51462L, MS[47]#51463L, MS[48]#51464L, MS[49]#51465L, MS[50]#51466L, MS[51]#51467L, sum#51582L, sum#51583, sum#51584, count#51585L]
(5) Exchange
Input [59]: [segment#51349, processing_day#51351, count#51581L, MS[0]#51416L, MS[1]#51417L, MS[2]#51418L, MS[3]#51419L, MS[4]#51420L, MS[5]#51421L, MS[6]#51422L, MS[7]#51423L, MS[8]#51424L, MS[9]#51425L, MS[10]#51426L, MS[11]#51427L, MS[12]#51428L, MS[13]#51429L, MS[14]#51430L, MS[15]#51431L, MS[16]#51432L, MS[17]#51433L, MS[18]#51434L, MS[19]#51435L, MS[20]#51436L, MS[21]#51437L, MS[22]#51438L, MS[23]#51439L, MS[24]#51440L, MS[25]#51441L, MS[26]#51442L, MS[27]#51443L, MS[28]#51444L, MS[29]#51445L, MS[30]#51446L, MS[31]#51447L, MS[32]#51448L, MS[33]#51449L, MS[34]#51450L, MS[35]#51451L, MS[36]#51452L, MS[37]#51453L, MS[38]#51454L, MS[39]#51455L, MS[40]#51456L, MS[41]#51457L, MS[42]#51458L, MS[43]#51459L, MS[44]#51460L, MS[45]#51461L, MS[46]#51462L, MS[47]#51463L, MS[48]#51464L, MS[49]#51465L, MS[50]#51466L, MS[51]#51467L, sum#51582L, sum#51583, sum#51584, count#51585L]
Arguments: hashpartitioning(segment#51349, processing_day#51351, 200), ENSURE_REQUIREMENTS, [plan_id=4869]
(6) ShuffleQueryStage
Output [59]: [segment#51349, processing_day#51351, count#51581L, MS[0]#51416L, MS[1]#51417L, MS[2]#51418L, MS[3]#51419L, MS[4]#51420L, MS[5]#51421L, MS[6]#51422L, MS[7]#51423L, MS[8]#51424L, MS[9]#51425L, MS[10]#51426L, MS[11]#51427L, MS[12]#51428L, MS[13]#51429L, MS[14]#51430L, MS[15]#51431L, MS[16]#51432L, MS[17]#51433L, MS[18]#51434L, MS[19]#51435L, MS[20]#51436L, MS[21]#51437L, MS[22]#51438L, MS[23]#51439L, MS[24]#51440L, MS[25]#51441L, MS[26]#51442L, MS[27]#51443L, MS[28]#51444L, MS[29]#51445L, MS[30]#51446L, MS[31]#51447L, MS[32]#51448L, MS[33]#51449L, MS[34]#51450L, MS[35]#51451L, MS[36]#51452L, MS[37]#51453L, MS[38]#51454L, MS[39]#51455L, MS[40]#51456L, MS[41]#51457L, MS[42]#51458L, MS[43]#51459L, MS[44]#51460L, MS[45]#51461L, MS[46]#51462L, MS[47]#51463L, MS[48]#51464L, MS[49]#51465L, MS[50]#51466L, MS[51]#51467L, sum#51582L, sum#51583, sum#51584, count#51585L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#51349, processing_day#51351, count#51581L, MS[0]#51416L, MS[1]#51417L, MS[2]#51418L, MS[3]#51419L, MS[4]#51420L, MS[5]#51421L, MS[6]#51422L, MS[7]#51423L, MS[8]#51424L, MS[9]#51425L, MS[10]#51426L, MS[11]#51427L, MS[12]#51428L, MS[13]#51429L, MS[14]#51430L, MS[15]#51431L, MS[16]#51432L, MS[17]#51433L, MS[18]#51434L, MS[19]#51435L, MS[20]#51436L, MS[21]#51437L, MS[22]#51438L, MS[23]#51439L, MS[24]#51440L, MS[25]#51441L, MS[26]#51442L, MS[27]#51443L, MS[28]#51444L, MS[29]#51445L, MS[30]#51446L, MS[31]#51447L, MS[32]#51448L, MS[33]#51449L, MS[34]#51450L, MS[35]#51451L, MS[36]#51452L, MS[37]#51453L, MS[38]#51454L, MS[39]#51455L, MS[40]#51456L, MS[41]#51457L, MS[42]#51458L, MS[43]#51459L, MS[44]#51460L, MS[45]#51461L, MS[46]#51462L, MS[47]#51463L, MS[48]#51464L, MS[49]#51465L, MS[50]#51466L, MS[51]#51467L, sum#51582L, sum#51583, sum#51584, count#51585L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#51349, processing_day#51351, count#51581L, MS[0]#51416L, MS[1]#51417L, MS[2]#51418L, MS[3]#51419L, MS[4]#51420L, MS[5]#51421L, MS[6]#51422L, MS[7]#51423L, MS[8]#51424L, MS[9]#51425L, MS[10]#51426L, MS[11]#51427L, MS[12]#51428L, MS[13]#51429L, MS[14]#51430L, MS[15]#51431L, MS[16]#51432L, MS[17]#51433L, MS[18]#51434L, MS[19]#51435L, MS[20]#51436L, MS[21]#51437L, MS[22]#51438L, MS[23]#51439L, MS[24]#51440L, MS[25]#51441L, MS[26]#51442L, MS[27]#51443L, MS[28]#51444L, MS[29]#51445L, MS[30]#51446L, MS[31]#51447L, MS[32]#51448L, MS[33]#51449L, MS[34]#51450L, MS[35]#51451L, MS[36]#51452L, MS[37]#51453L, MS[38]#51454L, MS[39]#51455L, MS[40]#51456L, MS[41]#51457L, MS[42]#51458L, MS[43]#51459L, MS[44]#51460L, MS[45]#51461L, MS[46]#51462L, MS[47]#51463L, MS[48]#51464L, MS[49]#51465L, MS[50]#51466L, MS[51]#51467L, sum#51582L, sum#51583, sum#51584, count#51585L]
Keys [2]: [segment#51349, processing_day#51351]
Functions [5]: [count(1), approx_count_distinct(customer_id#51345L, 0.05, 0, 0), sum(events#51355), sum(weighted_amount#51357), avg(amount#51353)]
Aggregate Attributes [5]: [count(1)#51363L, approx_count_distinct(customer_id#51345L, 0.05, 0, 0)#51468L, sum(events#51355)#51469L, sum(weighted_amount#51357)#51470, avg(amount#51353)#51471]
Results [7]: [segment#51349, processing_day#51351, count(1)#51363L AS row_count#51358L, approx_count_distinct(customer_id#51345L, 0.05, 0, 0)#51468L AS unique_customers#51359L, sum(events#51355)#51469L AS event_sum#51360L, sum(weighted_amount#51357)#51470 AS weighted_amount_sum#51361, avg(amount#51353)#51471 AS avg_amount#51362]
(9) Exchange
Input [7]: [segment#51349, processing_day#51351, row_count#51358L, unique_customers#51359L, event_sum#51360L, weighted_amount_sum#51361, avg_amount#51362]
Arguments: rangepartitioning(segment#51349 ASC NULLS FIRST, processing_day#51351 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4891]
(10) ShuffleQueryStage
Output [7]: [segment#51349, processing_day#51351, row_count#51358L, unique_customers#51359L, event_sum#51360L, weighted_amount_sum#51361, avg_amount#51362]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#51349, processing_day#51351, row_count#51358L, unique_customers#51359L, event_sum#51360L, weighted_amount_sum#51361, avg_amount#51362]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#51349, processing_day#51351, row_count#51358L, unique_customers#51359L, event_sum#51360L, weighted_amount_sum#51361, avg_amount#51362]
Arguments: [segment#51349 ASC NULLS FIRST, processing_day#51351 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#51349, processing_day#51351, row_count#51358L, unique_customers#51359L, event_sum#51360L, weighted_amount_sum#51361, avg_amount#51362]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#51345L, segment#51349, processing_day#51351, amount#51353, events#51355, weighted_amount#51357]
Keys [2]: [segment#51349, processing_day#51351]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#51345L, 0.05, 0, 0), partial_sum(events#51355), partial_sum(weighted_amount#51357), partial_avg(amount#51353)]
Aggregate Attributes [57]: [count#51576L, MS[0]#51364L, MS[1]#51365L, MS[2]#51366L, MS[3]#51367L, MS[4]#51368L, MS[5]#51369L, MS[6]#51370L, MS[7]#51371L, MS[8]#51372L, MS[9]#51373L, MS[10]#51374L, MS[11]#51375L, MS[12]#51376L, MS[13]#51377L, MS[14]#51378L, MS[15]#51379L, MS[16]#51380L, MS[17]#51381L, MS[18]#51382L, MS[19]#51383L, MS[20]#51384L, MS[21]#51385L, MS[22]#51386L, MS[23]#51387L, MS[24]#51388L, MS[25]#51389L, MS[26]#51390L, MS[27]#51391L, MS[28]#51392L, MS[29]#51393L, MS[30]#51394L, MS[31]#51395L, MS[32]#51396L, MS[33]#51397L, MS[34]#51398L, MS[35]#51399L, MS[36]#51400L, MS[37]#51401L, MS[38]#51402L, MS[39]#51403L, MS[40]#51404L, MS[41]#51405L, MS[42]#51406L, MS[43]#51407L, MS[44]#51408L, MS[45]#51409L, MS[46]#51410L, MS[47]#51411L, MS[48]#51412L, MS[49]#51413L, MS[50]#51414L, MS[51]#51415L, sum#51577L, sum#51578, sum#51579, count#51580L]
Results [59]: [segment#51349, processing_day#51351, count#51581L, MS[0]#51416L, MS[1]#51417L, MS[2]#51418L, MS[3]#51419L, MS[4]#51420L, MS[5]#51421L, MS[6]#51422L, MS[7]#51423L, MS[8]#51424L, MS[9]#51425L, MS[10]#51426L, MS[11]#51427L, MS[12]#51428L, MS[13]#51429L, MS[14]#51430L, MS[15]#51431L, MS[16]#51432L, MS[17]#51433L, MS[18]#51434L, MS[19]#51435L, MS[20]#51436L, MS[21]#51437L, MS[22]#51438L, MS[23]#51439L, MS[24]#51440L, MS[25]#51441L, MS[26]#51442L, MS[27]#51443L, MS[28]#51444L, MS[29]#51445L, MS[30]#51446L, MS[31]#51447L, MS[32]#51448L, MS[33]#51449L, MS[34]#51450L, MS[35]#51451L, MS[36]#51452L, MS[37]#51453L, MS[38]#51454L, MS[39]#51455L, MS[40]#51456L, MS[41]#51457L, MS[42]#51458L, MS[43]#51459L, MS[44]#51460L, MS[45]#51461L, MS[46]#51462L, MS[47]#51463L, MS[48]#51464L, MS[49]#51465L, MS[50]#51466L, MS[51]#51467L, sum#51582L, sum#51583, sum#51584, count#51585L]
(15) Exchange
Input [59]: [segment#51349, processing_day#51351, count#51581L, MS[0]#51416L, MS[1]#51417L, MS[2]#51418L, MS[3]#51419L, MS[4]#51420L, MS[5]#51421L, MS[6]#51422L, MS[7]#51423L, MS[8]#51424L, MS[9]#51425L, MS[10]#51426L, MS[11]#51427L, MS[12]#51428L, MS[13]#51429L, MS[14]#51430L, MS[15]#51431L, MS[16]#51432L, MS[17]#51433L, MS[18]#51434L, MS[19]#51435L, MS[20]#51436L, MS[21]#51437L, MS[22]#51438L, MS[23]#51439L, MS[24]#51440L, MS[25]#51441L, MS[26]#51442L, MS[27]#51443L, MS[28]#51444L, MS[29]#51445L, MS[30]#51446L, MS[31]#51447L, MS[32]#51448L, MS[33]#51449L, MS[34]#51450L, MS[35]#51451L, MS[36]#51452L, MS[37]#51453L, MS[38]#51454L, MS[39]#51455L, MS[40]#51456L, MS[41]#51457L, MS[42]#51458L, MS[43]#51459L, MS[44]#51460L, MS[45]#51461L, MS[46]#51462L, MS[47]#51463L, MS[48]#51464L, MS[49]#51465L, MS[50]#51466L, MS[51]#51467L, sum#51582L, sum#51583, sum#51584, count#51585L]
Arguments: hashpartitioning(segment#51349, processing_day#51351, 200), ENSURE_REQUIREMENTS, [plan_id=4849]
(16) HashAggregate
Input [59]: [segment#51349, processing_day#51351, count#51581L, MS[0]#51416L, MS[1]#51417L, MS[2]#51418L, MS[3]#51419L, MS[4]#51420L, MS[5]#51421L, MS[6]#51422L, MS[7]#51423L, MS[8]#51424L, MS[9]#51425L, MS[10]#51426L, MS[11]#51427L, MS[12]#51428L, MS[13]#51429L, MS[14]#51430L, MS[15]#51431L, MS[16]#51432L, MS[17]#51433L, MS[18]#51434L, MS[19]#51435L, MS[20]#51436L, MS[21]#51437L, MS[22]#51438L, MS[23]#51439L, MS[24]#51440L, MS[25]#51441L, MS[26]#51442L, MS[27]#51443L, MS[28]#51444L, MS[29]#51445L, MS[30]#51446L, MS[31]#51447L, MS[32]#51448L, MS[33]#51449L, MS[34]#51450L, MS[35]#51451L, MS[36]#51452L, MS[37]#51453L, MS[38]#51454L, MS[39]#51455L, MS[40]#51456L, MS[41]#51457L, MS[42]#51458L, MS[43]#51459L, MS[44]#51460L, MS[45]#51461L, MS[46]#51462L, MS[47]#51463L, MS[48]#51464L, MS[49]#51465L, MS[50]#51466L, MS[51]#51467L, sum#51582L, sum#51583, sum#51584, count#51585L]
Keys [2]: [segment#51349, processing_day#51351]
Functions [5]: [count(1), approx_count_distinct(customer_id#51345L, 0.05, 0, 0), sum(events#51355), sum(weighted_amount#51357), avg(amount#51353)]
Aggregate Attributes [5]: [count(1)#51363L, approx_count_distinct(customer_id#51345L, 0.05, 0, 0)#51468L, sum(events#51355)#51469L, sum(weighted_amount#51357)#51470, avg(amount#51353)#51471]
Results [7]: [segment#51349, processing_day#51351, count(1)#51363L AS row_count#51358L, approx_count_distinct(customer_id#51345L, 0.05, 0, 0)#51468L AS unique_customers#51359L, sum(events#51355)#51469L AS event_sum#51360L, sum(weighted_amount#51357)#51470 AS weighted_amount_sum#51361, avg(amount#51353)#51471 AS avg_amount#51362]
(17) Exchange
Input [7]: [segment#51349, processing_day#51351, row_count#51358L, unique_customers#51359L, event_sum#51360L, weighted_amount_sum#51361, avg_amount#51362]
Arguments: rangepartitioning(segment#51349 ASC NULLS FIRST, processing_day#51351 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4852]
(18) Sort
Input [7]: [segment#51349, processing_day#51351, row_count#51358L, unique_customers#51359L, event_sum#51360L, weighted_amount_sum#51361, avg_amount#51362]
Arguments: [segment#51349 ASC NULLS FIRST, processing_day#51351 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#51349, processing_day#51351, row_count#51358L, unique_customers#51359L, event_sum#51360L, weighted_amount_sum#51361, avg_amount#51362]
Arguments: isFinalPlan=true