== 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#13261L]
Arguments: Range (15000000, 16000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#13261L % 250000) AS customer_id#13263L, concat(segment-, cast(cast((id#13261L % 12) as int) as string)) AS segment#13267, cast((id#13261L % 14) as int) AS processing_day#13269, ((cast(((id#13261L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#13271, cast((((id#13261L * 29) % 7) + 1) as int) AS events#13273]
Input [1]: [id#13261L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#13263L, segment#13267, processing_day#13269, amount#13271, events#13273, (amount#13271 * cast(events#13273 as double)) AS weighted_amount#13275]
Input [5]: [customer_id#13263L, segment#13267, processing_day#13269, amount#13271, events#13273]
(4) HashAggregate
Input [6]: [customer_id#13263L, segment#13267, processing_day#13269, amount#13271, events#13273, weighted_amount#13275]
Keys [2]: [segment#13267, processing_day#13269]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#13263L, 0.05, 0, 0), partial_sum(events#13273), partial_sum(weighted_amount#13275), partial_avg(amount#13271)]
Aggregate Attributes [57]: [count#13494L, MS[0]#13282L, MS[1]#13283L, MS[2]#13284L, MS[3]#13285L, MS[4]#13286L, MS[5]#13287L, MS[6]#13288L, MS[7]#13289L, MS[8]#13290L, MS[9]#13291L, MS[10]#13292L, MS[11]#13293L, MS[12]#13294L, MS[13]#13295L, MS[14]#13296L, MS[15]#13297L, MS[16]#13298L, MS[17]#13299L, MS[18]#13300L, MS[19]#13301L, MS[20]#13302L, MS[21]#13303L, MS[22]#13304L, MS[23]#13305L, MS[24]#13306L, MS[25]#13307L, MS[26]#13308L, MS[27]#13309L, MS[28]#13310L, MS[29]#13311L, MS[30]#13312L, MS[31]#13313L, MS[32]#13314L, MS[33]#13315L, MS[34]#13316L, MS[35]#13317L, MS[36]#13318L, MS[37]#13319L, MS[38]#13320L, MS[39]#13321L, MS[40]#13322L, MS[41]#13323L, MS[42]#13324L, MS[43]#13325L, MS[44]#13326L, MS[45]#13327L, MS[46]#13328L, MS[47]#13329L, MS[48]#13330L, MS[49]#13331L, MS[50]#13332L, MS[51]#13333L, sum#13495L, sum#13496, sum#13497, count#13498L]
Results [59]: [segment#13267, processing_day#13269, count#13499L, MS[0]#13334L, MS[1]#13335L, MS[2]#13336L, MS[3]#13337L, MS[4]#13338L, MS[5]#13339L, MS[6]#13340L, MS[7]#13341L, MS[8]#13342L, MS[9]#13343L, MS[10]#13344L, MS[11]#13345L, MS[12]#13346L, MS[13]#13347L, MS[14]#13348L, MS[15]#13349L, MS[16]#13350L, MS[17]#13351L, MS[18]#13352L, MS[19]#13353L, MS[20]#13354L, MS[21]#13355L, MS[22]#13356L, MS[23]#13357L, MS[24]#13358L, MS[25]#13359L, MS[26]#13360L, MS[27]#13361L, MS[28]#13362L, MS[29]#13363L, MS[30]#13364L, MS[31]#13365L, MS[32]#13366L, MS[33]#13367L, MS[34]#13368L, MS[35]#13369L, MS[36]#13370L, MS[37]#13371L, MS[38]#13372L, MS[39]#13373L, MS[40]#13374L, MS[41]#13375L, MS[42]#13376L, MS[43]#13377L, MS[44]#13378L, MS[45]#13379L, MS[46]#13380L, MS[47]#13381L, MS[48]#13382L, MS[49]#13383L, MS[50]#13384L, MS[51]#13385L, sum#13500L, sum#13501, sum#13502, count#13503L]
(5) Exchange
Input [59]: [segment#13267, processing_day#13269, count#13499L, MS[0]#13334L, MS[1]#13335L, MS[2]#13336L, MS[3]#13337L, MS[4]#13338L, MS[5]#13339L, MS[6]#13340L, MS[7]#13341L, MS[8]#13342L, MS[9]#13343L, MS[10]#13344L, MS[11]#13345L, MS[12]#13346L, MS[13]#13347L, MS[14]#13348L, MS[15]#13349L, MS[16]#13350L, MS[17]#13351L, MS[18]#13352L, MS[19]#13353L, MS[20]#13354L, MS[21]#13355L, MS[22]#13356L, MS[23]#13357L, MS[24]#13358L, MS[25]#13359L, MS[26]#13360L, MS[27]#13361L, MS[28]#13362L, MS[29]#13363L, MS[30]#13364L, MS[31]#13365L, MS[32]#13366L, MS[33]#13367L, MS[34]#13368L, MS[35]#13369L, MS[36]#13370L, MS[37]#13371L, MS[38]#13372L, MS[39]#13373L, MS[40]#13374L, MS[41]#13375L, MS[42]#13376L, MS[43]#13377L, MS[44]#13378L, MS[45]#13379L, MS[46]#13380L, MS[47]#13381L, MS[48]#13382L, MS[49]#13383L, MS[50]#13384L, MS[51]#13385L, sum#13500L, sum#13501, sum#13502, count#13503L]
Arguments: hashpartitioning(segment#13267, processing_day#13269, 200), ENSURE_REQUIREMENTS, [plan_id=1288]
(6) ShuffleQueryStage
Output [59]: [segment#13267, processing_day#13269, count#13499L, MS[0]#13334L, MS[1]#13335L, MS[2]#13336L, MS[3]#13337L, MS[4]#13338L, MS[5]#13339L, MS[6]#13340L, MS[7]#13341L, MS[8]#13342L, MS[9]#13343L, MS[10]#13344L, MS[11]#13345L, MS[12]#13346L, MS[13]#13347L, MS[14]#13348L, MS[15]#13349L, MS[16]#13350L, MS[17]#13351L, MS[18]#13352L, MS[19]#13353L, MS[20]#13354L, MS[21]#13355L, MS[22]#13356L, MS[23]#13357L, MS[24]#13358L, MS[25]#13359L, MS[26]#13360L, MS[27]#13361L, MS[28]#13362L, MS[29]#13363L, MS[30]#13364L, MS[31]#13365L, MS[32]#13366L, MS[33]#13367L, MS[34]#13368L, MS[35]#13369L, MS[36]#13370L, MS[37]#13371L, MS[38]#13372L, MS[39]#13373L, MS[40]#13374L, MS[41]#13375L, MS[42]#13376L, MS[43]#13377L, MS[44]#13378L, MS[45]#13379L, MS[46]#13380L, MS[47]#13381L, MS[48]#13382L, MS[49]#13383L, MS[50]#13384L, MS[51]#13385L, sum#13500L, sum#13501, sum#13502, count#13503L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#13267, processing_day#13269, count#13499L, MS[0]#13334L, MS[1]#13335L, MS[2]#13336L, MS[3]#13337L, MS[4]#13338L, MS[5]#13339L, MS[6]#13340L, MS[7]#13341L, MS[8]#13342L, MS[9]#13343L, MS[10]#13344L, MS[11]#13345L, MS[12]#13346L, MS[13]#13347L, MS[14]#13348L, MS[15]#13349L, MS[16]#13350L, MS[17]#13351L, MS[18]#13352L, MS[19]#13353L, MS[20]#13354L, MS[21]#13355L, MS[22]#13356L, MS[23]#13357L, MS[24]#13358L, MS[25]#13359L, MS[26]#13360L, MS[27]#13361L, MS[28]#13362L, MS[29]#13363L, MS[30]#13364L, MS[31]#13365L, MS[32]#13366L, MS[33]#13367L, MS[34]#13368L, MS[35]#13369L, MS[36]#13370L, MS[37]#13371L, MS[38]#13372L, MS[39]#13373L, MS[40]#13374L, MS[41]#13375L, MS[42]#13376L, MS[43]#13377L, MS[44]#13378L, MS[45]#13379L, MS[46]#13380L, MS[47]#13381L, MS[48]#13382L, MS[49]#13383L, MS[50]#13384L, MS[51]#13385L, sum#13500L, sum#13501, sum#13502, count#13503L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#13267, processing_day#13269, count#13499L, MS[0]#13334L, MS[1]#13335L, MS[2]#13336L, MS[3]#13337L, MS[4]#13338L, MS[5]#13339L, MS[6]#13340L, MS[7]#13341L, MS[8]#13342L, MS[9]#13343L, MS[10]#13344L, MS[11]#13345L, MS[12]#13346L, MS[13]#13347L, MS[14]#13348L, MS[15]#13349L, MS[16]#13350L, MS[17]#13351L, MS[18]#13352L, MS[19]#13353L, MS[20]#13354L, MS[21]#13355L, MS[22]#13356L, MS[23]#13357L, MS[24]#13358L, MS[25]#13359L, MS[26]#13360L, MS[27]#13361L, MS[28]#13362L, MS[29]#13363L, MS[30]#13364L, MS[31]#13365L, MS[32]#13366L, MS[33]#13367L, MS[34]#13368L, MS[35]#13369L, MS[36]#13370L, MS[37]#13371L, MS[38]#13372L, MS[39]#13373L, MS[40]#13374L, MS[41]#13375L, MS[42]#13376L, MS[43]#13377L, MS[44]#13378L, MS[45]#13379L, MS[46]#13380L, MS[47]#13381L, MS[48]#13382L, MS[49]#13383L, MS[50]#13384L, MS[51]#13385L, sum#13500L, sum#13501, sum#13502, count#13503L]
Keys [2]: [segment#13267, processing_day#13269]
Functions [5]: [count(1), approx_count_distinct(customer_id#13263L, 0.05, 0, 0), sum(events#13273), sum(weighted_amount#13275), avg(amount#13271)]
Aggregate Attributes [5]: [count(1)#13281L, approx_count_distinct(customer_id#13263L, 0.05, 0, 0)#13386L, sum(events#13273)#13387L, sum(weighted_amount#13275)#13388, avg(amount#13271)#13389]
Results [7]: [segment#13267, processing_day#13269, count(1)#13281L AS row_count#13276L, approx_count_distinct(customer_id#13263L, 0.05, 0, 0)#13386L AS unique_customers#13277L, sum(events#13273)#13387L AS event_sum#13278L, sum(weighted_amount#13275)#13388 AS weighted_amount_sum#13279, avg(amount#13271)#13389 AS avg_amount#13280]
(9) Exchange
Input [7]: [segment#13267, processing_day#13269, row_count#13276L, unique_customers#13277L, event_sum#13278L, weighted_amount_sum#13279, avg_amount#13280]
Arguments: rangepartitioning(segment#13267 ASC NULLS FIRST, processing_day#13269 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1310]
(10) ShuffleQueryStage
Output [7]: [segment#13267, processing_day#13269, row_count#13276L, unique_customers#13277L, event_sum#13278L, weighted_amount_sum#13279, avg_amount#13280]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#13267, processing_day#13269, row_count#13276L, unique_customers#13277L, event_sum#13278L, weighted_amount_sum#13279, avg_amount#13280]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#13267, processing_day#13269, row_count#13276L, unique_customers#13277L, event_sum#13278L, weighted_amount_sum#13279, avg_amount#13280]
Arguments: [segment#13267 ASC NULLS FIRST, processing_day#13269 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#13267, processing_day#13269, row_count#13276L, unique_customers#13277L, event_sum#13278L, weighted_amount_sum#13279, avg_amount#13280]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#13263L, segment#13267, processing_day#13269, amount#13271, events#13273, weighted_amount#13275]
Keys [2]: [segment#13267, processing_day#13269]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#13263L, 0.05, 0, 0), partial_sum(events#13273), partial_sum(weighted_amount#13275), partial_avg(amount#13271)]
Aggregate Attributes [57]: [count#13494L, MS[0]#13282L, MS[1]#13283L, MS[2]#13284L, MS[3]#13285L, MS[4]#13286L, MS[5]#13287L, MS[6]#13288L, MS[7]#13289L, MS[8]#13290L, MS[9]#13291L, MS[10]#13292L, MS[11]#13293L, MS[12]#13294L, MS[13]#13295L, MS[14]#13296L, MS[15]#13297L, MS[16]#13298L, MS[17]#13299L, MS[18]#13300L, MS[19]#13301L, MS[20]#13302L, MS[21]#13303L, MS[22]#13304L, MS[23]#13305L, MS[24]#13306L, MS[25]#13307L, MS[26]#13308L, MS[27]#13309L, MS[28]#13310L, MS[29]#13311L, MS[30]#13312L, MS[31]#13313L, MS[32]#13314L, MS[33]#13315L, MS[34]#13316L, MS[35]#13317L, MS[36]#13318L, MS[37]#13319L, MS[38]#13320L, MS[39]#13321L, MS[40]#13322L, MS[41]#13323L, MS[42]#13324L, MS[43]#13325L, MS[44]#13326L, MS[45]#13327L, MS[46]#13328L, MS[47]#13329L, MS[48]#13330L, MS[49]#13331L, MS[50]#13332L, MS[51]#13333L, sum#13495L, sum#13496, sum#13497, count#13498L]
Results [59]: [segment#13267, processing_day#13269, count#13499L, MS[0]#13334L, MS[1]#13335L, MS[2]#13336L, MS[3]#13337L, MS[4]#13338L, MS[5]#13339L, MS[6]#13340L, MS[7]#13341L, MS[8]#13342L, MS[9]#13343L, MS[10]#13344L, MS[11]#13345L, MS[12]#13346L, MS[13]#13347L, MS[14]#13348L, MS[15]#13349L, MS[16]#13350L, MS[17]#13351L, MS[18]#13352L, MS[19]#13353L, MS[20]#13354L, MS[21]#13355L, MS[22]#13356L, MS[23]#13357L, MS[24]#13358L, MS[25]#13359L, MS[26]#13360L, MS[27]#13361L, MS[28]#13362L, MS[29]#13363L, MS[30]#13364L, MS[31]#13365L, MS[32]#13366L, MS[33]#13367L, MS[34]#13368L, MS[35]#13369L, MS[36]#13370L, MS[37]#13371L, MS[38]#13372L, MS[39]#13373L, MS[40]#13374L, MS[41]#13375L, MS[42]#13376L, MS[43]#13377L, MS[44]#13378L, MS[45]#13379L, MS[46]#13380L, MS[47]#13381L, MS[48]#13382L, MS[49]#13383L, MS[50]#13384L, MS[51]#13385L, sum#13500L, sum#13501, sum#13502, count#13503L]
(15) Exchange
Input [59]: [segment#13267, processing_day#13269, count#13499L, MS[0]#13334L, MS[1]#13335L, MS[2]#13336L, MS[3]#13337L, MS[4]#13338L, MS[5]#13339L, MS[6]#13340L, MS[7]#13341L, MS[8]#13342L, MS[9]#13343L, MS[10]#13344L, MS[11]#13345L, MS[12]#13346L, MS[13]#13347L, MS[14]#13348L, MS[15]#13349L, MS[16]#13350L, MS[17]#13351L, MS[18]#13352L, MS[19]#13353L, MS[20]#13354L, MS[21]#13355L, MS[22]#13356L, MS[23]#13357L, MS[24]#13358L, MS[25]#13359L, MS[26]#13360L, MS[27]#13361L, MS[28]#13362L, MS[29]#13363L, MS[30]#13364L, MS[31]#13365L, MS[32]#13366L, MS[33]#13367L, MS[34]#13368L, MS[35]#13369L, MS[36]#13370L, MS[37]#13371L, MS[38]#13372L, MS[39]#13373L, MS[40]#13374L, MS[41]#13375L, MS[42]#13376L, MS[43]#13377L, MS[44]#13378L, MS[45]#13379L, MS[46]#13380L, MS[47]#13381L, MS[48]#13382L, MS[49]#13383L, MS[50]#13384L, MS[51]#13385L, sum#13500L, sum#13501, sum#13502, count#13503L]
Arguments: hashpartitioning(segment#13267, processing_day#13269, 200), ENSURE_REQUIREMENTS, [plan_id=1268]
(16) HashAggregate
Input [59]: [segment#13267, processing_day#13269, count#13499L, MS[0]#13334L, MS[1]#13335L, MS[2]#13336L, MS[3]#13337L, MS[4]#13338L, MS[5]#13339L, MS[6]#13340L, MS[7]#13341L, MS[8]#13342L, MS[9]#13343L, MS[10]#13344L, MS[11]#13345L, MS[12]#13346L, MS[13]#13347L, MS[14]#13348L, MS[15]#13349L, MS[16]#13350L, MS[17]#13351L, MS[18]#13352L, MS[19]#13353L, MS[20]#13354L, MS[21]#13355L, MS[22]#13356L, MS[23]#13357L, MS[24]#13358L, MS[25]#13359L, MS[26]#13360L, MS[27]#13361L, MS[28]#13362L, MS[29]#13363L, MS[30]#13364L, MS[31]#13365L, MS[32]#13366L, MS[33]#13367L, MS[34]#13368L, MS[35]#13369L, MS[36]#13370L, MS[37]#13371L, MS[38]#13372L, MS[39]#13373L, MS[40]#13374L, MS[41]#13375L, MS[42]#13376L, MS[43]#13377L, MS[44]#13378L, MS[45]#13379L, MS[46]#13380L, MS[47]#13381L, MS[48]#13382L, MS[49]#13383L, MS[50]#13384L, MS[51]#13385L, sum#13500L, sum#13501, sum#13502, count#13503L]
Keys [2]: [segment#13267, processing_day#13269]
Functions [5]: [count(1), approx_count_distinct(customer_id#13263L, 0.05, 0, 0), sum(events#13273), sum(weighted_amount#13275), avg(amount#13271)]
Aggregate Attributes [5]: [count(1)#13281L, approx_count_distinct(customer_id#13263L, 0.05, 0, 0)#13386L, sum(events#13273)#13387L, sum(weighted_amount#13275)#13388, avg(amount#13271)#13389]
Results [7]: [segment#13267, processing_day#13269, count(1)#13281L AS row_count#13276L, approx_count_distinct(customer_id#13263L, 0.05, 0, 0)#13386L AS unique_customers#13277L, sum(events#13273)#13387L AS event_sum#13278L, sum(weighted_amount#13275)#13388 AS weighted_amount_sum#13279, avg(amount#13271)#13389 AS avg_amount#13280]
(17) Exchange
Input [7]: [segment#13267, processing_day#13269, row_count#13276L, unique_customers#13277L, event_sum#13278L, weighted_amount_sum#13279, avg_amount#13280]
Arguments: rangepartitioning(segment#13267 ASC NULLS FIRST, processing_day#13269 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1271]
(18) Sort
Input [7]: [segment#13267, processing_day#13269, row_count#13276L, unique_customers#13277L, event_sum#13278L, weighted_amount_sum#13279, avg_amount#13280]
Arguments: [segment#13267 ASC NULLS FIRST, processing_day#13269 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#13267, processing_day#13269, row_count#13276L, unique_customers#13277L, event_sum#13278L, weighted_amount_sum#13279, avg_amount#13280]
Arguments: isFinalPlan=true