== 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#23021L]
Arguments: Range (2000000, 3000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#23021L % 250000) AS customer_id#23023L, concat(segment-, cast(cast((id#23021L % 12) as int) as string)) AS segment#23027, cast((id#23021L % 14) as int) AS processing_day#23029, ((cast(((id#23021L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#23031, cast((((id#23021L * 29) % 7) + 1) as int) AS events#23033]
Input [1]: [id#23021L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#23023L, segment#23027, processing_day#23029, amount#23031, events#23033, (amount#23031 * cast(events#23033 as double)) AS weighted_amount#23035]
Input [5]: [customer_id#23023L, segment#23027, processing_day#23029, amount#23031, events#23033]
(4) HashAggregate
Input [6]: [customer_id#23023L, segment#23027, processing_day#23029, amount#23031, events#23033, weighted_amount#23035]
Keys [2]: [segment#23027, processing_day#23029]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#23023L, 0.05, 0, 0), partial_sum(events#23033), partial_sum(weighted_amount#23035), partial_avg(amount#23031)]
Aggregate Attributes [57]: [count#23254L, MS[0]#23042L, MS[1]#23043L, MS[2]#23044L, MS[3]#23045L, MS[4]#23046L, MS[5]#23047L, MS[6]#23048L, MS[7]#23049L, MS[8]#23050L, MS[9]#23051L, MS[10]#23052L, MS[11]#23053L, MS[12]#23054L, MS[13]#23055L, MS[14]#23056L, MS[15]#23057L, MS[16]#23058L, MS[17]#23059L, MS[18]#23060L, MS[19]#23061L, MS[20]#23062L, MS[21]#23063L, MS[22]#23064L, MS[23]#23065L, MS[24]#23066L, MS[25]#23067L, MS[26]#23068L, MS[27]#23069L, MS[28]#23070L, MS[29]#23071L, MS[30]#23072L, MS[31]#23073L, MS[32]#23074L, MS[33]#23075L, MS[34]#23076L, MS[35]#23077L, MS[36]#23078L, MS[37]#23079L, MS[38]#23080L, MS[39]#23081L, MS[40]#23082L, MS[41]#23083L, MS[42]#23084L, MS[43]#23085L, MS[44]#23086L, MS[45]#23087L, MS[46]#23088L, MS[47]#23089L, MS[48]#23090L, MS[49]#23091L, MS[50]#23092L, MS[51]#23093L, sum#23255L, sum#23256, sum#23257, count#23258L]
Results [59]: [segment#23027, processing_day#23029, count#23259L, MS[0]#23094L, MS[1]#23095L, MS[2]#23096L, MS[3]#23097L, MS[4]#23098L, MS[5]#23099L, MS[6]#23100L, MS[7]#23101L, MS[8]#23102L, MS[9]#23103L, MS[10]#23104L, MS[11]#23105L, MS[12]#23106L, MS[13]#23107L, MS[14]#23108L, MS[15]#23109L, MS[16]#23110L, MS[17]#23111L, MS[18]#23112L, MS[19]#23113L, MS[20]#23114L, MS[21]#23115L, MS[22]#23116L, MS[23]#23117L, MS[24]#23118L, MS[25]#23119L, MS[26]#23120L, MS[27]#23121L, MS[28]#23122L, MS[29]#23123L, MS[30]#23124L, MS[31]#23125L, MS[32]#23126L, MS[33]#23127L, MS[34]#23128L, MS[35]#23129L, MS[36]#23130L, MS[37]#23131L, MS[38]#23132L, MS[39]#23133L, MS[40]#23134L, MS[41]#23135L, MS[42]#23136L, MS[43]#23137L, MS[44]#23138L, MS[45]#23139L, MS[46]#23140L, MS[47]#23141L, MS[48]#23142L, MS[49]#23143L, MS[50]#23144L, MS[51]#23145L, sum#23260L, sum#23261, sum#23262, count#23263L]
(5) Exchange
Input [59]: [segment#23027, processing_day#23029, count#23259L, MS[0]#23094L, MS[1]#23095L, MS[2]#23096L, MS[3]#23097L, MS[4]#23098L, MS[5]#23099L, MS[6]#23100L, MS[7]#23101L, MS[8]#23102L, MS[9]#23103L, MS[10]#23104L, MS[11]#23105L, MS[12]#23106L, MS[13]#23107L, MS[14]#23108L, MS[15]#23109L, MS[16]#23110L, MS[17]#23111L, MS[18]#23112L, MS[19]#23113L, MS[20]#23114L, MS[21]#23115L, MS[22]#23116L, MS[23]#23117L, MS[24]#23118L, MS[25]#23119L, MS[26]#23120L, MS[27]#23121L, MS[28]#23122L, MS[29]#23123L, MS[30]#23124L, MS[31]#23125L, MS[32]#23126L, MS[33]#23127L, MS[34]#23128L, MS[35]#23129L, MS[36]#23130L, MS[37]#23131L, MS[38]#23132L, MS[39]#23133L, MS[40]#23134L, MS[41]#23135L, MS[42]#23136L, MS[43]#23137L, MS[44]#23138L, MS[45]#23139L, MS[46]#23140L, MS[47]#23141L, MS[48]#23142L, MS[49]#23143L, MS[50]#23144L, MS[51]#23145L, sum#23260L, sum#23261, sum#23262, count#23263L]
Arguments: hashpartitioning(segment#23027, processing_day#23029, 200), ENSURE_REQUIREMENTS, [plan_id=2207]
(6) ShuffleQueryStage
Output [59]: [segment#23027, processing_day#23029, count#23259L, MS[0]#23094L, MS[1]#23095L, MS[2]#23096L, MS[3]#23097L, MS[4]#23098L, MS[5]#23099L, MS[6]#23100L, MS[7]#23101L, MS[8]#23102L, MS[9]#23103L, MS[10]#23104L, MS[11]#23105L, MS[12]#23106L, MS[13]#23107L, MS[14]#23108L, MS[15]#23109L, MS[16]#23110L, MS[17]#23111L, MS[18]#23112L, MS[19]#23113L, MS[20]#23114L, MS[21]#23115L, MS[22]#23116L, MS[23]#23117L, MS[24]#23118L, MS[25]#23119L, MS[26]#23120L, MS[27]#23121L, MS[28]#23122L, MS[29]#23123L, MS[30]#23124L, MS[31]#23125L, MS[32]#23126L, MS[33]#23127L, MS[34]#23128L, MS[35]#23129L, MS[36]#23130L, MS[37]#23131L, MS[38]#23132L, MS[39]#23133L, MS[40]#23134L, MS[41]#23135L, MS[42]#23136L, MS[43]#23137L, MS[44]#23138L, MS[45]#23139L, MS[46]#23140L, MS[47]#23141L, MS[48]#23142L, MS[49]#23143L, MS[50]#23144L, MS[51]#23145L, sum#23260L, sum#23261, sum#23262, count#23263L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#23027, processing_day#23029, count#23259L, MS[0]#23094L, MS[1]#23095L, MS[2]#23096L, MS[3]#23097L, MS[4]#23098L, MS[5]#23099L, MS[6]#23100L, MS[7]#23101L, MS[8]#23102L, MS[9]#23103L, MS[10]#23104L, MS[11]#23105L, MS[12]#23106L, MS[13]#23107L, MS[14]#23108L, MS[15]#23109L, MS[16]#23110L, MS[17]#23111L, MS[18]#23112L, MS[19]#23113L, MS[20]#23114L, MS[21]#23115L, MS[22]#23116L, MS[23]#23117L, MS[24]#23118L, MS[25]#23119L, MS[26]#23120L, MS[27]#23121L, MS[28]#23122L, MS[29]#23123L, MS[30]#23124L, MS[31]#23125L, MS[32]#23126L, MS[33]#23127L, MS[34]#23128L, MS[35]#23129L, MS[36]#23130L, MS[37]#23131L, MS[38]#23132L, MS[39]#23133L, MS[40]#23134L, MS[41]#23135L, MS[42]#23136L, MS[43]#23137L, MS[44]#23138L, MS[45]#23139L, MS[46]#23140L, MS[47]#23141L, MS[48]#23142L, MS[49]#23143L, MS[50]#23144L, MS[51]#23145L, sum#23260L, sum#23261, sum#23262, count#23263L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#23027, processing_day#23029, count#23259L, MS[0]#23094L, MS[1]#23095L, MS[2]#23096L, MS[3]#23097L, MS[4]#23098L, MS[5]#23099L, MS[6]#23100L, MS[7]#23101L, MS[8]#23102L, MS[9]#23103L, MS[10]#23104L, MS[11]#23105L, MS[12]#23106L, MS[13]#23107L, MS[14]#23108L, MS[15]#23109L, MS[16]#23110L, MS[17]#23111L, MS[18]#23112L, MS[19]#23113L, MS[20]#23114L, MS[21]#23115L, MS[22]#23116L, MS[23]#23117L, MS[24]#23118L, MS[25]#23119L, MS[26]#23120L, MS[27]#23121L, MS[28]#23122L, MS[29]#23123L, MS[30]#23124L, MS[31]#23125L, MS[32]#23126L, MS[33]#23127L, MS[34]#23128L, MS[35]#23129L, MS[36]#23130L, MS[37]#23131L, MS[38]#23132L, MS[39]#23133L, MS[40]#23134L, MS[41]#23135L, MS[42]#23136L, MS[43]#23137L, MS[44]#23138L, MS[45]#23139L, MS[46]#23140L, MS[47]#23141L, MS[48]#23142L, MS[49]#23143L, MS[50]#23144L, MS[51]#23145L, sum#23260L, sum#23261, sum#23262, count#23263L]
Keys [2]: [segment#23027, processing_day#23029]
Functions [5]: [count(1), approx_count_distinct(customer_id#23023L, 0.05, 0, 0), sum(events#23033), sum(weighted_amount#23035), avg(amount#23031)]
Aggregate Attributes [5]: [count(1)#23041L, approx_count_distinct(customer_id#23023L, 0.05, 0, 0)#23146L, sum(events#23033)#23147L, sum(weighted_amount#23035)#23148, avg(amount#23031)#23149]
Results [7]: [segment#23027, processing_day#23029, count(1)#23041L AS row_count#23036L, approx_count_distinct(customer_id#23023L, 0.05, 0, 0)#23146L AS unique_customers#23037L, sum(events#23033)#23147L AS event_sum#23038L, sum(weighted_amount#23035)#23148 AS weighted_amount_sum#23039, avg(amount#23031)#23149 AS avg_amount#23040]
(9) Exchange
Input [7]: [segment#23027, processing_day#23029, row_count#23036L, unique_customers#23037L, event_sum#23038L, weighted_amount_sum#23039, avg_amount#23040]
Arguments: rangepartitioning(segment#23027 ASC NULLS FIRST, processing_day#23029 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2229]
(10) ShuffleQueryStage
Output [7]: [segment#23027, processing_day#23029, row_count#23036L, unique_customers#23037L, event_sum#23038L, weighted_amount_sum#23039, avg_amount#23040]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#23027, processing_day#23029, row_count#23036L, unique_customers#23037L, event_sum#23038L, weighted_amount_sum#23039, avg_amount#23040]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#23027, processing_day#23029, row_count#23036L, unique_customers#23037L, event_sum#23038L, weighted_amount_sum#23039, avg_amount#23040]
Arguments: [segment#23027 ASC NULLS FIRST, processing_day#23029 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#23027, processing_day#23029, row_count#23036L, unique_customers#23037L, event_sum#23038L, weighted_amount_sum#23039, avg_amount#23040]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#23023L, segment#23027, processing_day#23029, amount#23031, events#23033, weighted_amount#23035]
Keys [2]: [segment#23027, processing_day#23029]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#23023L, 0.05, 0, 0), partial_sum(events#23033), partial_sum(weighted_amount#23035), partial_avg(amount#23031)]
Aggregate Attributes [57]: [count#23254L, MS[0]#23042L, MS[1]#23043L, MS[2]#23044L, MS[3]#23045L, MS[4]#23046L, MS[5]#23047L, MS[6]#23048L, MS[7]#23049L, MS[8]#23050L, MS[9]#23051L, MS[10]#23052L, MS[11]#23053L, MS[12]#23054L, MS[13]#23055L, MS[14]#23056L, MS[15]#23057L, MS[16]#23058L, MS[17]#23059L, MS[18]#23060L, MS[19]#23061L, MS[20]#23062L, MS[21]#23063L, MS[22]#23064L, MS[23]#23065L, MS[24]#23066L, MS[25]#23067L, MS[26]#23068L, MS[27]#23069L, MS[28]#23070L, MS[29]#23071L, MS[30]#23072L, MS[31]#23073L, MS[32]#23074L, MS[33]#23075L, MS[34]#23076L, MS[35]#23077L, MS[36]#23078L, MS[37]#23079L, MS[38]#23080L, MS[39]#23081L, MS[40]#23082L, MS[41]#23083L, MS[42]#23084L, MS[43]#23085L, MS[44]#23086L, MS[45]#23087L, MS[46]#23088L, MS[47]#23089L, MS[48]#23090L, MS[49]#23091L, MS[50]#23092L, MS[51]#23093L, sum#23255L, sum#23256, sum#23257, count#23258L]
Results [59]: [segment#23027, processing_day#23029, count#23259L, MS[0]#23094L, MS[1]#23095L, MS[2]#23096L, MS[3]#23097L, MS[4]#23098L, MS[5]#23099L, MS[6]#23100L, MS[7]#23101L, MS[8]#23102L, MS[9]#23103L, MS[10]#23104L, MS[11]#23105L, MS[12]#23106L, MS[13]#23107L, MS[14]#23108L, MS[15]#23109L, MS[16]#23110L, MS[17]#23111L, MS[18]#23112L, MS[19]#23113L, MS[20]#23114L, MS[21]#23115L, MS[22]#23116L, MS[23]#23117L, MS[24]#23118L, MS[25]#23119L, MS[26]#23120L, MS[27]#23121L, MS[28]#23122L, MS[29]#23123L, MS[30]#23124L, MS[31]#23125L, MS[32]#23126L, MS[33]#23127L, MS[34]#23128L, MS[35]#23129L, MS[36]#23130L, MS[37]#23131L, MS[38]#23132L, MS[39]#23133L, MS[40]#23134L, MS[41]#23135L, MS[42]#23136L, MS[43]#23137L, MS[44]#23138L, MS[45]#23139L, MS[46]#23140L, MS[47]#23141L, MS[48]#23142L, MS[49]#23143L, MS[50]#23144L, MS[51]#23145L, sum#23260L, sum#23261, sum#23262, count#23263L]
(15) Exchange
Input [59]: [segment#23027, processing_day#23029, count#23259L, MS[0]#23094L, MS[1]#23095L, MS[2]#23096L, MS[3]#23097L, MS[4]#23098L, MS[5]#23099L, MS[6]#23100L, MS[7]#23101L, MS[8]#23102L, MS[9]#23103L, MS[10]#23104L, MS[11]#23105L, MS[12]#23106L, MS[13]#23107L, MS[14]#23108L, MS[15]#23109L, MS[16]#23110L, MS[17]#23111L, MS[18]#23112L, MS[19]#23113L, MS[20]#23114L, MS[21]#23115L, MS[22]#23116L, MS[23]#23117L, MS[24]#23118L, MS[25]#23119L, MS[26]#23120L, MS[27]#23121L, MS[28]#23122L, MS[29]#23123L, MS[30]#23124L, MS[31]#23125L, MS[32]#23126L, MS[33]#23127L, MS[34]#23128L, MS[35]#23129L, MS[36]#23130L, MS[37]#23131L, MS[38]#23132L, MS[39]#23133L, MS[40]#23134L, MS[41]#23135L, MS[42]#23136L, MS[43]#23137L, MS[44]#23138L, MS[45]#23139L, MS[46]#23140L, MS[47]#23141L, MS[48]#23142L, MS[49]#23143L, MS[50]#23144L, MS[51]#23145L, sum#23260L, sum#23261, sum#23262, count#23263L]
Arguments: hashpartitioning(segment#23027, processing_day#23029, 200), ENSURE_REQUIREMENTS, [plan_id=2187]
(16) HashAggregate
Input [59]: [segment#23027, processing_day#23029, count#23259L, MS[0]#23094L, MS[1]#23095L, MS[2]#23096L, MS[3]#23097L, MS[4]#23098L, MS[5]#23099L, MS[6]#23100L, MS[7]#23101L, MS[8]#23102L, MS[9]#23103L, MS[10]#23104L, MS[11]#23105L, MS[12]#23106L, MS[13]#23107L, MS[14]#23108L, MS[15]#23109L, MS[16]#23110L, MS[17]#23111L, MS[18]#23112L, MS[19]#23113L, MS[20]#23114L, MS[21]#23115L, MS[22]#23116L, MS[23]#23117L, MS[24]#23118L, MS[25]#23119L, MS[26]#23120L, MS[27]#23121L, MS[28]#23122L, MS[29]#23123L, MS[30]#23124L, MS[31]#23125L, MS[32]#23126L, MS[33]#23127L, MS[34]#23128L, MS[35]#23129L, MS[36]#23130L, MS[37]#23131L, MS[38]#23132L, MS[39]#23133L, MS[40]#23134L, MS[41]#23135L, MS[42]#23136L, MS[43]#23137L, MS[44]#23138L, MS[45]#23139L, MS[46]#23140L, MS[47]#23141L, MS[48]#23142L, MS[49]#23143L, MS[50]#23144L, MS[51]#23145L, sum#23260L, sum#23261, sum#23262, count#23263L]
Keys [2]: [segment#23027, processing_day#23029]
Functions [5]: [count(1), approx_count_distinct(customer_id#23023L, 0.05, 0, 0), sum(events#23033), sum(weighted_amount#23035), avg(amount#23031)]
Aggregate Attributes [5]: [count(1)#23041L, approx_count_distinct(customer_id#23023L, 0.05, 0, 0)#23146L, sum(events#23033)#23147L, sum(weighted_amount#23035)#23148, avg(amount#23031)#23149]
Results [7]: [segment#23027, processing_day#23029, count(1)#23041L AS row_count#23036L, approx_count_distinct(customer_id#23023L, 0.05, 0, 0)#23146L AS unique_customers#23037L, sum(events#23033)#23147L AS event_sum#23038L, sum(weighted_amount#23035)#23148 AS weighted_amount_sum#23039, avg(amount#23031)#23149 AS avg_amount#23040]
(17) Exchange
Input [7]: [segment#23027, processing_day#23029, row_count#23036L, unique_customers#23037L, event_sum#23038L, weighted_amount_sum#23039, avg_amount#23040]
Arguments: rangepartitioning(segment#23027 ASC NULLS FIRST, processing_day#23029 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2190]
(18) Sort
Input [7]: [segment#23027, processing_day#23029, row_count#23036L, unique_customers#23037L, event_sum#23038L, weighted_amount_sum#23039, avg_amount#23040]
Arguments: [segment#23027 ASC NULLS FIRST, processing_day#23029 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#23027, processing_day#23029, row_count#23036L, unique_customers#23037L, event_sum#23038L, weighted_amount_sum#23039, avg_amount#23040]
Arguments: isFinalPlan=true