== 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#1L]
Arguments: Range (0, 1000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#1L % 250000) AS customer_id#3L, concat(segment-, cast(cast((id#1L % 12) as int) as string)) AS segment#7, cast((id#1L % 14) as int) AS processing_day#9, ((cast(((id#1L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#11, cast((((id#1L * 29) % 7) + 1) as int) AS events#13]
Input [1]: [id#1L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#3L, segment#7, processing_day#9, amount#11, events#13, (amount#11 * cast(events#13 as double)) AS weighted_amount#15]
Input [5]: [customer_id#3L, segment#7, processing_day#9, amount#11, events#13]
(4) HashAggregate
Input [6]: [customer_id#3L, segment#7, processing_day#9, amount#11, events#13, weighted_amount#15]
Keys [2]: [segment#7, processing_day#9]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#3L, 0.05, 0, 0), partial_sum(events#13), partial_sum(weighted_amount#15), partial_avg(amount#11)]
Aggregate Attributes [57]: [count#234L, MS[0]#22L, MS[1]#23L, MS[2]#24L, MS[3]#25L, MS[4]#26L, MS[5]#27L, MS[6]#28L, MS[7]#29L, MS[8]#30L, MS[9]#31L, MS[10]#32L, MS[11]#33L, MS[12]#34L, MS[13]#35L, MS[14]#36L, MS[15]#37L, MS[16]#38L, MS[17]#39L, MS[18]#40L, MS[19]#41L, MS[20]#42L, MS[21]#43L, MS[22]#44L, MS[23]#45L, MS[24]#46L, MS[25]#47L, MS[26]#48L, MS[27]#49L, MS[28]#50L, MS[29]#51L, MS[30]#52L, MS[31]#53L, MS[32]#54L, MS[33]#55L, MS[34]#56L, MS[35]#57L, MS[36]#58L, MS[37]#59L, MS[38]#60L, MS[39]#61L, MS[40]#62L, MS[41]#63L, MS[42]#64L, MS[43]#65L, MS[44]#66L, MS[45]#67L, MS[46]#68L, MS[47]#69L, MS[48]#70L, MS[49]#71L, MS[50]#72L, MS[51]#73L, sum#235L, sum#236, sum#237, count#238L]
Results [59]: [segment#7, processing_day#9, count#239L, MS[0]#74L, MS[1]#75L, MS[2]#76L, MS[3]#77L, MS[4]#78L, MS[5]#79L, MS[6]#80L, MS[7]#81L, MS[8]#82L, MS[9]#83L, MS[10]#84L, MS[11]#85L, MS[12]#86L, MS[13]#87L, MS[14]#88L, MS[15]#89L, MS[16]#90L, MS[17]#91L, MS[18]#92L, MS[19]#93L, MS[20]#94L, MS[21]#95L, MS[22]#96L, MS[23]#97L, MS[24]#98L, MS[25]#99L, MS[26]#100L, MS[27]#101L, MS[28]#102L, MS[29]#103L, MS[30]#104L, MS[31]#105L, MS[32]#106L, MS[33]#107L, MS[34]#108L, MS[35]#109L, MS[36]#110L, MS[37]#111L, MS[38]#112L, MS[39]#113L, MS[40]#114L, MS[41]#115L, MS[42]#116L, MS[43]#117L, MS[44]#118L, MS[45]#119L, MS[46]#120L, MS[47]#121L, MS[48]#122L, MS[49]#123L, MS[50]#124L, MS[51]#125L, sum#240L, sum#241, sum#242, count#243L]
(5) Exchange
Input [59]: [segment#7, processing_day#9, count#239L, MS[0]#74L, MS[1]#75L, MS[2]#76L, MS[3]#77L, MS[4]#78L, MS[5]#79L, MS[6]#80L, MS[7]#81L, MS[8]#82L, MS[9]#83L, MS[10]#84L, MS[11]#85L, MS[12]#86L, MS[13]#87L, MS[14]#88L, MS[15]#89L, MS[16]#90L, MS[17]#91L, MS[18]#92L, MS[19]#93L, MS[20]#94L, MS[21]#95L, MS[22]#96L, MS[23]#97L, MS[24]#98L, MS[25]#99L, MS[26]#100L, MS[27]#101L, MS[28]#102L, MS[29]#103L, MS[30]#104L, MS[31]#105L, MS[32]#106L, MS[33]#107L, MS[34]#108L, MS[35]#109L, MS[36]#110L, MS[37]#111L, MS[38]#112L, MS[39]#113L, MS[40]#114L, MS[41]#115L, MS[42]#116L, MS[43]#117L, MS[44]#118L, MS[45]#119L, MS[46]#120L, MS[47]#121L, MS[48]#122L, MS[49]#123L, MS[50]#124L, MS[51]#125L, sum#240L, sum#241, sum#242, count#243L]
Arguments: hashpartitioning(segment#7, processing_day#9, 200), ENSURE_REQUIREMENTS, [plan_id=43]
(6) ShuffleQueryStage
Output [59]: [segment#7, processing_day#9, count#239L, MS[0]#74L, MS[1]#75L, MS[2]#76L, MS[3]#77L, MS[4]#78L, MS[5]#79L, MS[6]#80L, MS[7]#81L, MS[8]#82L, MS[9]#83L, MS[10]#84L, MS[11]#85L, MS[12]#86L, MS[13]#87L, MS[14]#88L, MS[15]#89L, MS[16]#90L, MS[17]#91L, MS[18]#92L, MS[19]#93L, MS[20]#94L, MS[21]#95L, MS[22]#96L, MS[23]#97L, MS[24]#98L, MS[25]#99L, MS[26]#100L, MS[27]#101L, MS[28]#102L, MS[29]#103L, MS[30]#104L, MS[31]#105L, MS[32]#106L, MS[33]#107L, MS[34]#108L, MS[35]#109L, MS[36]#110L, MS[37]#111L, MS[38]#112L, MS[39]#113L, MS[40]#114L, MS[41]#115L, MS[42]#116L, MS[43]#117L, MS[44]#118L, MS[45]#119L, MS[46]#120L, MS[47]#121L, MS[48]#122L, MS[49]#123L, MS[50]#124L, MS[51]#125L, sum#240L, sum#241, sum#242, count#243L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#7, processing_day#9, count#239L, MS[0]#74L, MS[1]#75L, MS[2]#76L, MS[3]#77L, MS[4]#78L, MS[5]#79L, MS[6]#80L, MS[7]#81L, MS[8]#82L, MS[9]#83L, MS[10]#84L, MS[11]#85L, MS[12]#86L, MS[13]#87L, MS[14]#88L, MS[15]#89L, MS[16]#90L, MS[17]#91L, MS[18]#92L, MS[19]#93L, MS[20]#94L, MS[21]#95L, MS[22]#96L, MS[23]#97L, MS[24]#98L, MS[25]#99L, MS[26]#100L, MS[27]#101L, MS[28]#102L, MS[29]#103L, MS[30]#104L, MS[31]#105L, MS[32]#106L, MS[33]#107L, MS[34]#108L, MS[35]#109L, MS[36]#110L, MS[37]#111L, MS[38]#112L, MS[39]#113L, MS[40]#114L, MS[41]#115L, MS[42]#116L, MS[43]#117L, MS[44]#118L, MS[45]#119L, MS[46]#120L, MS[47]#121L, MS[48]#122L, MS[49]#123L, MS[50]#124L, MS[51]#125L, sum#240L, sum#241, sum#242, count#243L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#7, processing_day#9, count#239L, MS[0]#74L, MS[1]#75L, MS[2]#76L, MS[3]#77L, MS[4]#78L, MS[5]#79L, MS[6]#80L, MS[7]#81L, MS[8]#82L, MS[9]#83L, MS[10]#84L, MS[11]#85L, MS[12]#86L, MS[13]#87L, MS[14]#88L, MS[15]#89L, MS[16]#90L, MS[17]#91L, MS[18]#92L, MS[19]#93L, MS[20]#94L, MS[21]#95L, MS[22]#96L, MS[23]#97L, MS[24]#98L, MS[25]#99L, MS[26]#100L, MS[27]#101L, MS[28]#102L, MS[29]#103L, MS[30]#104L, MS[31]#105L, MS[32]#106L, MS[33]#107L, MS[34]#108L, MS[35]#109L, MS[36]#110L, MS[37]#111L, MS[38]#112L, MS[39]#113L, MS[40]#114L, MS[41]#115L, MS[42]#116L, MS[43]#117L, MS[44]#118L, MS[45]#119L, MS[46]#120L, MS[47]#121L, MS[48]#122L, MS[49]#123L, MS[50]#124L, MS[51]#125L, sum#240L, sum#241, sum#242, count#243L]
Keys [2]: [segment#7, processing_day#9]
Functions [5]: [count(1), approx_count_distinct(customer_id#3L, 0.05, 0, 0), sum(events#13), sum(weighted_amount#15), avg(amount#11)]
Aggregate Attributes [5]: [count(1)#21L, approx_count_distinct(customer_id#3L, 0.05, 0, 0)#126L, sum(events#13)#127L, sum(weighted_amount#15)#128, avg(amount#11)#129]
Results [7]: [segment#7, processing_day#9, count(1)#21L AS row_count#16L, approx_count_distinct(customer_id#3L, 0.05, 0, 0)#126L AS unique_customers#17L, sum(events#13)#127L AS event_sum#18L, sum(weighted_amount#15)#128 AS weighted_amount_sum#19, avg(amount#11)#129 AS avg_amount#20]
(9) Exchange
Input [7]: [segment#7, processing_day#9, row_count#16L, unique_customers#17L, event_sum#18L, weighted_amount_sum#19, avg_amount#20]
Arguments: rangepartitioning(segment#7 ASC NULLS FIRST, processing_day#9 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=65]
(10) ShuffleQueryStage
Output [7]: [segment#7, processing_day#9, row_count#16L, unique_customers#17L, event_sum#18L, weighted_amount_sum#19, avg_amount#20]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#7, processing_day#9, row_count#16L, unique_customers#17L, event_sum#18L, weighted_amount_sum#19, avg_amount#20]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#7, processing_day#9, row_count#16L, unique_customers#17L, event_sum#18L, weighted_amount_sum#19, avg_amount#20]
Arguments: [segment#7 ASC NULLS FIRST, processing_day#9 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#7, processing_day#9, row_count#16L, unique_customers#17L, event_sum#18L, weighted_amount_sum#19, avg_amount#20]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#3L, segment#7, processing_day#9, amount#11, events#13, weighted_amount#15]
Keys [2]: [segment#7, processing_day#9]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#3L, 0.05, 0, 0), partial_sum(events#13), partial_sum(weighted_amount#15), partial_avg(amount#11)]
Aggregate Attributes [57]: [count#234L, MS[0]#22L, MS[1]#23L, MS[2]#24L, MS[3]#25L, MS[4]#26L, MS[5]#27L, MS[6]#28L, MS[7]#29L, MS[8]#30L, MS[9]#31L, MS[10]#32L, MS[11]#33L, MS[12]#34L, MS[13]#35L, MS[14]#36L, MS[15]#37L, MS[16]#38L, MS[17]#39L, MS[18]#40L, MS[19]#41L, MS[20]#42L, MS[21]#43L, MS[22]#44L, MS[23]#45L, MS[24]#46L, MS[25]#47L, MS[26]#48L, MS[27]#49L, MS[28]#50L, MS[29]#51L, MS[30]#52L, MS[31]#53L, MS[32]#54L, MS[33]#55L, MS[34]#56L, MS[35]#57L, MS[36]#58L, MS[37]#59L, MS[38]#60L, MS[39]#61L, MS[40]#62L, MS[41]#63L, MS[42]#64L, MS[43]#65L, MS[44]#66L, MS[45]#67L, MS[46]#68L, MS[47]#69L, MS[48]#70L, MS[49]#71L, MS[50]#72L, MS[51]#73L, sum#235L, sum#236, sum#237, count#238L]
Results [59]: [segment#7, processing_day#9, count#239L, MS[0]#74L, MS[1]#75L, MS[2]#76L, MS[3]#77L, MS[4]#78L, MS[5]#79L, MS[6]#80L, MS[7]#81L, MS[8]#82L, MS[9]#83L, MS[10]#84L, MS[11]#85L, MS[12]#86L, MS[13]#87L, MS[14]#88L, MS[15]#89L, MS[16]#90L, MS[17]#91L, MS[18]#92L, MS[19]#93L, MS[20]#94L, MS[21]#95L, MS[22]#96L, MS[23]#97L, MS[24]#98L, MS[25]#99L, MS[26]#100L, MS[27]#101L, MS[28]#102L, MS[29]#103L, MS[30]#104L, MS[31]#105L, MS[32]#106L, MS[33]#107L, MS[34]#108L, MS[35]#109L, MS[36]#110L, MS[37]#111L, MS[38]#112L, MS[39]#113L, MS[40]#114L, MS[41]#115L, MS[42]#116L, MS[43]#117L, MS[44]#118L, MS[45]#119L, MS[46]#120L, MS[47]#121L, MS[48]#122L, MS[49]#123L, MS[50]#124L, MS[51]#125L, sum#240L, sum#241, sum#242, count#243L]
(15) Exchange
Input [59]: [segment#7, processing_day#9, count#239L, MS[0]#74L, MS[1]#75L, MS[2]#76L, MS[3]#77L, MS[4]#78L, MS[5]#79L, MS[6]#80L, MS[7]#81L, MS[8]#82L, MS[9]#83L, MS[10]#84L, MS[11]#85L, MS[12]#86L, MS[13]#87L, MS[14]#88L, MS[15]#89L, MS[16]#90L, MS[17]#91L, MS[18]#92L, MS[19]#93L, MS[20]#94L, MS[21]#95L, MS[22]#96L, MS[23]#97L, MS[24]#98L, MS[25]#99L, MS[26]#100L, MS[27]#101L, MS[28]#102L, MS[29]#103L, MS[30]#104L, MS[31]#105L, MS[32]#106L, MS[33]#107L, MS[34]#108L, MS[35]#109L, MS[36]#110L, MS[37]#111L, MS[38]#112L, MS[39]#113L, MS[40]#114L, MS[41]#115L, MS[42]#116L, MS[43]#117L, MS[44]#118L, MS[45]#119L, MS[46]#120L, MS[47]#121L, MS[48]#122L, MS[49]#123L, MS[50]#124L, MS[51]#125L, sum#240L, sum#241, sum#242, count#243L]
Arguments: hashpartitioning(segment#7, processing_day#9, 200), ENSURE_REQUIREMENTS, [plan_id=23]
(16) HashAggregate
Input [59]: [segment#7, processing_day#9, count#239L, MS[0]#74L, MS[1]#75L, MS[2]#76L, MS[3]#77L, MS[4]#78L, MS[5]#79L, MS[6]#80L, MS[7]#81L, MS[8]#82L, MS[9]#83L, MS[10]#84L, MS[11]#85L, MS[12]#86L, MS[13]#87L, MS[14]#88L, MS[15]#89L, MS[16]#90L, MS[17]#91L, MS[18]#92L, MS[19]#93L, MS[20]#94L, MS[21]#95L, MS[22]#96L, MS[23]#97L, MS[24]#98L, MS[25]#99L, MS[26]#100L, MS[27]#101L, MS[28]#102L, MS[29]#103L, MS[30]#104L, MS[31]#105L, MS[32]#106L, MS[33]#107L, MS[34]#108L, MS[35]#109L, MS[36]#110L, MS[37]#111L, MS[38]#112L, MS[39]#113L, MS[40]#114L, MS[41]#115L, MS[42]#116L, MS[43]#117L, MS[44]#118L, MS[45]#119L, MS[46]#120L, MS[47]#121L, MS[48]#122L, MS[49]#123L, MS[50]#124L, MS[51]#125L, sum#240L, sum#241, sum#242, count#243L]
Keys [2]: [segment#7, processing_day#9]
Functions [5]: [count(1), approx_count_distinct(customer_id#3L, 0.05, 0, 0), sum(events#13), sum(weighted_amount#15), avg(amount#11)]
Aggregate Attributes [5]: [count(1)#21L, approx_count_distinct(customer_id#3L, 0.05, 0, 0)#126L, sum(events#13)#127L, sum(weighted_amount#15)#128, avg(amount#11)#129]
Results [7]: [segment#7, processing_day#9, count(1)#21L AS row_count#16L, approx_count_distinct(customer_id#3L, 0.05, 0, 0)#126L AS unique_customers#17L, sum(events#13)#127L AS event_sum#18L, sum(weighted_amount#15)#128 AS weighted_amount_sum#19, avg(amount#11)#129 AS avg_amount#20]
(17) Exchange
Input [7]: [segment#7, processing_day#9, row_count#16L, unique_customers#17L, event_sum#18L, weighted_amount_sum#19, avg_amount#20]
Arguments: rangepartitioning(segment#7 ASC NULLS FIRST, processing_day#9 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=26]
(18) Sort
Input [7]: [segment#7, processing_day#9, row_count#16L, unique_customers#17L, event_sum#18L, weighted_amount_sum#19, avg_amount#20]
Arguments: [segment#7 ASC NULLS FIRST, processing_day#9 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#7, processing_day#9, row_count#16L, unique_customers#17L, event_sum#18L, weighted_amount_sum#19, avg_amount#20]
Arguments: isFinalPlan=true