== 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#105335L]
Arguments: Range (23000000, 24000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#105335L % 250000) AS customer_id#105337L, concat(segment-, cast(cast((id#105335L % 12) as int) as string)) AS segment#105341, cast((id#105335L % 14) as int) AS processing_day#105343, ((cast(((id#105335L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#105345, cast((((id#105335L * 29) % 7) + 1) as int) AS events#105347]
Input [1]: [id#105335L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#105337L, segment#105341, processing_day#105343, amount#105345, events#105347, (amount#105345 * cast(events#105347 as double)) AS weighted_amount#105349]
Input [5]: [customer_id#105337L, segment#105341, processing_day#105343, amount#105345, events#105347]
(4) HashAggregate
Input [6]: [customer_id#105337L, segment#105341, processing_day#105343, amount#105345, events#105347, weighted_amount#105349]
Keys [2]: [segment#105341, processing_day#105343]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#105337L, 0.05, 0, 0), partial_sum(events#105347), partial_sum(weighted_amount#105349), partial_avg(amount#105345)]
Aggregate Attributes [57]: [count#105568L, MS[0]#105356L, MS[1]#105357L, MS[2]#105358L, MS[3]#105359L, MS[4]#105360L, MS[5]#105361L, MS[6]#105362L, MS[7]#105363L, MS[8]#105364L, MS[9]#105365L, MS[10]#105366L, MS[11]#105367L, MS[12]#105368L, MS[13]#105369L, MS[14]#105370L, MS[15]#105371L, MS[16]#105372L, MS[17]#105373L, MS[18]#105374L, MS[19]#105375L, MS[20]#105376L, MS[21]#105377L, MS[22]#105378L, MS[23]#105379L, MS[24]#105380L, MS[25]#105381L, MS[26]#105382L, MS[27]#105383L, MS[28]#105384L, MS[29]#105385L, MS[30]#105386L, MS[31]#105387L, MS[32]#105388L, MS[33]#105389L, MS[34]#105390L, MS[35]#105391L, MS[36]#105392L, MS[37]#105393L, MS[38]#105394L, MS[39]#105395L, MS[40]#105396L, MS[41]#105397L, MS[42]#105398L, MS[43]#105399L, MS[44]#105400L, MS[45]#105401L, MS[46]#105402L, MS[47]#105403L, MS[48]#105404L, MS[49]#105405L, MS[50]#105406L, MS[51]#105407L, sum#105569L, sum#105570, sum#105571, count#105572L]
Results [59]: [segment#105341, processing_day#105343, count#105573L, MS[0]#105408L, MS[1]#105409L, MS[2]#105410L, MS[3]#105411L, MS[4]#105412L, MS[5]#105413L, MS[6]#105414L, MS[7]#105415L, MS[8]#105416L, MS[9]#105417L, MS[10]#105418L, MS[11]#105419L, MS[12]#105420L, MS[13]#105421L, MS[14]#105422L, MS[15]#105423L, MS[16]#105424L, MS[17]#105425L, MS[18]#105426L, MS[19]#105427L, MS[20]#105428L, MS[21]#105429L, MS[22]#105430L, MS[23]#105431L, MS[24]#105432L, MS[25]#105433L, MS[26]#105434L, MS[27]#105435L, MS[28]#105436L, MS[29]#105437L, MS[30]#105438L, MS[31]#105439L, MS[32]#105440L, MS[33]#105441L, MS[34]#105442L, MS[35]#105443L, MS[36]#105444L, MS[37]#105445L, MS[38]#105446L, MS[39]#105447L, MS[40]#105448L, MS[41]#105449L, MS[42]#105450L, MS[43]#105451L, MS[44]#105452L, MS[45]#105453L, MS[46]#105454L, MS[47]#105455L, MS[48]#105456L, MS[49]#105457L, MS[50]#105458L, MS[51]#105459L, sum#105574L, sum#105575, sum#105576, count#105577L]
(5) Exchange
Input [59]: [segment#105341, processing_day#105343, count#105573L, MS[0]#105408L, MS[1]#105409L, MS[2]#105410L, MS[3]#105411L, MS[4]#105412L, MS[5]#105413L, MS[6]#105414L, MS[7]#105415L, MS[8]#105416L, MS[9]#105417L, MS[10]#105418L, MS[11]#105419L, MS[12]#105420L, MS[13]#105421L, MS[14]#105422L, MS[15]#105423L, MS[16]#105424L, MS[17]#105425L, MS[18]#105426L, MS[19]#105427L, MS[20]#105428L, MS[21]#105429L, MS[22]#105430L, MS[23]#105431L, MS[24]#105432L, MS[25]#105433L, MS[26]#105434L, MS[27]#105435L, MS[28]#105436L, MS[29]#105437L, MS[30]#105438L, MS[31]#105439L, MS[32]#105440L, MS[33]#105441L, MS[34]#105442L, MS[35]#105443L, MS[36]#105444L, MS[37]#105445L, MS[38]#105446L, MS[39]#105447L, MS[40]#105448L, MS[41]#105449L, MS[42]#105450L, MS[43]#105451L, MS[44]#105452L, MS[45]#105453L, MS[46]#105454L, MS[47]#105455L, MS[48]#105456L, MS[49]#105457L, MS[50]#105458L, MS[51]#105459L, sum#105574L, sum#105575, sum#105576, count#105577L]
Arguments: hashpartitioning(segment#105341, processing_day#105343, 200), ENSURE_REQUIREMENTS, [plan_id=9944]
(6) ShuffleQueryStage
Output [59]: [segment#105341, processing_day#105343, count#105573L, MS[0]#105408L, MS[1]#105409L, MS[2]#105410L, MS[3]#105411L, MS[4]#105412L, MS[5]#105413L, MS[6]#105414L, MS[7]#105415L, MS[8]#105416L, MS[9]#105417L, MS[10]#105418L, MS[11]#105419L, MS[12]#105420L, MS[13]#105421L, MS[14]#105422L, MS[15]#105423L, MS[16]#105424L, MS[17]#105425L, MS[18]#105426L, MS[19]#105427L, MS[20]#105428L, MS[21]#105429L, MS[22]#105430L, MS[23]#105431L, MS[24]#105432L, MS[25]#105433L, MS[26]#105434L, MS[27]#105435L, MS[28]#105436L, MS[29]#105437L, MS[30]#105438L, MS[31]#105439L, MS[32]#105440L, MS[33]#105441L, MS[34]#105442L, MS[35]#105443L, MS[36]#105444L, MS[37]#105445L, MS[38]#105446L, MS[39]#105447L, MS[40]#105448L, MS[41]#105449L, MS[42]#105450L, MS[43]#105451L, MS[44]#105452L, MS[45]#105453L, MS[46]#105454L, MS[47]#105455L, MS[48]#105456L, MS[49]#105457L, MS[50]#105458L, MS[51]#105459L, sum#105574L, sum#105575, sum#105576, count#105577L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#105341, processing_day#105343, count#105573L, MS[0]#105408L, MS[1]#105409L, MS[2]#105410L, MS[3]#105411L, MS[4]#105412L, MS[5]#105413L, MS[6]#105414L, MS[7]#105415L, MS[8]#105416L, MS[9]#105417L, MS[10]#105418L, MS[11]#105419L, MS[12]#105420L, MS[13]#105421L, MS[14]#105422L, MS[15]#105423L, MS[16]#105424L, MS[17]#105425L, MS[18]#105426L, MS[19]#105427L, MS[20]#105428L, MS[21]#105429L, MS[22]#105430L, MS[23]#105431L, MS[24]#105432L, MS[25]#105433L, MS[26]#105434L, MS[27]#105435L, MS[28]#105436L, MS[29]#105437L, MS[30]#105438L, MS[31]#105439L, MS[32]#105440L, MS[33]#105441L, MS[34]#105442L, MS[35]#105443L, MS[36]#105444L, MS[37]#105445L, MS[38]#105446L, MS[39]#105447L, MS[40]#105448L, MS[41]#105449L, MS[42]#105450L, MS[43]#105451L, MS[44]#105452L, MS[45]#105453L, MS[46]#105454L, MS[47]#105455L, MS[48]#105456L, MS[49]#105457L, MS[50]#105458L, MS[51]#105459L, sum#105574L, sum#105575, sum#105576, count#105577L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#105341, processing_day#105343, count#105573L, MS[0]#105408L, MS[1]#105409L, MS[2]#105410L, MS[3]#105411L, MS[4]#105412L, MS[5]#105413L, MS[6]#105414L, MS[7]#105415L, MS[8]#105416L, MS[9]#105417L, MS[10]#105418L, MS[11]#105419L, MS[12]#105420L, MS[13]#105421L, MS[14]#105422L, MS[15]#105423L, MS[16]#105424L, MS[17]#105425L, MS[18]#105426L, MS[19]#105427L, MS[20]#105428L, MS[21]#105429L, MS[22]#105430L, MS[23]#105431L, MS[24]#105432L, MS[25]#105433L, MS[26]#105434L, MS[27]#105435L, MS[28]#105436L, MS[29]#105437L, MS[30]#105438L, MS[31]#105439L, MS[32]#105440L, MS[33]#105441L, MS[34]#105442L, MS[35]#105443L, MS[36]#105444L, MS[37]#105445L, MS[38]#105446L, MS[39]#105447L, MS[40]#105448L, MS[41]#105449L, MS[42]#105450L, MS[43]#105451L, MS[44]#105452L, MS[45]#105453L, MS[46]#105454L, MS[47]#105455L, MS[48]#105456L, MS[49]#105457L, MS[50]#105458L, MS[51]#105459L, sum#105574L, sum#105575, sum#105576, count#105577L]
Keys [2]: [segment#105341, processing_day#105343]
Functions [5]: [count(1), approx_count_distinct(customer_id#105337L, 0.05, 0, 0), sum(events#105347), sum(weighted_amount#105349), avg(amount#105345)]
Aggregate Attributes [5]: [count(1)#105355L, approx_count_distinct(customer_id#105337L, 0.05, 0, 0)#105460L, sum(events#105347)#105461L, sum(weighted_amount#105349)#105462, avg(amount#105345)#105463]
Results [7]: [segment#105341, processing_day#105343, count(1)#105355L AS row_count#105350L, approx_count_distinct(customer_id#105337L, 0.05, 0, 0)#105460L AS unique_customers#105351L, sum(events#105347)#105461L AS event_sum#105352L, sum(weighted_amount#105349)#105462 AS weighted_amount_sum#105353, avg(amount#105345)#105463 AS avg_amount#105354]
(9) Exchange
Input [7]: [segment#105341, processing_day#105343, row_count#105350L, unique_customers#105351L, event_sum#105352L, weighted_amount_sum#105353, avg_amount#105354]
Arguments: rangepartitioning(segment#105341 ASC NULLS FIRST, processing_day#105343 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9966]
(10) ShuffleQueryStage
Output [7]: [segment#105341, processing_day#105343, row_count#105350L, unique_customers#105351L, event_sum#105352L, weighted_amount_sum#105353, avg_amount#105354]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#105341, processing_day#105343, row_count#105350L, unique_customers#105351L, event_sum#105352L, weighted_amount_sum#105353, avg_amount#105354]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#105341, processing_day#105343, row_count#105350L, unique_customers#105351L, event_sum#105352L, weighted_amount_sum#105353, avg_amount#105354]
Arguments: [segment#105341 ASC NULLS FIRST, processing_day#105343 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#105341, processing_day#105343, row_count#105350L, unique_customers#105351L, event_sum#105352L, weighted_amount_sum#105353, avg_amount#105354]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#105337L, segment#105341, processing_day#105343, amount#105345, events#105347, weighted_amount#105349]
Keys [2]: [segment#105341, processing_day#105343]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#105337L, 0.05, 0, 0), partial_sum(events#105347), partial_sum(weighted_amount#105349), partial_avg(amount#105345)]
Aggregate Attributes [57]: [count#105568L, MS[0]#105356L, MS[1]#105357L, MS[2]#105358L, MS[3]#105359L, MS[4]#105360L, MS[5]#105361L, MS[6]#105362L, MS[7]#105363L, MS[8]#105364L, MS[9]#105365L, MS[10]#105366L, MS[11]#105367L, MS[12]#105368L, MS[13]#105369L, MS[14]#105370L, MS[15]#105371L, MS[16]#105372L, MS[17]#105373L, MS[18]#105374L, MS[19]#105375L, MS[20]#105376L, MS[21]#105377L, MS[22]#105378L, MS[23]#105379L, MS[24]#105380L, MS[25]#105381L, MS[26]#105382L, MS[27]#105383L, MS[28]#105384L, MS[29]#105385L, MS[30]#105386L, MS[31]#105387L, MS[32]#105388L, MS[33]#105389L, MS[34]#105390L, MS[35]#105391L, MS[36]#105392L, MS[37]#105393L, MS[38]#105394L, MS[39]#105395L, MS[40]#105396L, MS[41]#105397L, MS[42]#105398L, MS[43]#105399L, MS[44]#105400L, MS[45]#105401L, MS[46]#105402L, MS[47]#105403L, MS[48]#105404L, MS[49]#105405L, MS[50]#105406L, MS[51]#105407L, sum#105569L, sum#105570, sum#105571, count#105572L]
Results [59]: [segment#105341, processing_day#105343, count#105573L, MS[0]#105408L, MS[1]#105409L, MS[2]#105410L, MS[3]#105411L, MS[4]#105412L, MS[5]#105413L, MS[6]#105414L, MS[7]#105415L, MS[8]#105416L, MS[9]#105417L, MS[10]#105418L, MS[11]#105419L, MS[12]#105420L, MS[13]#105421L, MS[14]#105422L, MS[15]#105423L, MS[16]#105424L, MS[17]#105425L, MS[18]#105426L, MS[19]#105427L, MS[20]#105428L, MS[21]#105429L, MS[22]#105430L, MS[23]#105431L, MS[24]#105432L, MS[25]#105433L, MS[26]#105434L, MS[27]#105435L, MS[28]#105436L, MS[29]#105437L, MS[30]#105438L, MS[31]#105439L, MS[32]#105440L, MS[33]#105441L, MS[34]#105442L, MS[35]#105443L, MS[36]#105444L, MS[37]#105445L, MS[38]#105446L, MS[39]#105447L, MS[40]#105448L, MS[41]#105449L, MS[42]#105450L, MS[43]#105451L, MS[44]#105452L, MS[45]#105453L, MS[46]#105454L, MS[47]#105455L, MS[48]#105456L, MS[49]#105457L, MS[50]#105458L, MS[51]#105459L, sum#105574L, sum#105575, sum#105576, count#105577L]
(15) Exchange
Input [59]: [segment#105341, processing_day#105343, count#105573L, MS[0]#105408L, MS[1]#105409L, MS[2]#105410L, MS[3]#105411L, MS[4]#105412L, MS[5]#105413L, MS[6]#105414L, MS[7]#105415L, MS[8]#105416L, MS[9]#105417L, MS[10]#105418L, MS[11]#105419L, MS[12]#105420L, MS[13]#105421L, MS[14]#105422L, MS[15]#105423L, MS[16]#105424L, MS[17]#105425L, MS[18]#105426L, MS[19]#105427L, MS[20]#105428L, MS[21]#105429L, MS[22]#105430L, MS[23]#105431L, MS[24]#105432L, MS[25]#105433L, MS[26]#105434L, MS[27]#105435L, MS[28]#105436L, MS[29]#105437L, MS[30]#105438L, MS[31]#105439L, MS[32]#105440L, MS[33]#105441L, MS[34]#105442L, MS[35]#105443L, MS[36]#105444L, MS[37]#105445L, MS[38]#105446L, MS[39]#105447L, MS[40]#105448L, MS[41]#105449L, MS[42]#105450L, MS[43]#105451L, MS[44]#105452L, MS[45]#105453L, MS[46]#105454L, MS[47]#105455L, MS[48]#105456L, MS[49]#105457L, MS[50]#105458L, MS[51]#105459L, sum#105574L, sum#105575, sum#105576, count#105577L]
Arguments: hashpartitioning(segment#105341, processing_day#105343, 200), ENSURE_REQUIREMENTS, [plan_id=9924]
(16) HashAggregate
Input [59]: [segment#105341, processing_day#105343, count#105573L, MS[0]#105408L, MS[1]#105409L, MS[2]#105410L, MS[3]#105411L, MS[4]#105412L, MS[5]#105413L, MS[6]#105414L, MS[7]#105415L, MS[8]#105416L, MS[9]#105417L, MS[10]#105418L, MS[11]#105419L, MS[12]#105420L, MS[13]#105421L, MS[14]#105422L, MS[15]#105423L, MS[16]#105424L, MS[17]#105425L, MS[18]#105426L, MS[19]#105427L, MS[20]#105428L, MS[21]#105429L, MS[22]#105430L, MS[23]#105431L, MS[24]#105432L, MS[25]#105433L, MS[26]#105434L, MS[27]#105435L, MS[28]#105436L, MS[29]#105437L, MS[30]#105438L, MS[31]#105439L, MS[32]#105440L, MS[33]#105441L, MS[34]#105442L, MS[35]#105443L, MS[36]#105444L, MS[37]#105445L, MS[38]#105446L, MS[39]#105447L, MS[40]#105448L, MS[41]#105449L, MS[42]#105450L, MS[43]#105451L, MS[44]#105452L, MS[45]#105453L, MS[46]#105454L, MS[47]#105455L, MS[48]#105456L, MS[49]#105457L, MS[50]#105458L, MS[51]#105459L, sum#105574L, sum#105575, sum#105576, count#105577L]
Keys [2]: [segment#105341, processing_day#105343]
Functions [5]: [count(1), approx_count_distinct(customer_id#105337L, 0.05, 0, 0), sum(events#105347), sum(weighted_amount#105349), avg(amount#105345)]
Aggregate Attributes [5]: [count(1)#105355L, approx_count_distinct(customer_id#105337L, 0.05, 0, 0)#105460L, sum(events#105347)#105461L, sum(weighted_amount#105349)#105462, avg(amount#105345)#105463]
Results [7]: [segment#105341, processing_day#105343, count(1)#105355L AS row_count#105350L, approx_count_distinct(customer_id#105337L, 0.05, 0, 0)#105460L AS unique_customers#105351L, sum(events#105347)#105461L AS event_sum#105352L, sum(weighted_amount#105349)#105462 AS weighted_amount_sum#105353, avg(amount#105345)#105463 AS avg_amount#105354]
(17) Exchange
Input [7]: [segment#105341, processing_day#105343, row_count#105350L, unique_customers#105351L, event_sum#105352L, weighted_amount_sum#105353, avg_amount#105354]
Arguments: rangepartitioning(segment#105341 ASC NULLS FIRST, processing_day#105343 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9927]
(18) Sort
Input [7]: [segment#105341, processing_day#105343, row_count#105350L, unique_customers#105351L, event_sum#105352L, weighted_amount_sum#105353, avg_amount#105354]
Arguments: [segment#105341 ASC NULLS FIRST, processing_day#105343 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#105341, processing_day#105343, row_count#105350L, unique_customers#105351L, event_sum#105352L, weighted_amount_sum#105353, avg_amount#105354]
Arguments: isFinalPlan=true