== 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#21253L]
Arguments: Range (0, 1000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#21253L % 250000) AS customer_id#21255L, concat(segment-, cast(cast((id#21253L % 12) as int) as string)) AS segment#21259, cast((id#21253L % 14) as int) AS processing_day#21261, ((cast(((id#21253L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#21263, cast((((id#21253L * 29) % 7) + 1) as int) AS events#21265]
Input [1]: [id#21253L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#21255L, segment#21259, processing_day#21261, amount#21263, events#21265, (amount#21263 * cast(events#21265 as double)) AS weighted_amount#21267]
Input [5]: [customer_id#21255L, segment#21259, processing_day#21261, amount#21263, events#21265]
(4) HashAggregate
Input [6]: [customer_id#21255L, segment#21259, processing_day#21261, amount#21263, events#21265, weighted_amount#21267]
Keys [2]: [segment#21259, processing_day#21261]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#21255L, 0.05, 0, 0), partial_sum(events#21265), partial_sum(weighted_amount#21267), partial_avg(amount#21263)]
Aggregate Attributes [57]: [count#21486L, MS[0]#21274L, MS[1]#21275L, MS[2]#21276L, MS[3]#21277L, MS[4]#21278L, MS[5]#21279L, MS[6]#21280L, MS[7]#21281L, MS[8]#21282L, MS[9]#21283L, MS[10]#21284L, MS[11]#21285L, MS[12]#21286L, MS[13]#21287L, MS[14]#21288L, MS[15]#21289L, MS[16]#21290L, MS[17]#21291L, MS[18]#21292L, MS[19]#21293L, MS[20]#21294L, MS[21]#21295L, MS[22]#21296L, MS[23]#21297L, MS[24]#21298L, MS[25]#21299L, MS[26]#21300L, MS[27]#21301L, MS[28]#21302L, MS[29]#21303L, MS[30]#21304L, MS[31]#21305L, MS[32]#21306L, MS[33]#21307L, MS[34]#21308L, MS[35]#21309L, MS[36]#21310L, MS[37]#21311L, MS[38]#21312L, MS[39]#21313L, MS[40]#21314L, MS[41]#21315L, MS[42]#21316L, MS[43]#21317L, MS[44]#21318L, MS[45]#21319L, MS[46]#21320L, MS[47]#21321L, MS[48]#21322L, MS[49]#21323L, MS[50]#21324L, MS[51]#21325L, sum#21487L, sum#21488, sum#21489, count#21490L]
Results [59]: [segment#21259, processing_day#21261, count#21491L, MS[0]#21326L, MS[1]#21327L, MS[2]#21328L, MS[3]#21329L, MS[4]#21330L, MS[5]#21331L, MS[6]#21332L, MS[7]#21333L, MS[8]#21334L, MS[9]#21335L, MS[10]#21336L, MS[11]#21337L, MS[12]#21338L, MS[13]#21339L, MS[14]#21340L, MS[15]#21341L, MS[16]#21342L, MS[17]#21343L, MS[18]#21344L, MS[19]#21345L, MS[20]#21346L, MS[21]#21347L, MS[22]#21348L, MS[23]#21349L, MS[24]#21350L, MS[25]#21351L, MS[26]#21352L, MS[27]#21353L, MS[28]#21354L, MS[29]#21355L, MS[30]#21356L, MS[31]#21357L, MS[32]#21358L, MS[33]#21359L, MS[34]#21360L, MS[35]#21361L, MS[36]#21362L, MS[37]#21363L, MS[38]#21364L, MS[39]#21365L, MS[40]#21366L, MS[41]#21367L, MS[42]#21368L, MS[43]#21369L, MS[44]#21370L, MS[45]#21371L, MS[46]#21372L, MS[47]#21373L, MS[48]#21374L, MS[49]#21375L, MS[50]#21376L, MS[51]#21377L, sum#21492L, sum#21493, sum#21494, count#21495L]
(5) Exchange
Input [59]: [segment#21259, processing_day#21261, count#21491L, MS[0]#21326L, MS[1]#21327L, MS[2]#21328L, MS[3]#21329L, MS[4]#21330L, MS[5]#21331L, MS[6]#21332L, MS[7]#21333L, MS[8]#21334L, MS[9]#21335L, MS[10]#21336L, MS[11]#21337L, MS[12]#21338L, MS[13]#21339L, MS[14]#21340L, MS[15]#21341L, MS[16]#21342L, MS[17]#21343L, MS[18]#21344L, MS[19]#21345L, MS[20]#21346L, MS[21]#21347L, MS[22]#21348L, MS[23]#21349L, MS[24]#21350L, MS[25]#21351L, MS[26]#21352L, MS[27]#21353L, MS[28]#21354L, MS[29]#21355L, MS[30]#21356L, MS[31]#21357L, MS[32]#21358L, MS[33]#21359L, MS[34]#21360L, MS[35]#21361L, MS[36]#21362L, MS[37]#21363L, MS[38]#21364L, MS[39]#21365L, MS[40]#21366L, MS[41]#21367L, MS[42]#21368L, MS[43]#21369L, MS[44]#21370L, MS[45]#21371L, MS[46]#21372L, MS[47]#21373L, MS[48]#21374L, MS[49]#21375L, MS[50]#21376L, MS[51]#21377L, sum#21492L, sum#21493, sum#21494, count#21495L]
Arguments: hashpartitioning(segment#21259, processing_day#21261, 200), ENSURE_REQUIREMENTS, [plan_id=2041]
(6) ShuffleQueryStage
Output [59]: [segment#21259, processing_day#21261, count#21491L, MS[0]#21326L, MS[1]#21327L, MS[2]#21328L, MS[3]#21329L, MS[4]#21330L, MS[5]#21331L, MS[6]#21332L, MS[7]#21333L, MS[8]#21334L, MS[9]#21335L, MS[10]#21336L, MS[11]#21337L, MS[12]#21338L, MS[13]#21339L, MS[14]#21340L, MS[15]#21341L, MS[16]#21342L, MS[17]#21343L, MS[18]#21344L, MS[19]#21345L, MS[20]#21346L, MS[21]#21347L, MS[22]#21348L, MS[23]#21349L, MS[24]#21350L, MS[25]#21351L, MS[26]#21352L, MS[27]#21353L, MS[28]#21354L, MS[29]#21355L, MS[30]#21356L, MS[31]#21357L, MS[32]#21358L, MS[33]#21359L, MS[34]#21360L, MS[35]#21361L, MS[36]#21362L, MS[37]#21363L, MS[38]#21364L, MS[39]#21365L, MS[40]#21366L, MS[41]#21367L, MS[42]#21368L, MS[43]#21369L, MS[44]#21370L, MS[45]#21371L, MS[46]#21372L, MS[47]#21373L, MS[48]#21374L, MS[49]#21375L, MS[50]#21376L, MS[51]#21377L, sum#21492L, sum#21493, sum#21494, count#21495L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#21259, processing_day#21261, count#21491L, MS[0]#21326L, MS[1]#21327L, MS[2]#21328L, MS[3]#21329L, MS[4]#21330L, MS[5]#21331L, MS[6]#21332L, MS[7]#21333L, MS[8]#21334L, MS[9]#21335L, MS[10]#21336L, MS[11]#21337L, MS[12]#21338L, MS[13]#21339L, MS[14]#21340L, MS[15]#21341L, MS[16]#21342L, MS[17]#21343L, MS[18]#21344L, MS[19]#21345L, MS[20]#21346L, MS[21]#21347L, MS[22]#21348L, MS[23]#21349L, MS[24]#21350L, MS[25]#21351L, MS[26]#21352L, MS[27]#21353L, MS[28]#21354L, MS[29]#21355L, MS[30]#21356L, MS[31]#21357L, MS[32]#21358L, MS[33]#21359L, MS[34]#21360L, MS[35]#21361L, MS[36]#21362L, MS[37]#21363L, MS[38]#21364L, MS[39]#21365L, MS[40]#21366L, MS[41]#21367L, MS[42]#21368L, MS[43]#21369L, MS[44]#21370L, MS[45]#21371L, MS[46]#21372L, MS[47]#21373L, MS[48]#21374L, MS[49]#21375L, MS[50]#21376L, MS[51]#21377L, sum#21492L, sum#21493, sum#21494, count#21495L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#21259, processing_day#21261, count#21491L, MS[0]#21326L, MS[1]#21327L, MS[2]#21328L, MS[3]#21329L, MS[4]#21330L, MS[5]#21331L, MS[6]#21332L, MS[7]#21333L, MS[8]#21334L, MS[9]#21335L, MS[10]#21336L, MS[11]#21337L, MS[12]#21338L, MS[13]#21339L, MS[14]#21340L, MS[15]#21341L, MS[16]#21342L, MS[17]#21343L, MS[18]#21344L, MS[19]#21345L, MS[20]#21346L, MS[21]#21347L, MS[22]#21348L, MS[23]#21349L, MS[24]#21350L, MS[25]#21351L, MS[26]#21352L, MS[27]#21353L, MS[28]#21354L, MS[29]#21355L, MS[30]#21356L, MS[31]#21357L, MS[32]#21358L, MS[33]#21359L, MS[34]#21360L, MS[35]#21361L, MS[36]#21362L, MS[37]#21363L, MS[38]#21364L, MS[39]#21365L, MS[40]#21366L, MS[41]#21367L, MS[42]#21368L, MS[43]#21369L, MS[44]#21370L, MS[45]#21371L, MS[46]#21372L, MS[47]#21373L, MS[48]#21374L, MS[49]#21375L, MS[50]#21376L, MS[51]#21377L, sum#21492L, sum#21493, sum#21494, count#21495L]
Keys [2]: [segment#21259, processing_day#21261]
Functions [5]: [count(1), approx_count_distinct(customer_id#21255L, 0.05, 0, 0), sum(events#21265), sum(weighted_amount#21267), avg(amount#21263)]
Aggregate Attributes [5]: [count(1)#21273L, approx_count_distinct(customer_id#21255L, 0.05, 0, 0)#21378L, sum(events#21265)#21379L, sum(weighted_amount#21267)#21380, avg(amount#21263)#21381]
Results [7]: [segment#21259, processing_day#21261, count(1)#21273L AS row_count#21268L, approx_count_distinct(customer_id#21255L, 0.05, 0, 0)#21378L AS unique_customers#21269L, sum(events#21265)#21379L AS event_sum#21270L, sum(weighted_amount#21267)#21380 AS weighted_amount_sum#21271, avg(amount#21263)#21381 AS avg_amount#21272]
(9) Exchange
Input [7]: [segment#21259, processing_day#21261, row_count#21268L, unique_customers#21269L, event_sum#21270L, weighted_amount_sum#21271, avg_amount#21272]
Arguments: rangepartitioning(segment#21259 ASC NULLS FIRST, processing_day#21261 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2063]
(10) ShuffleQueryStage
Output [7]: [segment#21259, processing_day#21261, row_count#21268L, unique_customers#21269L, event_sum#21270L, weighted_amount_sum#21271, avg_amount#21272]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#21259, processing_day#21261, row_count#21268L, unique_customers#21269L, event_sum#21270L, weighted_amount_sum#21271, avg_amount#21272]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#21259, processing_day#21261, row_count#21268L, unique_customers#21269L, event_sum#21270L, weighted_amount_sum#21271, avg_amount#21272]
Arguments: [segment#21259 ASC NULLS FIRST, processing_day#21261 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#21259, processing_day#21261, row_count#21268L, unique_customers#21269L, event_sum#21270L, weighted_amount_sum#21271, avg_amount#21272]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#21255L, segment#21259, processing_day#21261, amount#21263, events#21265, weighted_amount#21267]
Keys [2]: [segment#21259, processing_day#21261]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#21255L, 0.05, 0, 0), partial_sum(events#21265), partial_sum(weighted_amount#21267), partial_avg(amount#21263)]
Aggregate Attributes [57]: [count#21486L, MS[0]#21274L, MS[1]#21275L, MS[2]#21276L, MS[3]#21277L, MS[4]#21278L, MS[5]#21279L, MS[6]#21280L, MS[7]#21281L, MS[8]#21282L, MS[9]#21283L, MS[10]#21284L, MS[11]#21285L, MS[12]#21286L, MS[13]#21287L, MS[14]#21288L, MS[15]#21289L, MS[16]#21290L, MS[17]#21291L, MS[18]#21292L, MS[19]#21293L, MS[20]#21294L, MS[21]#21295L, MS[22]#21296L, MS[23]#21297L, MS[24]#21298L, MS[25]#21299L, MS[26]#21300L, MS[27]#21301L, MS[28]#21302L, MS[29]#21303L, MS[30]#21304L, MS[31]#21305L, MS[32]#21306L, MS[33]#21307L, MS[34]#21308L, MS[35]#21309L, MS[36]#21310L, MS[37]#21311L, MS[38]#21312L, MS[39]#21313L, MS[40]#21314L, MS[41]#21315L, MS[42]#21316L, MS[43]#21317L, MS[44]#21318L, MS[45]#21319L, MS[46]#21320L, MS[47]#21321L, MS[48]#21322L, MS[49]#21323L, MS[50]#21324L, MS[51]#21325L, sum#21487L, sum#21488, sum#21489, count#21490L]
Results [59]: [segment#21259, processing_day#21261, count#21491L, MS[0]#21326L, MS[1]#21327L, MS[2]#21328L, MS[3]#21329L, MS[4]#21330L, MS[5]#21331L, MS[6]#21332L, MS[7]#21333L, MS[8]#21334L, MS[9]#21335L, MS[10]#21336L, MS[11]#21337L, MS[12]#21338L, MS[13]#21339L, MS[14]#21340L, MS[15]#21341L, MS[16]#21342L, MS[17]#21343L, MS[18]#21344L, MS[19]#21345L, MS[20]#21346L, MS[21]#21347L, MS[22]#21348L, MS[23]#21349L, MS[24]#21350L, MS[25]#21351L, MS[26]#21352L, MS[27]#21353L, MS[28]#21354L, MS[29]#21355L, MS[30]#21356L, MS[31]#21357L, MS[32]#21358L, MS[33]#21359L, MS[34]#21360L, MS[35]#21361L, MS[36]#21362L, MS[37]#21363L, MS[38]#21364L, MS[39]#21365L, MS[40]#21366L, MS[41]#21367L, MS[42]#21368L, MS[43]#21369L, MS[44]#21370L, MS[45]#21371L, MS[46]#21372L, MS[47]#21373L, MS[48]#21374L, MS[49]#21375L, MS[50]#21376L, MS[51]#21377L, sum#21492L, sum#21493, sum#21494, count#21495L]
(15) Exchange
Input [59]: [segment#21259, processing_day#21261, count#21491L, MS[0]#21326L, MS[1]#21327L, MS[2]#21328L, MS[3]#21329L, MS[4]#21330L, MS[5]#21331L, MS[6]#21332L, MS[7]#21333L, MS[8]#21334L, MS[9]#21335L, MS[10]#21336L, MS[11]#21337L, MS[12]#21338L, MS[13]#21339L, MS[14]#21340L, MS[15]#21341L, MS[16]#21342L, MS[17]#21343L, MS[18]#21344L, MS[19]#21345L, MS[20]#21346L, MS[21]#21347L, MS[22]#21348L, MS[23]#21349L, MS[24]#21350L, MS[25]#21351L, MS[26]#21352L, MS[27]#21353L, MS[28]#21354L, MS[29]#21355L, MS[30]#21356L, MS[31]#21357L, MS[32]#21358L, MS[33]#21359L, MS[34]#21360L, MS[35]#21361L, MS[36]#21362L, MS[37]#21363L, MS[38]#21364L, MS[39]#21365L, MS[40]#21366L, MS[41]#21367L, MS[42]#21368L, MS[43]#21369L, MS[44]#21370L, MS[45]#21371L, MS[46]#21372L, MS[47]#21373L, MS[48]#21374L, MS[49]#21375L, MS[50]#21376L, MS[51]#21377L, sum#21492L, sum#21493, sum#21494, count#21495L]
Arguments: hashpartitioning(segment#21259, processing_day#21261, 200), ENSURE_REQUIREMENTS, [plan_id=2021]
(16) HashAggregate
Input [59]: [segment#21259, processing_day#21261, count#21491L, MS[0]#21326L, MS[1]#21327L, MS[2]#21328L, MS[3]#21329L, MS[4]#21330L, MS[5]#21331L, MS[6]#21332L, MS[7]#21333L, MS[8]#21334L, MS[9]#21335L, MS[10]#21336L, MS[11]#21337L, MS[12]#21338L, MS[13]#21339L, MS[14]#21340L, MS[15]#21341L, MS[16]#21342L, MS[17]#21343L, MS[18]#21344L, MS[19]#21345L, MS[20]#21346L, MS[21]#21347L, MS[22]#21348L, MS[23]#21349L, MS[24]#21350L, MS[25]#21351L, MS[26]#21352L, MS[27]#21353L, MS[28]#21354L, MS[29]#21355L, MS[30]#21356L, MS[31]#21357L, MS[32]#21358L, MS[33]#21359L, MS[34]#21360L, MS[35]#21361L, MS[36]#21362L, MS[37]#21363L, MS[38]#21364L, MS[39]#21365L, MS[40]#21366L, MS[41]#21367L, MS[42]#21368L, MS[43]#21369L, MS[44]#21370L, MS[45]#21371L, MS[46]#21372L, MS[47]#21373L, MS[48]#21374L, MS[49]#21375L, MS[50]#21376L, MS[51]#21377L, sum#21492L, sum#21493, sum#21494, count#21495L]
Keys [2]: [segment#21259, processing_day#21261]
Functions [5]: [count(1), approx_count_distinct(customer_id#21255L, 0.05, 0, 0), sum(events#21265), sum(weighted_amount#21267), avg(amount#21263)]
Aggregate Attributes [5]: [count(1)#21273L, approx_count_distinct(customer_id#21255L, 0.05, 0, 0)#21378L, sum(events#21265)#21379L, sum(weighted_amount#21267)#21380, avg(amount#21263)#21381]
Results [7]: [segment#21259, processing_day#21261, count(1)#21273L AS row_count#21268L, approx_count_distinct(customer_id#21255L, 0.05, 0, 0)#21378L AS unique_customers#21269L, sum(events#21265)#21379L AS event_sum#21270L, sum(weighted_amount#21267)#21380 AS weighted_amount_sum#21271, avg(amount#21263)#21381 AS avg_amount#21272]
(17) Exchange
Input [7]: [segment#21259, processing_day#21261, row_count#21268L, unique_customers#21269L, event_sum#21270L, weighted_amount_sum#21271, avg_amount#21272]
Arguments: rangepartitioning(segment#21259 ASC NULLS FIRST, processing_day#21261 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2024]
(18) Sort
Input [7]: [segment#21259, processing_day#21261, row_count#21268L, unique_customers#21269L, event_sum#21270L, weighted_amount_sum#21271, avg_amount#21272]
Arguments: [segment#21259 ASC NULLS FIRST, processing_day#21261 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#21259, processing_day#21261, row_count#21268L, unique_customers#21269L, event_sum#21270L, weighted_amount_sum#21271, avg_amount#21272]
Arguments: isFinalPlan=true