== 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#22137L]
Arguments: Range (1000000, 2000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#22137L % 250000) AS customer_id#22139L, concat(segment-, cast(cast((id#22137L % 12) as int) as string)) AS segment#22143, cast((id#22137L % 14) as int) AS processing_day#22145, ((cast(((id#22137L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#22147, cast((((id#22137L * 29) % 7) + 1) as int) AS events#22149]
Input [1]: [id#22137L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#22139L, segment#22143, processing_day#22145, amount#22147, events#22149, (amount#22147 * cast(events#22149 as double)) AS weighted_amount#22151]
Input [5]: [customer_id#22139L, segment#22143, processing_day#22145, amount#22147, events#22149]
(4) HashAggregate
Input [6]: [customer_id#22139L, segment#22143, processing_day#22145, amount#22147, events#22149, weighted_amount#22151]
Keys [2]: [segment#22143, processing_day#22145]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#22139L, 0.05, 0, 0), partial_sum(events#22149), partial_sum(weighted_amount#22151), partial_avg(amount#22147)]
Aggregate Attributes [57]: [count#22370L, MS[0]#22158L, MS[1]#22159L, MS[2]#22160L, MS[3]#22161L, MS[4]#22162L, MS[5]#22163L, MS[6]#22164L, MS[7]#22165L, MS[8]#22166L, MS[9]#22167L, MS[10]#22168L, MS[11]#22169L, MS[12]#22170L, MS[13]#22171L, MS[14]#22172L, MS[15]#22173L, MS[16]#22174L, MS[17]#22175L, MS[18]#22176L, MS[19]#22177L, MS[20]#22178L, MS[21]#22179L, MS[22]#22180L, MS[23]#22181L, MS[24]#22182L, MS[25]#22183L, MS[26]#22184L, MS[27]#22185L, MS[28]#22186L, MS[29]#22187L, MS[30]#22188L, MS[31]#22189L, MS[32]#22190L, MS[33]#22191L, MS[34]#22192L, MS[35]#22193L, MS[36]#22194L, MS[37]#22195L, MS[38]#22196L, MS[39]#22197L, MS[40]#22198L, MS[41]#22199L, MS[42]#22200L, MS[43]#22201L, MS[44]#22202L, MS[45]#22203L, MS[46]#22204L, MS[47]#22205L, MS[48]#22206L, MS[49]#22207L, MS[50]#22208L, MS[51]#22209L, sum#22371L, sum#22372, sum#22373, count#22374L]
Results [59]: [segment#22143, processing_day#22145, count#22375L, MS[0]#22210L, MS[1]#22211L, MS[2]#22212L, MS[3]#22213L, MS[4]#22214L, MS[5]#22215L, MS[6]#22216L, MS[7]#22217L, MS[8]#22218L, MS[9]#22219L, MS[10]#22220L, MS[11]#22221L, MS[12]#22222L, MS[13]#22223L, MS[14]#22224L, MS[15]#22225L, MS[16]#22226L, MS[17]#22227L, MS[18]#22228L, MS[19]#22229L, MS[20]#22230L, MS[21]#22231L, MS[22]#22232L, MS[23]#22233L, MS[24]#22234L, MS[25]#22235L, MS[26]#22236L, MS[27]#22237L, MS[28]#22238L, MS[29]#22239L, MS[30]#22240L, MS[31]#22241L, MS[32]#22242L, MS[33]#22243L, MS[34]#22244L, MS[35]#22245L, MS[36]#22246L, MS[37]#22247L, MS[38]#22248L, MS[39]#22249L, MS[40]#22250L, MS[41]#22251L, MS[42]#22252L, MS[43]#22253L, MS[44]#22254L, MS[45]#22255L, MS[46]#22256L, MS[47]#22257L, MS[48]#22258L, MS[49]#22259L, MS[50]#22260L, MS[51]#22261L, sum#22376L, sum#22377, sum#22378, count#22379L]
(5) Exchange
Input [59]: [segment#22143, processing_day#22145, count#22375L, MS[0]#22210L, MS[1]#22211L, MS[2]#22212L, MS[3]#22213L, MS[4]#22214L, MS[5]#22215L, MS[6]#22216L, MS[7]#22217L, MS[8]#22218L, MS[9]#22219L, MS[10]#22220L, MS[11]#22221L, MS[12]#22222L, MS[13]#22223L, MS[14]#22224L, MS[15]#22225L, MS[16]#22226L, MS[17]#22227L, MS[18]#22228L, MS[19]#22229L, MS[20]#22230L, MS[21]#22231L, MS[22]#22232L, MS[23]#22233L, MS[24]#22234L, MS[25]#22235L, MS[26]#22236L, MS[27]#22237L, MS[28]#22238L, MS[29]#22239L, MS[30]#22240L, MS[31]#22241L, MS[32]#22242L, MS[33]#22243L, MS[34]#22244L, MS[35]#22245L, MS[36]#22246L, MS[37]#22247L, MS[38]#22248L, MS[39]#22249L, MS[40]#22250L, MS[41]#22251L, MS[42]#22252L, MS[43]#22253L, MS[44]#22254L, MS[45]#22255L, MS[46]#22256L, MS[47]#22257L, MS[48]#22258L, MS[49]#22259L, MS[50]#22260L, MS[51]#22261L, sum#22376L, sum#22377, sum#22378, count#22379L]
Arguments: hashpartitioning(segment#22143, processing_day#22145, 200), ENSURE_REQUIREMENTS, [plan_id=2124]
(6) ShuffleQueryStage
Output [59]: [segment#22143, processing_day#22145, count#22375L, MS[0]#22210L, MS[1]#22211L, MS[2]#22212L, MS[3]#22213L, MS[4]#22214L, MS[5]#22215L, MS[6]#22216L, MS[7]#22217L, MS[8]#22218L, MS[9]#22219L, MS[10]#22220L, MS[11]#22221L, MS[12]#22222L, MS[13]#22223L, MS[14]#22224L, MS[15]#22225L, MS[16]#22226L, MS[17]#22227L, MS[18]#22228L, MS[19]#22229L, MS[20]#22230L, MS[21]#22231L, MS[22]#22232L, MS[23]#22233L, MS[24]#22234L, MS[25]#22235L, MS[26]#22236L, MS[27]#22237L, MS[28]#22238L, MS[29]#22239L, MS[30]#22240L, MS[31]#22241L, MS[32]#22242L, MS[33]#22243L, MS[34]#22244L, MS[35]#22245L, MS[36]#22246L, MS[37]#22247L, MS[38]#22248L, MS[39]#22249L, MS[40]#22250L, MS[41]#22251L, MS[42]#22252L, MS[43]#22253L, MS[44]#22254L, MS[45]#22255L, MS[46]#22256L, MS[47]#22257L, MS[48]#22258L, MS[49]#22259L, MS[50]#22260L, MS[51]#22261L, sum#22376L, sum#22377, sum#22378, count#22379L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#22143, processing_day#22145, count#22375L, MS[0]#22210L, MS[1]#22211L, MS[2]#22212L, MS[3]#22213L, MS[4]#22214L, MS[5]#22215L, MS[6]#22216L, MS[7]#22217L, MS[8]#22218L, MS[9]#22219L, MS[10]#22220L, MS[11]#22221L, MS[12]#22222L, MS[13]#22223L, MS[14]#22224L, MS[15]#22225L, MS[16]#22226L, MS[17]#22227L, MS[18]#22228L, MS[19]#22229L, MS[20]#22230L, MS[21]#22231L, MS[22]#22232L, MS[23]#22233L, MS[24]#22234L, MS[25]#22235L, MS[26]#22236L, MS[27]#22237L, MS[28]#22238L, MS[29]#22239L, MS[30]#22240L, MS[31]#22241L, MS[32]#22242L, MS[33]#22243L, MS[34]#22244L, MS[35]#22245L, MS[36]#22246L, MS[37]#22247L, MS[38]#22248L, MS[39]#22249L, MS[40]#22250L, MS[41]#22251L, MS[42]#22252L, MS[43]#22253L, MS[44]#22254L, MS[45]#22255L, MS[46]#22256L, MS[47]#22257L, MS[48]#22258L, MS[49]#22259L, MS[50]#22260L, MS[51]#22261L, sum#22376L, sum#22377, sum#22378, count#22379L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#22143, processing_day#22145, count#22375L, MS[0]#22210L, MS[1]#22211L, MS[2]#22212L, MS[3]#22213L, MS[4]#22214L, MS[5]#22215L, MS[6]#22216L, MS[7]#22217L, MS[8]#22218L, MS[9]#22219L, MS[10]#22220L, MS[11]#22221L, MS[12]#22222L, MS[13]#22223L, MS[14]#22224L, MS[15]#22225L, MS[16]#22226L, MS[17]#22227L, MS[18]#22228L, MS[19]#22229L, MS[20]#22230L, MS[21]#22231L, MS[22]#22232L, MS[23]#22233L, MS[24]#22234L, MS[25]#22235L, MS[26]#22236L, MS[27]#22237L, MS[28]#22238L, MS[29]#22239L, MS[30]#22240L, MS[31]#22241L, MS[32]#22242L, MS[33]#22243L, MS[34]#22244L, MS[35]#22245L, MS[36]#22246L, MS[37]#22247L, MS[38]#22248L, MS[39]#22249L, MS[40]#22250L, MS[41]#22251L, MS[42]#22252L, MS[43]#22253L, MS[44]#22254L, MS[45]#22255L, MS[46]#22256L, MS[47]#22257L, MS[48]#22258L, MS[49]#22259L, MS[50]#22260L, MS[51]#22261L, sum#22376L, sum#22377, sum#22378, count#22379L]
Keys [2]: [segment#22143, processing_day#22145]
Functions [5]: [count(1), approx_count_distinct(customer_id#22139L, 0.05, 0, 0), sum(events#22149), sum(weighted_amount#22151), avg(amount#22147)]
Aggregate Attributes [5]: [count(1)#22157L, approx_count_distinct(customer_id#22139L, 0.05, 0, 0)#22262L, sum(events#22149)#22263L, sum(weighted_amount#22151)#22264, avg(amount#22147)#22265]
Results [7]: [segment#22143, processing_day#22145, count(1)#22157L AS row_count#22152L, approx_count_distinct(customer_id#22139L, 0.05, 0, 0)#22262L AS unique_customers#22153L, sum(events#22149)#22263L AS event_sum#22154L, sum(weighted_amount#22151)#22264 AS weighted_amount_sum#22155, avg(amount#22147)#22265 AS avg_amount#22156]
(9) Exchange
Input [7]: [segment#22143, processing_day#22145, row_count#22152L, unique_customers#22153L, event_sum#22154L, weighted_amount_sum#22155, avg_amount#22156]
Arguments: rangepartitioning(segment#22143 ASC NULLS FIRST, processing_day#22145 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2146]
(10) ShuffleQueryStage
Output [7]: [segment#22143, processing_day#22145, row_count#22152L, unique_customers#22153L, event_sum#22154L, weighted_amount_sum#22155, avg_amount#22156]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#22143, processing_day#22145, row_count#22152L, unique_customers#22153L, event_sum#22154L, weighted_amount_sum#22155, avg_amount#22156]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#22143, processing_day#22145, row_count#22152L, unique_customers#22153L, event_sum#22154L, weighted_amount_sum#22155, avg_amount#22156]
Arguments: [segment#22143 ASC NULLS FIRST, processing_day#22145 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#22143, processing_day#22145, row_count#22152L, unique_customers#22153L, event_sum#22154L, weighted_amount_sum#22155, avg_amount#22156]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#22139L, segment#22143, processing_day#22145, amount#22147, events#22149, weighted_amount#22151]
Keys [2]: [segment#22143, processing_day#22145]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#22139L, 0.05, 0, 0), partial_sum(events#22149), partial_sum(weighted_amount#22151), partial_avg(amount#22147)]
Aggregate Attributes [57]: [count#22370L, MS[0]#22158L, MS[1]#22159L, MS[2]#22160L, MS[3]#22161L, MS[4]#22162L, MS[5]#22163L, MS[6]#22164L, MS[7]#22165L, MS[8]#22166L, MS[9]#22167L, MS[10]#22168L, MS[11]#22169L, MS[12]#22170L, MS[13]#22171L, MS[14]#22172L, MS[15]#22173L, MS[16]#22174L, MS[17]#22175L, MS[18]#22176L, MS[19]#22177L, MS[20]#22178L, MS[21]#22179L, MS[22]#22180L, MS[23]#22181L, MS[24]#22182L, MS[25]#22183L, MS[26]#22184L, MS[27]#22185L, MS[28]#22186L, MS[29]#22187L, MS[30]#22188L, MS[31]#22189L, MS[32]#22190L, MS[33]#22191L, MS[34]#22192L, MS[35]#22193L, MS[36]#22194L, MS[37]#22195L, MS[38]#22196L, MS[39]#22197L, MS[40]#22198L, MS[41]#22199L, MS[42]#22200L, MS[43]#22201L, MS[44]#22202L, MS[45]#22203L, MS[46]#22204L, MS[47]#22205L, MS[48]#22206L, MS[49]#22207L, MS[50]#22208L, MS[51]#22209L, sum#22371L, sum#22372, sum#22373, count#22374L]
Results [59]: [segment#22143, processing_day#22145, count#22375L, MS[0]#22210L, MS[1]#22211L, MS[2]#22212L, MS[3]#22213L, MS[4]#22214L, MS[5]#22215L, MS[6]#22216L, MS[7]#22217L, MS[8]#22218L, MS[9]#22219L, MS[10]#22220L, MS[11]#22221L, MS[12]#22222L, MS[13]#22223L, MS[14]#22224L, MS[15]#22225L, MS[16]#22226L, MS[17]#22227L, MS[18]#22228L, MS[19]#22229L, MS[20]#22230L, MS[21]#22231L, MS[22]#22232L, MS[23]#22233L, MS[24]#22234L, MS[25]#22235L, MS[26]#22236L, MS[27]#22237L, MS[28]#22238L, MS[29]#22239L, MS[30]#22240L, MS[31]#22241L, MS[32]#22242L, MS[33]#22243L, MS[34]#22244L, MS[35]#22245L, MS[36]#22246L, MS[37]#22247L, MS[38]#22248L, MS[39]#22249L, MS[40]#22250L, MS[41]#22251L, MS[42]#22252L, MS[43]#22253L, MS[44]#22254L, MS[45]#22255L, MS[46]#22256L, MS[47]#22257L, MS[48]#22258L, MS[49]#22259L, MS[50]#22260L, MS[51]#22261L, sum#22376L, sum#22377, sum#22378, count#22379L]
(15) Exchange
Input [59]: [segment#22143, processing_day#22145, count#22375L, MS[0]#22210L, MS[1]#22211L, MS[2]#22212L, MS[3]#22213L, MS[4]#22214L, MS[5]#22215L, MS[6]#22216L, MS[7]#22217L, MS[8]#22218L, MS[9]#22219L, MS[10]#22220L, MS[11]#22221L, MS[12]#22222L, MS[13]#22223L, MS[14]#22224L, MS[15]#22225L, MS[16]#22226L, MS[17]#22227L, MS[18]#22228L, MS[19]#22229L, MS[20]#22230L, MS[21]#22231L, MS[22]#22232L, MS[23]#22233L, MS[24]#22234L, MS[25]#22235L, MS[26]#22236L, MS[27]#22237L, MS[28]#22238L, MS[29]#22239L, MS[30]#22240L, MS[31]#22241L, MS[32]#22242L, MS[33]#22243L, MS[34]#22244L, MS[35]#22245L, MS[36]#22246L, MS[37]#22247L, MS[38]#22248L, MS[39]#22249L, MS[40]#22250L, MS[41]#22251L, MS[42]#22252L, MS[43]#22253L, MS[44]#22254L, MS[45]#22255L, MS[46]#22256L, MS[47]#22257L, MS[48]#22258L, MS[49]#22259L, MS[50]#22260L, MS[51]#22261L, sum#22376L, sum#22377, sum#22378, count#22379L]
Arguments: hashpartitioning(segment#22143, processing_day#22145, 200), ENSURE_REQUIREMENTS, [plan_id=2104]
(16) HashAggregate
Input [59]: [segment#22143, processing_day#22145, count#22375L, MS[0]#22210L, MS[1]#22211L, MS[2]#22212L, MS[3]#22213L, MS[4]#22214L, MS[5]#22215L, MS[6]#22216L, MS[7]#22217L, MS[8]#22218L, MS[9]#22219L, MS[10]#22220L, MS[11]#22221L, MS[12]#22222L, MS[13]#22223L, MS[14]#22224L, MS[15]#22225L, MS[16]#22226L, MS[17]#22227L, MS[18]#22228L, MS[19]#22229L, MS[20]#22230L, MS[21]#22231L, MS[22]#22232L, MS[23]#22233L, MS[24]#22234L, MS[25]#22235L, MS[26]#22236L, MS[27]#22237L, MS[28]#22238L, MS[29]#22239L, MS[30]#22240L, MS[31]#22241L, MS[32]#22242L, MS[33]#22243L, MS[34]#22244L, MS[35]#22245L, MS[36]#22246L, MS[37]#22247L, MS[38]#22248L, MS[39]#22249L, MS[40]#22250L, MS[41]#22251L, MS[42]#22252L, MS[43]#22253L, MS[44]#22254L, MS[45]#22255L, MS[46]#22256L, MS[47]#22257L, MS[48]#22258L, MS[49]#22259L, MS[50]#22260L, MS[51]#22261L, sum#22376L, sum#22377, sum#22378, count#22379L]
Keys [2]: [segment#22143, processing_day#22145]
Functions [5]: [count(1), approx_count_distinct(customer_id#22139L, 0.05, 0, 0), sum(events#22149), sum(weighted_amount#22151), avg(amount#22147)]
Aggregate Attributes [5]: [count(1)#22157L, approx_count_distinct(customer_id#22139L, 0.05, 0, 0)#22262L, sum(events#22149)#22263L, sum(weighted_amount#22151)#22264, avg(amount#22147)#22265]
Results [7]: [segment#22143, processing_day#22145, count(1)#22157L AS row_count#22152L, approx_count_distinct(customer_id#22139L, 0.05, 0, 0)#22262L AS unique_customers#22153L, sum(events#22149)#22263L AS event_sum#22154L, sum(weighted_amount#22151)#22264 AS weighted_amount_sum#22155, avg(amount#22147)#22265 AS avg_amount#22156]
(17) Exchange
Input [7]: [segment#22143, processing_day#22145, row_count#22152L, unique_customers#22153L, event_sum#22154L, weighted_amount_sum#22155, avg_amount#22156]
Arguments: rangepartitioning(segment#22143 ASC NULLS FIRST, processing_day#22145 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2107]
(18) Sort
Input [7]: [segment#22143, processing_day#22145, row_count#22152L, unique_customers#22153L, event_sum#22154L, weighted_amount_sum#22155, avg_amount#22156]
Arguments: [segment#22143 ASC NULLS FIRST, processing_day#22145 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#22143, processing_day#22145, row_count#22152L, unique_customers#22153L, event_sum#22154L, weighted_amount_sum#22155, avg_amount#22156]
Arguments: isFinalPlan=true