== 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#5305L]
Arguments: Range (6000000, 7000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#5305L % 250000) AS customer_id#5307L, concat(segment-, cast(cast((id#5305L % 12) as int) as string)) AS segment#5311, cast((id#5305L % 14) as int) AS processing_day#5313, ((cast(((id#5305L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#5315, cast((((id#5305L * 29) % 7) + 1) as int) AS events#5317]
Input [1]: [id#5305L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#5307L, segment#5311, processing_day#5313, amount#5315, events#5317, (amount#5315 * cast(events#5317 as double)) AS weighted_amount#5319]
Input [5]: [customer_id#5307L, segment#5311, processing_day#5313, amount#5315, events#5317]
(4) HashAggregate
Input [6]: [customer_id#5307L, segment#5311, processing_day#5313, amount#5315, events#5317, weighted_amount#5319]
Keys [2]: [segment#5311, processing_day#5313]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#5307L, 0.05, 0, 0), partial_sum(events#5317), partial_sum(weighted_amount#5319), partial_avg(amount#5315)]
Aggregate Attributes [57]: [count#5538L, MS[0]#5326L, MS[1]#5327L, MS[2]#5328L, MS[3]#5329L, MS[4]#5330L, MS[5]#5331L, MS[6]#5332L, MS[7]#5333L, MS[8]#5334L, MS[9]#5335L, MS[10]#5336L, MS[11]#5337L, MS[12]#5338L, MS[13]#5339L, MS[14]#5340L, MS[15]#5341L, MS[16]#5342L, MS[17]#5343L, MS[18]#5344L, MS[19]#5345L, MS[20]#5346L, MS[21]#5347L, MS[22]#5348L, MS[23]#5349L, MS[24]#5350L, MS[25]#5351L, MS[26]#5352L, MS[27]#5353L, MS[28]#5354L, MS[29]#5355L, MS[30]#5356L, MS[31]#5357L, MS[32]#5358L, MS[33]#5359L, MS[34]#5360L, MS[35]#5361L, MS[36]#5362L, MS[37]#5363L, MS[38]#5364L, MS[39]#5365L, MS[40]#5366L, MS[41]#5367L, MS[42]#5368L, MS[43]#5369L, MS[44]#5370L, MS[45]#5371L, MS[46]#5372L, MS[47]#5373L, MS[48]#5374L, MS[49]#5375L, MS[50]#5376L, MS[51]#5377L, sum#5539L, sum#5540, sum#5541, count#5542L]
Results [59]: [segment#5311, processing_day#5313, count#5543L, MS[0]#5378L, MS[1]#5379L, MS[2]#5380L, MS[3]#5381L, MS[4]#5382L, MS[5]#5383L, MS[6]#5384L, MS[7]#5385L, MS[8]#5386L, MS[9]#5387L, MS[10]#5388L, MS[11]#5389L, MS[12]#5390L, MS[13]#5391L, MS[14]#5392L, MS[15]#5393L, MS[16]#5394L, MS[17]#5395L, MS[18]#5396L, MS[19]#5397L, MS[20]#5398L, MS[21]#5399L, MS[22]#5400L, MS[23]#5401L, MS[24]#5402L, MS[25]#5403L, MS[26]#5404L, MS[27]#5405L, MS[28]#5406L, MS[29]#5407L, MS[30]#5408L, MS[31]#5409L, MS[32]#5410L, MS[33]#5411L, MS[34]#5412L, MS[35]#5413L, MS[36]#5414L, MS[37]#5415L, MS[38]#5416L, MS[39]#5417L, MS[40]#5418L, MS[41]#5419L, MS[42]#5420L, MS[43]#5421L, MS[44]#5422L, MS[45]#5423L, MS[46]#5424L, MS[47]#5425L, MS[48]#5426L, MS[49]#5427L, MS[50]#5428L, MS[51]#5429L, sum#5544L, sum#5545, sum#5546, count#5547L]
(5) Exchange
Input [59]: [segment#5311, processing_day#5313, count#5543L, MS[0]#5378L, MS[1]#5379L, MS[2]#5380L, MS[3]#5381L, MS[4]#5382L, MS[5]#5383L, MS[6]#5384L, MS[7]#5385L, MS[8]#5386L, MS[9]#5387L, MS[10]#5388L, MS[11]#5389L, MS[12]#5390L, MS[13]#5391L, MS[14]#5392L, MS[15]#5393L, MS[16]#5394L, MS[17]#5395L, MS[18]#5396L, MS[19]#5397L, MS[20]#5398L, MS[21]#5399L, MS[22]#5400L, MS[23]#5401L, MS[24]#5402L, MS[25]#5403L, MS[26]#5404L, MS[27]#5405L, MS[28]#5406L, MS[29]#5407L, MS[30]#5408L, MS[31]#5409L, MS[32]#5410L, MS[33]#5411L, MS[34]#5412L, MS[35]#5413L, MS[36]#5414L, MS[37]#5415L, MS[38]#5416L, MS[39]#5417L, MS[40]#5418L, MS[41]#5419L, MS[42]#5420L, MS[43]#5421L, MS[44]#5422L, MS[45]#5423L, MS[46]#5424L, MS[47]#5425L, MS[48]#5426L, MS[49]#5427L, MS[50]#5428L, MS[51]#5429L, sum#5544L, sum#5545, sum#5546, count#5547L]
Arguments: hashpartitioning(segment#5311, processing_day#5313, 200), ENSURE_REQUIREMENTS, [plan_id=541]
(6) ShuffleQueryStage
Output [59]: [segment#5311, processing_day#5313, count#5543L, MS[0]#5378L, MS[1]#5379L, MS[2]#5380L, MS[3]#5381L, MS[4]#5382L, MS[5]#5383L, MS[6]#5384L, MS[7]#5385L, MS[8]#5386L, MS[9]#5387L, MS[10]#5388L, MS[11]#5389L, MS[12]#5390L, MS[13]#5391L, MS[14]#5392L, MS[15]#5393L, MS[16]#5394L, MS[17]#5395L, MS[18]#5396L, MS[19]#5397L, MS[20]#5398L, MS[21]#5399L, MS[22]#5400L, MS[23]#5401L, MS[24]#5402L, MS[25]#5403L, MS[26]#5404L, MS[27]#5405L, MS[28]#5406L, MS[29]#5407L, MS[30]#5408L, MS[31]#5409L, MS[32]#5410L, MS[33]#5411L, MS[34]#5412L, MS[35]#5413L, MS[36]#5414L, MS[37]#5415L, MS[38]#5416L, MS[39]#5417L, MS[40]#5418L, MS[41]#5419L, MS[42]#5420L, MS[43]#5421L, MS[44]#5422L, MS[45]#5423L, MS[46]#5424L, MS[47]#5425L, MS[48]#5426L, MS[49]#5427L, MS[50]#5428L, MS[51]#5429L, sum#5544L, sum#5545, sum#5546, count#5547L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#5311, processing_day#5313, count#5543L, MS[0]#5378L, MS[1]#5379L, MS[2]#5380L, MS[3]#5381L, MS[4]#5382L, MS[5]#5383L, MS[6]#5384L, MS[7]#5385L, MS[8]#5386L, MS[9]#5387L, MS[10]#5388L, MS[11]#5389L, MS[12]#5390L, MS[13]#5391L, MS[14]#5392L, MS[15]#5393L, MS[16]#5394L, MS[17]#5395L, MS[18]#5396L, MS[19]#5397L, MS[20]#5398L, MS[21]#5399L, MS[22]#5400L, MS[23]#5401L, MS[24]#5402L, MS[25]#5403L, MS[26]#5404L, MS[27]#5405L, MS[28]#5406L, MS[29]#5407L, MS[30]#5408L, MS[31]#5409L, MS[32]#5410L, MS[33]#5411L, MS[34]#5412L, MS[35]#5413L, MS[36]#5414L, MS[37]#5415L, MS[38]#5416L, MS[39]#5417L, MS[40]#5418L, MS[41]#5419L, MS[42]#5420L, MS[43]#5421L, MS[44]#5422L, MS[45]#5423L, MS[46]#5424L, MS[47]#5425L, MS[48]#5426L, MS[49]#5427L, MS[50]#5428L, MS[51]#5429L, sum#5544L, sum#5545, sum#5546, count#5547L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#5311, processing_day#5313, count#5543L, MS[0]#5378L, MS[1]#5379L, MS[2]#5380L, MS[3]#5381L, MS[4]#5382L, MS[5]#5383L, MS[6]#5384L, MS[7]#5385L, MS[8]#5386L, MS[9]#5387L, MS[10]#5388L, MS[11]#5389L, MS[12]#5390L, MS[13]#5391L, MS[14]#5392L, MS[15]#5393L, MS[16]#5394L, MS[17]#5395L, MS[18]#5396L, MS[19]#5397L, MS[20]#5398L, MS[21]#5399L, MS[22]#5400L, MS[23]#5401L, MS[24]#5402L, MS[25]#5403L, MS[26]#5404L, MS[27]#5405L, MS[28]#5406L, MS[29]#5407L, MS[30]#5408L, MS[31]#5409L, MS[32]#5410L, MS[33]#5411L, MS[34]#5412L, MS[35]#5413L, MS[36]#5414L, MS[37]#5415L, MS[38]#5416L, MS[39]#5417L, MS[40]#5418L, MS[41]#5419L, MS[42]#5420L, MS[43]#5421L, MS[44]#5422L, MS[45]#5423L, MS[46]#5424L, MS[47]#5425L, MS[48]#5426L, MS[49]#5427L, MS[50]#5428L, MS[51]#5429L, sum#5544L, sum#5545, sum#5546, count#5547L]
Keys [2]: [segment#5311, processing_day#5313]
Functions [5]: [count(1), approx_count_distinct(customer_id#5307L, 0.05, 0, 0), sum(events#5317), sum(weighted_amount#5319), avg(amount#5315)]
Aggregate Attributes [5]: [count(1)#5325L, approx_count_distinct(customer_id#5307L, 0.05, 0, 0)#5430L, sum(events#5317)#5431L, sum(weighted_amount#5319)#5432, avg(amount#5315)#5433]
Results [7]: [segment#5311, processing_day#5313, count(1)#5325L AS row_count#5320L, approx_count_distinct(customer_id#5307L, 0.05, 0, 0)#5430L AS unique_customers#5321L, sum(events#5317)#5431L AS event_sum#5322L, sum(weighted_amount#5319)#5432 AS weighted_amount_sum#5323, avg(amount#5315)#5433 AS avg_amount#5324]
(9) Exchange
Input [7]: [segment#5311, processing_day#5313, row_count#5320L, unique_customers#5321L, event_sum#5322L, weighted_amount_sum#5323, avg_amount#5324]
Arguments: rangepartitioning(segment#5311 ASC NULLS FIRST, processing_day#5313 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=563]
(10) ShuffleQueryStage
Output [7]: [segment#5311, processing_day#5313, row_count#5320L, unique_customers#5321L, event_sum#5322L, weighted_amount_sum#5323, avg_amount#5324]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#5311, processing_day#5313, row_count#5320L, unique_customers#5321L, event_sum#5322L, weighted_amount_sum#5323, avg_amount#5324]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#5311, processing_day#5313, row_count#5320L, unique_customers#5321L, event_sum#5322L, weighted_amount_sum#5323, avg_amount#5324]
Arguments: [segment#5311 ASC NULLS FIRST, processing_day#5313 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#5311, processing_day#5313, row_count#5320L, unique_customers#5321L, event_sum#5322L, weighted_amount_sum#5323, avg_amount#5324]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#5307L, segment#5311, processing_day#5313, amount#5315, events#5317, weighted_amount#5319]
Keys [2]: [segment#5311, processing_day#5313]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#5307L, 0.05, 0, 0), partial_sum(events#5317), partial_sum(weighted_amount#5319), partial_avg(amount#5315)]
Aggregate Attributes [57]: [count#5538L, MS[0]#5326L, MS[1]#5327L, MS[2]#5328L, MS[3]#5329L, MS[4]#5330L, MS[5]#5331L, MS[6]#5332L, MS[7]#5333L, MS[8]#5334L, MS[9]#5335L, MS[10]#5336L, MS[11]#5337L, MS[12]#5338L, MS[13]#5339L, MS[14]#5340L, MS[15]#5341L, MS[16]#5342L, MS[17]#5343L, MS[18]#5344L, MS[19]#5345L, MS[20]#5346L, MS[21]#5347L, MS[22]#5348L, MS[23]#5349L, MS[24]#5350L, MS[25]#5351L, MS[26]#5352L, MS[27]#5353L, MS[28]#5354L, MS[29]#5355L, MS[30]#5356L, MS[31]#5357L, MS[32]#5358L, MS[33]#5359L, MS[34]#5360L, MS[35]#5361L, MS[36]#5362L, MS[37]#5363L, MS[38]#5364L, MS[39]#5365L, MS[40]#5366L, MS[41]#5367L, MS[42]#5368L, MS[43]#5369L, MS[44]#5370L, MS[45]#5371L, MS[46]#5372L, MS[47]#5373L, MS[48]#5374L, MS[49]#5375L, MS[50]#5376L, MS[51]#5377L, sum#5539L, sum#5540, sum#5541, count#5542L]
Results [59]: [segment#5311, processing_day#5313, count#5543L, MS[0]#5378L, MS[1]#5379L, MS[2]#5380L, MS[3]#5381L, MS[4]#5382L, MS[5]#5383L, MS[6]#5384L, MS[7]#5385L, MS[8]#5386L, MS[9]#5387L, MS[10]#5388L, MS[11]#5389L, MS[12]#5390L, MS[13]#5391L, MS[14]#5392L, MS[15]#5393L, MS[16]#5394L, MS[17]#5395L, MS[18]#5396L, MS[19]#5397L, MS[20]#5398L, MS[21]#5399L, MS[22]#5400L, MS[23]#5401L, MS[24]#5402L, MS[25]#5403L, MS[26]#5404L, MS[27]#5405L, MS[28]#5406L, MS[29]#5407L, MS[30]#5408L, MS[31]#5409L, MS[32]#5410L, MS[33]#5411L, MS[34]#5412L, MS[35]#5413L, MS[36]#5414L, MS[37]#5415L, MS[38]#5416L, MS[39]#5417L, MS[40]#5418L, MS[41]#5419L, MS[42]#5420L, MS[43]#5421L, MS[44]#5422L, MS[45]#5423L, MS[46]#5424L, MS[47]#5425L, MS[48]#5426L, MS[49]#5427L, MS[50]#5428L, MS[51]#5429L, sum#5544L, sum#5545, sum#5546, count#5547L]
(15) Exchange
Input [59]: [segment#5311, processing_day#5313, count#5543L, MS[0]#5378L, MS[1]#5379L, MS[2]#5380L, MS[3]#5381L, MS[4]#5382L, MS[5]#5383L, MS[6]#5384L, MS[7]#5385L, MS[8]#5386L, MS[9]#5387L, MS[10]#5388L, MS[11]#5389L, MS[12]#5390L, MS[13]#5391L, MS[14]#5392L, MS[15]#5393L, MS[16]#5394L, MS[17]#5395L, MS[18]#5396L, MS[19]#5397L, MS[20]#5398L, MS[21]#5399L, MS[22]#5400L, MS[23]#5401L, MS[24]#5402L, MS[25]#5403L, MS[26]#5404L, MS[27]#5405L, MS[28]#5406L, MS[29]#5407L, MS[30]#5408L, MS[31]#5409L, MS[32]#5410L, MS[33]#5411L, MS[34]#5412L, MS[35]#5413L, MS[36]#5414L, MS[37]#5415L, MS[38]#5416L, MS[39]#5417L, MS[40]#5418L, MS[41]#5419L, MS[42]#5420L, MS[43]#5421L, MS[44]#5422L, MS[45]#5423L, MS[46]#5424L, MS[47]#5425L, MS[48]#5426L, MS[49]#5427L, MS[50]#5428L, MS[51]#5429L, sum#5544L, sum#5545, sum#5546, count#5547L]
Arguments: hashpartitioning(segment#5311, processing_day#5313, 200), ENSURE_REQUIREMENTS, [plan_id=521]
(16) HashAggregate
Input [59]: [segment#5311, processing_day#5313, count#5543L, MS[0]#5378L, MS[1]#5379L, MS[2]#5380L, MS[3]#5381L, MS[4]#5382L, MS[5]#5383L, MS[6]#5384L, MS[7]#5385L, MS[8]#5386L, MS[9]#5387L, MS[10]#5388L, MS[11]#5389L, MS[12]#5390L, MS[13]#5391L, MS[14]#5392L, MS[15]#5393L, MS[16]#5394L, MS[17]#5395L, MS[18]#5396L, MS[19]#5397L, MS[20]#5398L, MS[21]#5399L, MS[22]#5400L, MS[23]#5401L, MS[24]#5402L, MS[25]#5403L, MS[26]#5404L, MS[27]#5405L, MS[28]#5406L, MS[29]#5407L, MS[30]#5408L, MS[31]#5409L, MS[32]#5410L, MS[33]#5411L, MS[34]#5412L, MS[35]#5413L, MS[36]#5414L, MS[37]#5415L, MS[38]#5416L, MS[39]#5417L, MS[40]#5418L, MS[41]#5419L, MS[42]#5420L, MS[43]#5421L, MS[44]#5422L, MS[45]#5423L, MS[46]#5424L, MS[47]#5425L, MS[48]#5426L, MS[49]#5427L, MS[50]#5428L, MS[51]#5429L, sum#5544L, sum#5545, sum#5546, count#5547L]
Keys [2]: [segment#5311, processing_day#5313]
Functions [5]: [count(1), approx_count_distinct(customer_id#5307L, 0.05, 0, 0), sum(events#5317), sum(weighted_amount#5319), avg(amount#5315)]
Aggregate Attributes [5]: [count(1)#5325L, approx_count_distinct(customer_id#5307L, 0.05, 0, 0)#5430L, sum(events#5317)#5431L, sum(weighted_amount#5319)#5432, avg(amount#5315)#5433]
Results [7]: [segment#5311, processing_day#5313, count(1)#5325L AS row_count#5320L, approx_count_distinct(customer_id#5307L, 0.05, 0, 0)#5430L AS unique_customers#5321L, sum(events#5317)#5431L AS event_sum#5322L, sum(weighted_amount#5319)#5432 AS weighted_amount_sum#5323, avg(amount#5315)#5433 AS avg_amount#5324]
(17) Exchange
Input [7]: [segment#5311, processing_day#5313, row_count#5320L, unique_customers#5321L, event_sum#5322L, weighted_amount_sum#5323, avg_amount#5324]
Arguments: rangepartitioning(segment#5311 ASC NULLS FIRST, processing_day#5313 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=524]
(18) Sort
Input [7]: [segment#5311, processing_day#5313, row_count#5320L, unique_customers#5321L, event_sum#5322L, weighted_amount_sum#5323, avg_amount#5324]
Arguments: [segment#5311 ASC NULLS FIRST, processing_day#5313 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#5311, processing_day#5313, row_count#5320L, unique_customers#5321L, event_sum#5322L, weighted_amount_sum#5323, avg_amount#5324]
Arguments: isFinalPlan=true