== 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#60183L]
Arguments: Range (20000000, 21000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#60183L % 250000) AS customer_id#60185L, concat(segment-, cast(cast((id#60183L % 12) as int) as string)) AS segment#60189, cast((id#60183L % 14) as int) AS processing_day#60191, ((cast(((id#60183L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#60193, cast((((id#60183L * 29) % 7) + 1) as int) AS events#60195]
Input [1]: [id#60183L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#60185L, segment#60189, processing_day#60191, amount#60193, events#60195, (amount#60193 * cast(events#60195 as double)) AS weighted_amount#60197]
Input [5]: [customer_id#60185L, segment#60189, processing_day#60191, amount#60193, events#60195]
(4) HashAggregate
Input [6]: [customer_id#60185L, segment#60189, processing_day#60191, amount#60193, events#60195, weighted_amount#60197]
Keys [2]: [segment#60189, processing_day#60191]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#60185L, 0.05, 0, 0), partial_sum(events#60195), partial_sum(weighted_amount#60197), partial_avg(amount#60193)]
Aggregate Attributes [57]: [count#60416L, MS[0]#60204L, MS[1]#60205L, MS[2]#60206L, MS[3]#60207L, MS[4]#60208L, MS[5]#60209L, MS[6]#60210L, MS[7]#60211L, MS[8]#60212L, MS[9]#60213L, MS[10]#60214L, MS[11]#60215L, MS[12]#60216L, MS[13]#60217L, MS[14]#60218L, MS[15]#60219L, MS[16]#60220L, MS[17]#60221L, MS[18]#60222L, MS[19]#60223L, MS[20]#60224L, MS[21]#60225L, MS[22]#60226L, MS[23]#60227L, MS[24]#60228L, MS[25]#60229L, MS[26]#60230L, MS[27]#60231L, MS[28]#60232L, MS[29]#60233L, MS[30]#60234L, MS[31]#60235L, MS[32]#60236L, MS[33]#60237L, MS[34]#60238L, MS[35]#60239L, MS[36]#60240L, MS[37]#60241L, MS[38]#60242L, MS[39]#60243L, MS[40]#60244L, MS[41]#60245L, MS[42]#60246L, MS[43]#60247L, MS[44]#60248L, MS[45]#60249L, MS[46]#60250L, MS[47]#60251L, MS[48]#60252L, MS[49]#60253L, MS[50]#60254L, MS[51]#60255L, sum#60417L, sum#60418, sum#60419, count#60420L]
Results [59]: [segment#60189, processing_day#60191, count#60421L, MS[0]#60256L, MS[1]#60257L, MS[2]#60258L, MS[3]#60259L, MS[4]#60260L, MS[5]#60261L, MS[6]#60262L, MS[7]#60263L, MS[8]#60264L, MS[9]#60265L, MS[10]#60266L, MS[11]#60267L, MS[12]#60268L, MS[13]#60269L, MS[14]#60270L, MS[15]#60271L, MS[16]#60272L, MS[17]#60273L, MS[18]#60274L, MS[19]#60275L, MS[20]#60276L, MS[21]#60277L, MS[22]#60278L, MS[23]#60279L, MS[24]#60280L, MS[25]#60281L, MS[26]#60282L, MS[27]#60283L, MS[28]#60284L, MS[29]#60285L, MS[30]#60286L, MS[31]#60287L, MS[32]#60288L, MS[33]#60289L, MS[34]#60290L, MS[35]#60291L, MS[36]#60292L, MS[37]#60293L, MS[38]#60294L, MS[39]#60295L, MS[40]#60296L, MS[41]#60297L, MS[42]#60298L, MS[43]#60299L, MS[44]#60300L, MS[45]#60301L, MS[46]#60302L, MS[47]#60303L, MS[48]#60304L, MS[49]#60305L, MS[50]#60306L, MS[51]#60307L, sum#60422L, sum#60423, sum#60424, count#60425L]
(5) Exchange
Input [59]: [segment#60189, processing_day#60191, count#60421L, MS[0]#60256L, MS[1]#60257L, MS[2]#60258L, MS[3]#60259L, MS[4]#60260L, MS[5]#60261L, MS[6]#60262L, MS[7]#60263L, MS[8]#60264L, MS[9]#60265L, MS[10]#60266L, MS[11]#60267L, MS[12]#60268L, MS[13]#60269L, MS[14]#60270L, MS[15]#60271L, MS[16]#60272L, MS[17]#60273L, MS[18]#60274L, MS[19]#60275L, MS[20]#60276L, MS[21]#60277L, MS[22]#60278L, MS[23]#60279L, MS[24]#60280L, MS[25]#60281L, MS[26]#60282L, MS[27]#60283L, MS[28]#60284L, MS[29]#60285L, MS[30]#60286L, MS[31]#60287L, MS[32]#60288L, MS[33]#60289L, MS[34]#60290L, MS[35]#60291L, MS[36]#60292L, MS[37]#60293L, MS[38]#60294L, MS[39]#60295L, MS[40]#60296L, MS[41]#60297L, MS[42]#60298L, MS[43]#60299L, MS[44]#60300L, MS[45]#60301L, MS[46]#60302L, MS[47]#60303L, MS[48]#60304L, MS[49]#60305L, MS[50]#60306L, MS[51]#60307L, sum#60422L, sum#60423, sum#60424, count#60425L]
Arguments: hashpartitioning(segment#60189, processing_day#60191, 200), ENSURE_REQUIREMENTS, [plan_id=5699]
(6) ShuffleQueryStage
Output [59]: [segment#60189, processing_day#60191, count#60421L, MS[0]#60256L, MS[1]#60257L, MS[2]#60258L, MS[3]#60259L, MS[4]#60260L, MS[5]#60261L, MS[6]#60262L, MS[7]#60263L, MS[8]#60264L, MS[9]#60265L, MS[10]#60266L, MS[11]#60267L, MS[12]#60268L, MS[13]#60269L, MS[14]#60270L, MS[15]#60271L, MS[16]#60272L, MS[17]#60273L, MS[18]#60274L, MS[19]#60275L, MS[20]#60276L, MS[21]#60277L, MS[22]#60278L, MS[23]#60279L, MS[24]#60280L, MS[25]#60281L, MS[26]#60282L, MS[27]#60283L, MS[28]#60284L, MS[29]#60285L, MS[30]#60286L, MS[31]#60287L, MS[32]#60288L, MS[33]#60289L, MS[34]#60290L, MS[35]#60291L, MS[36]#60292L, MS[37]#60293L, MS[38]#60294L, MS[39]#60295L, MS[40]#60296L, MS[41]#60297L, MS[42]#60298L, MS[43]#60299L, MS[44]#60300L, MS[45]#60301L, MS[46]#60302L, MS[47]#60303L, MS[48]#60304L, MS[49]#60305L, MS[50]#60306L, MS[51]#60307L, sum#60422L, sum#60423, sum#60424, count#60425L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#60189, processing_day#60191, count#60421L, MS[0]#60256L, MS[1]#60257L, MS[2]#60258L, MS[3]#60259L, MS[4]#60260L, MS[5]#60261L, MS[6]#60262L, MS[7]#60263L, MS[8]#60264L, MS[9]#60265L, MS[10]#60266L, MS[11]#60267L, MS[12]#60268L, MS[13]#60269L, MS[14]#60270L, MS[15]#60271L, MS[16]#60272L, MS[17]#60273L, MS[18]#60274L, MS[19]#60275L, MS[20]#60276L, MS[21]#60277L, MS[22]#60278L, MS[23]#60279L, MS[24]#60280L, MS[25]#60281L, MS[26]#60282L, MS[27]#60283L, MS[28]#60284L, MS[29]#60285L, MS[30]#60286L, MS[31]#60287L, MS[32]#60288L, MS[33]#60289L, MS[34]#60290L, MS[35]#60291L, MS[36]#60292L, MS[37]#60293L, MS[38]#60294L, MS[39]#60295L, MS[40]#60296L, MS[41]#60297L, MS[42]#60298L, MS[43]#60299L, MS[44]#60300L, MS[45]#60301L, MS[46]#60302L, MS[47]#60303L, MS[48]#60304L, MS[49]#60305L, MS[50]#60306L, MS[51]#60307L, sum#60422L, sum#60423, sum#60424, count#60425L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#60189, processing_day#60191, count#60421L, MS[0]#60256L, MS[1]#60257L, MS[2]#60258L, MS[3]#60259L, MS[4]#60260L, MS[5]#60261L, MS[6]#60262L, MS[7]#60263L, MS[8]#60264L, MS[9]#60265L, MS[10]#60266L, MS[11]#60267L, MS[12]#60268L, MS[13]#60269L, MS[14]#60270L, MS[15]#60271L, MS[16]#60272L, MS[17]#60273L, MS[18]#60274L, MS[19]#60275L, MS[20]#60276L, MS[21]#60277L, MS[22]#60278L, MS[23]#60279L, MS[24]#60280L, MS[25]#60281L, MS[26]#60282L, MS[27]#60283L, MS[28]#60284L, MS[29]#60285L, MS[30]#60286L, MS[31]#60287L, MS[32]#60288L, MS[33]#60289L, MS[34]#60290L, MS[35]#60291L, MS[36]#60292L, MS[37]#60293L, MS[38]#60294L, MS[39]#60295L, MS[40]#60296L, MS[41]#60297L, MS[42]#60298L, MS[43]#60299L, MS[44]#60300L, MS[45]#60301L, MS[46]#60302L, MS[47]#60303L, MS[48]#60304L, MS[49]#60305L, MS[50]#60306L, MS[51]#60307L, sum#60422L, sum#60423, sum#60424, count#60425L]
Keys [2]: [segment#60189, processing_day#60191]
Functions [5]: [count(1), approx_count_distinct(customer_id#60185L, 0.05, 0, 0), sum(events#60195), sum(weighted_amount#60197), avg(amount#60193)]
Aggregate Attributes [5]: [count(1)#60203L, approx_count_distinct(customer_id#60185L, 0.05, 0, 0)#60308L, sum(events#60195)#60309L, sum(weighted_amount#60197)#60310, avg(amount#60193)#60311]
Results [7]: [segment#60189, processing_day#60191, count(1)#60203L AS row_count#60198L, approx_count_distinct(customer_id#60185L, 0.05, 0, 0)#60308L AS unique_customers#60199L, sum(events#60195)#60309L AS event_sum#60200L, sum(weighted_amount#60197)#60310 AS weighted_amount_sum#60201, avg(amount#60193)#60311 AS avg_amount#60202]
(9) Exchange
Input [7]: [segment#60189, processing_day#60191, row_count#60198L, unique_customers#60199L, event_sum#60200L, weighted_amount_sum#60201, avg_amount#60202]
Arguments: rangepartitioning(segment#60189 ASC NULLS FIRST, processing_day#60191 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5721]
(10) ShuffleQueryStage
Output [7]: [segment#60189, processing_day#60191, row_count#60198L, unique_customers#60199L, event_sum#60200L, weighted_amount_sum#60201, avg_amount#60202]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#60189, processing_day#60191, row_count#60198L, unique_customers#60199L, event_sum#60200L, weighted_amount_sum#60201, avg_amount#60202]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#60189, processing_day#60191, row_count#60198L, unique_customers#60199L, event_sum#60200L, weighted_amount_sum#60201, avg_amount#60202]
Arguments: [segment#60189 ASC NULLS FIRST, processing_day#60191 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#60189, processing_day#60191, row_count#60198L, unique_customers#60199L, event_sum#60200L, weighted_amount_sum#60201, avg_amount#60202]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#60185L, segment#60189, processing_day#60191, amount#60193, events#60195, weighted_amount#60197]
Keys [2]: [segment#60189, processing_day#60191]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#60185L, 0.05, 0, 0), partial_sum(events#60195), partial_sum(weighted_amount#60197), partial_avg(amount#60193)]
Aggregate Attributes [57]: [count#60416L, MS[0]#60204L, MS[1]#60205L, MS[2]#60206L, MS[3]#60207L, MS[4]#60208L, MS[5]#60209L, MS[6]#60210L, MS[7]#60211L, MS[8]#60212L, MS[9]#60213L, MS[10]#60214L, MS[11]#60215L, MS[12]#60216L, MS[13]#60217L, MS[14]#60218L, MS[15]#60219L, MS[16]#60220L, MS[17]#60221L, MS[18]#60222L, MS[19]#60223L, MS[20]#60224L, MS[21]#60225L, MS[22]#60226L, MS[23]#60227L, MS[24]#60228L, MS[25]#60229L, MS[26]#60230L, MS[27]#60231L, MS[28]#60232L, MS[29]#60233L, MS[30]#60234L, MS[31]#60235L, MS[32]#60236L, MS[33]#60237L, MS[34]#60238L, MS[35]#60239L, MS[36]#60240L, MS[37]#60241L, MS[38]#60242L, MS[39]#60243L, MS[40]#60244L, MS[41]#60245L, MS[42]#60246L, MS[43]#60247L, MS[44]#60248L, MS[45]#60249L, MS[46]#60250L, MS[47]#60251L, MS[48]#60252L, MS[49]#60253L, MS[50]#60254L, MS[51]#60255L, sum#60417L, sum#60418, sum#60419, count#60420L]
Results [59]: [segment#60189, processing_day#60191, count#60421L, MS[0]#60256L, MS[1]#60257L, MS[2]#60258L, MS[3]#60259L, MS[4]#60260L, MS[5]#60261L, MS[6]#60262L, MS[7]#60263L, MS[8]#60264L, MS[9]#60265L, MS[10]#60266L, MS[11]#60267L, MS[12]#60268L, MS[13]#60269L, MS[14]#60270L, MS[15]#60271L, MS[16]#60272L, MS[17]#60273L, MS[18]#60274L, MS[19]#60275L, MS[20]#60276L, MS[21]#60277L, MS[22]#60278L, MS[23]#60279L, MS[24]#60280L, MS[25]#60281L, MS[26]#60282L, MS[27]#60283L, MS[28]#60284L, MS[29]#60285L, MS[30]#60286L, MS[31]#60287L, MS[32]#60288L, MS[33]#60289L, MS[34]#60290L, MS[35]#60291L, MS[36]#60292L, MS[37]#60293L, MS[38]#60294L, MS[39]#60295L, MS[40]#60296L, MS[41]#60297L, MS[42]#60298L, MS[43]#60299L, MS[44]#60300L, MS[45]#60301L, MS[46]#60302L, MS[47]#60303L, MS[48]#60304L, MS[49]#60305L, MS[50]#60306L, MS[51]#60307L, sum#60422L, sum#60423, sum#60424, count#60425L]
(15) Exchange
Input [59]: [segment#60189, processing_day#60191, count#60421L, MS[0]#60256L, MS[1]#60257L, MS[2]#60258L, MS[3]#60259L, MS[4]#60260L, MS[5]#60261L, MS[6]#60262L, MS[7]#60263L, MS[8]#60264L, MS[9]#60265L, MS[10]#60266L, MS[11]#60267L, MS[12]#60268L, MS[13]#60269L, MS[14]#60270L, MS[15]#60271L, MS[16]#60272L, MS[17]#60273L, MS[18]#60274L, MS[19]#60275L, MS[20]#60276L, MS[21]#60277L, MS[22]#60278L, MS[23]#60279L, MS[24]#60280L, MS[25]#60281L, MS[26]#60282L, MS[27]#60283L, MS[28]#60284L, MS[29]#60285L, MS[30]#60286L, MS[31]#60287L, MS[32]#60288L, MS[33]#60289L, MS[34]#60290L, MS[35]#60291L, MS[36]#60292L, MS[37]#60293L, MS[38]#60294L, MS[39]#60295L, MS[40]#60296L, MS[41]#60297L, MS[42]#60298L, MS[43]#60299L, MS[44]#60300L, MS[45]#60301L, MS[46]#60302L, MS[47]#60303L, MS[48]#60304L, MS[49]#60305L, MS[50]#60306L, MS[51]#60307L, sum#60422L, sum#60423, sum#60424, count#60425L]
Arguments: hashpartitioning(segment#60189, processing_day#60191, 200), ENSURE_REQUIREMENTS, [plan_id=5679]
(16) HashAggregate
Input [59]: [segment#60189, processing_day#60191, count#60421L, MS[0]#60256L, MS[1]#60257L, MS[2]#60258L, MS[3]#60259L, MS[4]#60260L, MS[5]#60261L, MS[6]#60262L, MS[7]#60263L, MS[8]#60264L, MS[9]#60265L, MS[10]#60266L, MS[11]#60267L, MS[12]#60268L, MS[13]#60269L, MS[14]#60270L, MS[15]#60271L, MS[16]#60272L, MS[17]#60273L, MS[18]#60274L, MS[19]#60275L, MS[20]#60276L, MS[21]#60277L, MS[22]#60278L, MS[23]#60279L, MS[24]#60280L, MS[25]#60281L, MS[26]#60282L, MS[27]#60283L, MS[28]#60284L, MS[29]#60285L, MS[30]#60286L, MS[31]#60287L, MS[32]#60288L, MS[33]#60289L, MS[34]#60290L, MS[35]#60291L, MS[36]#60292L, MS[37]#60293L, MS[38]#60294L, MS[39]#60295L, MS[40]#60296L, MS[41]#60297L, MS[42]#60298L, MS[43]#60299L, MS[44]#60300L, MS[45]#60301L, MS[46]#60302L, MS[47]#60303L, MS[48]#60304L, MS[49]#60305L, MS[50]#60306L, MS[51]#60307L, sum#60422L, sum#60423, sum#60424, count#60425L]
Keys [2]: [segment#60189, processing_day#60191]
Functions [5]: [count(1), approx_count_distinct(customer_id#60185L, 0.05, 0, 0), sum(events#60195), sum(weighted_amount#60197), avg(amount#60193)]
Aggregate Attributes [5]: [count(1)#60203L, approx_count_distinct(customer_id#60185L, 0.05, 0, 0)#60308L, sum(events#60195)#60309L, sum(weighted_amount#60197)#60310, avg(amount#60193)#60311]
Results [7]: [segment#60189, processing_day#60191, count(1)#60203L AS row_count#60198L, approx_count_distinct(customer_id#60185L, 0.05, 0, 0)#60308L AS unique_customers#60199L, sum(events#60195)#60309L AS event_sum#60200L, sum(weighted_amount#60197)#60310 AS weighted_amount_sum#60201, avg(amount#60193)#60311 AS avg_amount#60202]
(17) Exchange
Input [7]: [segment#60189, processing_day#60191, row_count#60198L, unique_customers#60199L, event_sum#60200L, weighted_amount_sum#60201, avg_amount#60202]
Arguments: rangepartitioning(segment#60189 ASC NULLS FIRST, processing_day#60191 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=5682]
(18) Sort
Input [7]: [segment#60189, processing_day#60191, row_count#60198L, unique_customers#60199L, event_sum#60200L, weighted_amount_sum#60201, avg_amount#60202]
Arguments: [segment#60189 ASC NULLS FIRST, processing_day#60191 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#60189, processing_day#60191, row_count#60198L, unique_customers#60199L, event_sum#60200L, weighted_amount_sum#60201, avg_amount#60202]
Arguments: isFinalPlan=true