== 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#52227L]
Arguments: Range (11000000, 12000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#52227L % 250000) AS customer_id#52229L, concat(segment-, cast(cast((id#52227L % 12) as int) as string)) AS segment#52233, cast((id#52227L % 14) as int) AS processing_day#52235, ((cast(((id#52227L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#52237, cast((((id#52227L * 29) % 7) + 1) as int) AS events#52239]
Input [1]: [id#52227L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#52229L, segment#52233, processing_day#52235, amount#52237, events#52239, (amount#52237 * cast(events#52239 as double)) AS weighted_amount#52241]
Input [5]: [customer_id#52229L, segment#52233, processing_day#52235, amount#52237, events#52239]
(4) HashAggregate
Input [6]: [customer_id#52229L, segment#52233, processing_day#52235, amount#52237, events#52239, weighted_amount#52241]
Keys [2]: [segment#52233, processing_day#52235]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#52229L, 0.05, 0, 0), partial_sum(events#52239), partial_sum(weighted_amount#52241), partial_avg(amount#52237)]
Aggregate Attributes [57]: [count#52460L, MS[0]#52248L, MS[1]#52249L, MS[2]#52250L, MS[3]#52251L, MS[4]#52252L, MS[5]#52253L, MS[6]#52254L, MS[7]#52255L, MS[8]#52256L, MS[9]#52257L, MS[10]#52258L, MS[11]#52259L, MS[12]#52260L, MS[13]#52261L, MS[14]#52262L, MS[15]#52263L, MS[16]#52264L, MS[17]#52265L, MS[18]#52266L, MS[19]#52267L, MS[20]#52268L, MS[21]#52269L, MS[22]#52270L, MS[23]#52271L, MS[24]#52272L, MS[25]#52273L, MS[26]#52274L, MS[27]#52275L, MS[28]#52276L, MS[29]#52277L, MS[30]#52278L, MS[31]#52279L, MS[32]#52280L, MS[33]#52281L, MS[34]#52282L, MS[35]#52283L, MS[36]#52284L, MS[37]#52285L, MS[38]#52286L, MS[39]#52287L, MS[40]#52288L, MS[41]#52289L, MS[42]#52290L, MS[43]#52291L, MS[44]#52292L, MS[45]#52293L, MS[46]#52294L, MS[47]#52295L, MS[48]#52296L, MS[49]#52297L, MS[50]#52298L, MS[51]#52299L, sum#52461L, sum#52462, sum#52463, count#52464L]
Results [59]: [segment#52233, processing_day#52235, count#52465L, MS[0]#52300L, MS[1]#52301L, MS[2]#52302L, MS[3]#52303L, MS[4]#52304L, MS[5]#52305L, MS[6]#52306L, MS[7]#52307L, MS[8]#52308L, MS[9]#52309L, MS[10]#52310L, MS[11]#52311L, MS[12]#52312L, MS[13]#52313L, MS[14]#52314L, MS[15]#52315L, MS[16]#52316L, MS[17]#52317L, MS[18]#52318L, MS[19]#52319L, MS[20]#52320L, MS[21]#52321L, MS[22]#52322L, MS[23]#52323L, MS[24]#52324L, MS[25]#52325L, MS[26]#52326L, MS[27]#52327L, MS[28]#52328L, MS[29]#52329L, MS[30]#52330L, MS[31]#52331L, MS[32]#52332L, MS[33]#52333L, MS[34]#52334L, MS[35]#52335L, MS[36]#52336L, MS[37]#52337L, MS[38]#52338L, MS[39]#52339L, MS[40]#52340L, MS[41]#52341L, MS[42]#52342L, MS[43]#52343L, MS[44]#52344L, MS[45]#52345L, MS[46]#52346L, MS[47]#52347L, MS[48]#52348L, MS[49]#52349L, MS[50]#52350L, MS[51]#52351L, sum#52466L, sum#52467, sum#52468, count#52469L]
(5) Exchange
Input [59]: [segment#52233, processing_day#52235, count#52465L, MS[0]#52300L, MS[1]#52301L, MS[2]#52302L, MS[3]#52303L, MS[4]#52304L, MS[5]#52305L, MS[6]#52306L, MS[7]#52307L, MS[8]#52308L, MS[9]#52309L, MS[10]#52310L, MS[11]#52311L, MS[12]#52312L, MS[13]#52313L, MS[14]#52314L, MS[15]#52315L, MS[16]#52316L, MS[17]#52317L, MS[18]#52318L, MS[19]#52319L, MS[20]#52320L, MS[21]#52321L, MS[22]#52322L, MS[23]#52323L, MS[24]#52324L, MS[25]#52325L, MS[26]#52326L, MS[27]#52327L, MS[28]#52328L, MS[29]#52329L, MS[30]#52330L, MS[31]#52331L, MS[32]#52332L, MS[33]#52333L, MS[34]#52334L, MS[35]#52335L, MS[36]#52336L, MS[37]#52337L, MS[38]#52338L, MS[39]#52339L, MS[40]#52340L, MS[41]#52341L, MS[42]#52342L, MS[43]#52343L, MS[44]#52344L, MS[45]#52345L, MS[46]#52346L, MS[47]#52347L, MS[48]#52348L, MS[49]#52349L, MS[50]#52350L, MS[51]#52351L, sum#52466L, sum#52467, sum#52468, count#52469L]
Arguments: hashpartitioning(segment#52233, processing_day#52235, 200), ENSURE_REQUIREMENTS, [plan_id=4952]
(6) ShuffleQueryStage
Output [59]: [segment#52233, processing_day#52235, count#52465L, MS[0]#52300L, MS[1]#52301L, MS[2]#52302L, MS[3]#52303L, MS[4]#52304L, MS[5]#52305L, MS[6]#52306L, MS[7]#52307L, MS[8]#52308L, MS[9]#52309L, MS[10]#52310L, MS[11]#52311L, MS[12]#52312L, MS[13]#52313L, MS[14]#52314L, MS[15]#52315L, MS[16]#52316L, MS[17]#52317L, MS[18]#52318L, MS[19]#52319L, MS[20]#52320L, MS[21]#52321L, MS[22]#52322L, MS[23]#52323L, MS[24]#52324L, MS[25]#52325L, MS[26]#52326L, MS[27]#52327L, MS[28]#52328L, MS[29]#52329L, MS[30]#52330L, MS[31]#52331L, MS[32]#52332L, MS[33]#52333L, MS[34]#52334L, MS[35]#52335L, MS[36]#52336L, MS[37]#52337L, MS[38]#52338L, MS[39]#52339L, MS[40]#52340L, MS[41]#52341L, MS[42]#52342L, MS[43]#52343L, MS[44]#52344L, MS[45]#52345L, MS[46]#52346L, MS[47]#52347L, MS[48]#52348L, MS[49]#52349L, MS[50]#52350L, MS[51]#52351L, sum#52466L, sum#52467, sum#52468, count#52469L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#52233, processing_day#52235, count#52465L, MS[0]#52300L, MS[1]#52301L, MS[2]#52302L, MS[3]#52303L, MS[4]#52304L, MS[5]#52305L, MS[6]#52306L, MS[7]#52307L, MS[8]#52308L, MS[9]#52309L, MS[10]#52310L, MS[11]#52311L, MS[12]#52312L, MS[13]#52313L, MS[14]#52314L, MS[15]#52315L, MS[16]#52316L, MS[17]#52317L, MS[18]#52318L, MS[19]#52319L, MS[20]#52320L, MS[21]#52321L, MS[22]#52322L, MS[23]#52323L, MS[24]#52324L, MS[25]#52325L, MS[26]#52326L, MS[27]#52327L, MS[28]#52328L, MS[29]#52329L, MS[30]#52330L, MS[31]#52331L, MS[32]#52332L, MS[33]#52333L, MS[34]#52334L, MS[35]#52335L, MS[36]#52336L, MS[37]#52337L, MS[38]#52338L, MS[39]#52339L, MS[40]#52340L, MS[41]#52341L, MS[42]#52342L, MS[43]#52343L, MS[44]#52344L, MS[45]#52345L, MS[46]#52346L, MS[47]#52347L, MS[48]#52348L, MS[49]#52349L, MS[50]#52350L, MS[51]#52351L, sum#52466L, sum#52467, sum#52468, count#52469L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#52233, processing_day#52235, count#52465L, MS[0]#52300L, MS[1]#52301L, MS[2]#52302L, MS[3]#52303L, MS[4]#52304L, MS[5]#52305L, MS[6]#52306L, MS[7]#52307L, MS[8]#52308L, MS[9]#52309L, MS[10]#52310L, MS[11]#52311L, MS[12]#52312L, MS[13]#52313L, MS[14]#52314L, MS[15]#52315L, MS[16]#52316L, MS[17]#52317L, MS[18]#52318L, MS[19]#52319L, MS[20]#52320L, MS[21]#52321L, MS[22]#52322L, MS[23]#52323L, MS[24]#52324L, MS[25]#52325L, MS[26]#52326L, MS[27]#52327L, MS[28]#52328L, MS[29]#52329L, MS[30]#52330L, MS[31]#52331L, MS[32]#52332L, MS[33]#52333L, MS[34]#52334L, MS[35]#52335L, MS[36]#52336L, MS[37]#52337L, MS[38]#52338L, MS[39]#52339L, MS[40]#52340L, MS[41]#52341L, MS[42]#52342L, MS[43]#52343L, MS[44]#52344L, MS[45]#52345L, MS[46]#52346L, MS[47]#52347L, MS[48]#52348L, MS[49]#52349L, MS[50]#52350L, MS[51]#52351L, sum#52466L, sum#52467, sum#52468, count#52469L]
Keys [2]: [segment#52233, processing_day#52235]
Functions [5]: [count(1), approx_count_distinct(customer_id#52229L, 0.05, 0, 0), sum(events#52239), sum(weighted_amount#52241), avg(amount#52237)]
Aggregate Attributes [5]: [count(1)#52247L, approx_count_distinct(customer_id#52229L, 0.05, 0, 0)#52352L, sum(events#52239)#52353L, sum(weighted_amount#52241)#52354, avg(amount#52237)#52355]
Results [7]: [segment#52233, processing_day#52235, count(1)#52247L AS row_count#52242L, approx_count_distinct(customer_id#52229L, 0.05, 0, 0)#52352L AS unique_customers#52243L, sum(events#52239)#52353L AS event_sum#52244L, sum(weighted_amount#52241)#52354 AS weighted_amount_sum#52245, avg(amount#52237)#52355 AS avg_amount#52246]
(9) Exchange
Input [7]: [segment#52233, processing_day#52235, row_count#52242L, unique_customers#52243L, event_sum#52244L, weighted_amount_sum#52245, avg_amount#52246]
Arguments: rangepartitioning(segment#52233 ASC NULLS FIRST, processing_day#52235 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4974]
(10) ShuffleQueryStage
Output [7]: [segment#52233, processing_day#52235, row_count#52242L, unique_customers#52243L, event_sum#52244L, weighted_amount_sum#52245, avg_amount#52246]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#52233, processing_day#52235, row_count#52242L, unique_customers#52243L, event_sum#52244L, weighted_amount_sum#52245, avg_amount#52246]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#52233, processing_day#52235, row_count#52242L, unique_customers#52243L, event_sum#52244L, weighted_amount_sum#52245, avg_amount#52246]
Arguments: [segment#52233 ASC NULLS FIRST, processing_day#52235 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#52233, processing_day#52235, row_count#52242L, unique_customers#52243L, event_sum#52244L, weighted_amount_sum#52245, avg_amount#52246]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#52229L, segment#52233, processing_day#52235, amount#52237, events#52239, weighted_amount#52241]
Keys [2]: [segment#52233, processing_day#52235]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#52229L, 0.05, 0, 0), partial_sum(events#52239), partial_sum(weighted_amount#52241), partial_avg(amount#52237)]
Aggregate Attributes [57]: [count#52460L, MS[0]#52248L, MS[1]#52249L, MS[2]#52250L, MS[3]#52251L, MS[4]#52252L, MS[5]#52253L, MS[6]#52254L, MS[7]#52255L, MS[8]#52256L, MS[9]#52257L, MS[10]#52258L, MS[11]#52259L, MS[12]#52260L, MS[13]#52261L, MS[14]#52262L, MS[15]#52263L, MS[16]#52264L, MS[17]#52265L, MS[18]#52266L, MS[19]#52267L, MS[20]#52268L, MS[21]#52269L, MS[22]#52270L, MS[23]#52271L, MS[24]#52272L, MS[25]#52273L, MS[26]#52274L, MS[27]#52275L, MS[28]#52276L, MS[29]#52277L, MS[30]#52278L, MS[31]#52279L, MS[32]#52280L, MS[33]#52281L, MS[34]#52282L, MS[35]#52283L, MS[36]#52284L, MS[37]#52285L, MS[38]#52286L, MS[39]#52287L, MS[40]#52288L, MS[41]#52289L, MS[42]#52290L, MS[43]#52291L, MS[44]#52292L, MS[45]#52293L, MS[46]#52294L, MS[47]#52295L, MS[48]#52296L, MS[49]#52297L, MS[50]#52298L, MS[51]#52299L, sum#52461L, sum#52462, sum#52463, count#52464L]
Results [59]: [segment#52233, processing_day#52235, count#52465L, MS[0]#52300L, MS[1]#52301L, MS[2]#52302L, MS[3]#52303L, MS[4]#52304L, MS[5]#52305L, MS[6]#52306L, MS[7]#52307L, MS[8]#52308L, MS[9]#52309L, MS[10]#52310L, MS[11]#52311L, MS[12]#52312L, MS[13]#52313L, MS[14]#52314L, MS[15]#52315L, MS[16]#52316L, MS[17]#52317L, MS[18]#52318L, MS[19]#52319L, MS[20]#52320L, MS[21]#52321L, MS[22]#52322L, MS[23]#52323L, MS[24]#52324L, MS[25]#52325L, MS[26]#52326L, MS[27]#52327L, MS[28]#52328L, MS[29]#52329L, MS[30]#52330L, MS[31]#52331L, MS[32]#52332L, MS[33]#52333L, MS[34]#52334L, MS[35]#52335L, MS[36]#52336L, MS[37]#52337L, MS[38]#52338L, MS[39]#52339L, MS[40]#52340L, MS[41]#52341L, MS[42]#52342L, MS[43]#52343L, MS[44]#52344L, MS[45]#52345L, MS[46]#52346L, MS[47]#52347L, MS[48]#52348L, MS[49]#52349L, MS[50]#52350L, MS[51]#52351L, sum#52466L, sum#52467, sum#52468, count#52469L]
(15) Exchange
Input [59]: [segment#52233, processing_day#52235, count#52465L, MS[0]#52300L, MS[1]#52301L, MS[2]#52302L, MS[3]#52303L, MS[4]#52304L, MS[5]#52305L, MS[6]#52306L, MS[7]#52307L, MS[8]#52308L, MS[9]#52309L, MS[10]#52310L, MS[11]#52311L, MS[12]#52312L, MS[13]#52313L, MS[14]#52314L, MS[15]#52315L, MS[16]#52316L, MS[17]#52317L, MS[18]#52318L, MS[19]#52319L, MS[20]#52320L, MS[21]#52321L, MS[22]#52322L, MS[23]#52323L, MS[24]#52324L, MS[25]#52325L, MS[26]#52326L, MS[27]#52327L, MS[28]#52328L, MS[29]#52329L, MS[30]#52330L, MS[31]#52331L, MS[32]#52332L, MS[33]#52333L, MS[34]#52334L, MS[35]#52335L, MS[36]#52336L, MS[37]#52337L, MS[38]#52338L, MS[39]#52339L, MS[40]#52340L, MS[41]#52341L, MS[42]#52342L, MS[43]#52343L, MS[44]#52344L, MS[45]#52345L, MS[46]#52346L, MS[47]#52347L, MS[48]#52348L, MS[49]#52349L, MS[50]#52350L, MS[51]#52351L, sum#52466L, sum#52467, sum#52468, count#52469L]
Arguments: hashpartitioning(segment#52233, processing_day#52235, 200), ENSURE_REQUIREMENTS, [plan_id=4932]
(16) HashAggregate
Input [59]: [segment#52233, processing_day#52235, count#52465L, MS[0]#52300L, MS[1]#52301L, MS[2]#52302L, MS[3]#52303L, MS[4]#52304L, MS[5]#52305L, MS[6]#52306L, MS[7]#52307L, MS[8]#52308L, MS[9]#52309L, MS[10]#52310L, MS[11]#52311L, MS[12]#52312L, MS[13]#52313L, MS[14]#52314L, MS[15]#52315L, MS[16]#52316L, MS[17]#52317L, MS[18]#52318L, MS[19]#52319L, MS[20]#52320L, MS[21]#52321L, MS[22]#52322L, MS[23]#52323L, MS[24]#52324L, MS[25]#52325L, MS[26]#52326L, MS[27]#52327L, MS[28]#52328L, MS[29]#52329L, MS[30]#52330L, MS[31]#52331L, MS[32]#52332L, MS[33]#52333L, MS[34]#52334L, MS[35]#52335L, MS[36]#52336L, MS[37]#52337L, MS[38]#52338L, MS[39]#52339L, MS[40]#52340L, MS[41]#52341L, MS[42]#52342L, MS[43]#52343L, MS[44]#52344L, MS[45]#52345L, MS[46]#52346L, MS[47]#52347L, MS[48]#52348L, MS[49]#52349L, MS[50]#52350L, MS[51]#52351L, sum#52466L, sum#52467, sum#52468, count#52469L]
Keys [2]: [segment#52233, processing_day#52235]
Functions [5]: [count(1), approx_count_distinct(customer_id#52229L, 0.05, 0, 0), sum(events#52239), sum(weighted_amount#52241), avg(amount#52237)]
Aggregate Attributes [5]: [count(1)#52247L, approx_count_distinct(customer_id#52229L, 0.05, 0, 0)#52352L, sum(events#52239)#52353L, sum(weighted_amount#52241)#52354, avg(amount#52237)#52355]
Results [7]: [segment#52233, processing_day#52235, count(1)#52247L AS row_count#52242L, approx_count_distinct(customer_id#52229L, 0.05, 0, 0)#52352L AS unique_customers#52243L, sum(events#52239)#52353L AS event_sum#52244L, sum(weighted_amount#52241)#52354 AS weighted_amount_sum#52245, avg(amount#52237)#52355 AS avg_amount#52246]
(17) Exchange
Input [7]: [segment#52233, processing_day#52235, row_count#52242L, unique_customers#52243L, event_sum#52244L, weighted_amount_sum#52245, avg_amount#52246]
Arguments: rangepartitioning(segment#52233 ASC NULLS FIRST, processing_day#52235 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4935]
(18) Sort
Input [7]: [segment#52233, processing_day#52235, row_count#52242L, unique_customers#52243L, event_sum#52244L, weighted_amount_sum#52245, avg_amount#52246]
Arguments: [segment#52233 ASC NULLS FIRST, processing_day#52235 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#52233, processing_day#52235, row_count#52242L, unique_customers#52243L, event_sum#52244L, weighted_amount_sum#52245, avg_amount#52246]
Arguments: isFinalPlan=true