== 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#11493L]
Arguments: Range (13000000, 14000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#11493L % 250000) AS customer_id#11495L, concat(segment-, cast(cast((id#11493L % 12) as int) as string)) AS segment#11499, cast((id#11493L % 14) as int) AS processing_day#11501, ((cast(((id#11493L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#11503, cast((((id#11493L * 29) % 7) + 1) as int) AS events#11505]
Input [1]: [id#11493L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#11495L, segment#11499, processing_day#11501, amount#11503, events#11505, (amount#11503 * cast(events#11505 as double)) AS weighted_amount#11507]
Input [5]: [customer_id#11495L, segment#11499, processing_day#11501, amount#11503, events#11505]
(4) HashAggregate
Input [6]: [customer_id#11495L, segment#11499, processing_day#11501, amount#11503, events#11505, weighted_amount#11507]
Keys [2]: [segment#11499, processing_day#11501]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#11495L, 0.05, 0, 0), partial_sum(events#11505), partial_sum(weighted_amount#11507), partial_avg(amount#11503)]
Aggregate Attributes [57]: [count#11726L, MS[0]#11514L, MS[1]#11515L, MS[2]#11516L, MS[3]#11517L, MS[4]#11518L, MS[5]#11519L, MS[6]#11520L, MS[7]#11521L, MS[8]#11522L, MS[9]#11523L, MS[10]#11524L, MS[11]#11525L, MS[12]#11526L, MS[13]#11527L, MS[14]#11528L, MS[15]#11529L, MS[16]#11530L, MS[17]#11531L, MS[18]#11532L, MS[19]#11533L, MS[20]#11534L, MS[21]#11535L, MS[22]#11536L, MS[23]#11537L, MS[24]#11538L, MS[25]#11539L, MS[26]#11540L, MS[27]#11541L, MS[28]#11542L, MS[29]#11543L, MS[30]#11544L, MS[31]#11545L, MS[32]#11546L, MS[33]#11547L, MS[34]#11548L, MS[35]#11549L, MS[36]#11550L, MS[37]#11551L, MS[38]#11552L, MS[39]#11553L, MS[40]#11554L, MS[41]#11555L, MS[42]#11556L, MS[43]#11557L, MS[44]#11558L, MS[45]#11559L, MS[46]#11560L, MS[47]#11561L, MS[48]#11562L, MS[49]#11563L, MS[50]#11564L, MS[51]#11565L, sum#11727L, sum#11728, sum#11729, count#11730L]
Results [59]: [segment#11499, processing_day#11501, count#11731L, MS[0]#11566L, MS[1]#11567L, MS[2]#11568L, MS[3]#11569L, MS[4]#11570L, MS[5]#11571L, MS[6]#11572L, MS[7]#11573L, MS[8]#11574L, MS[9]#11575L, MS[10]#11576L, MS[11]#11577L, MS[12]#11578L, MS[13]#11579L, MS[14]#11580L, MS[15]#11581L, MS[16]#11582L, MS[17]#11583L, MS[18]#11584L, MS[19]#11585L, MS[20]#11586L, MS[21]#11587L, MS[22]#11588L, MS[23]#11589L, MS[24]#11590L, MS[25]#11591L, MS[26]#11592L, MS[27]#11593L, MS[28]#11594L, MS[29]#11595L, MS[30]#11596L, MS[31]#11597L, MS[32]#11598L, MS[33]#11599L, MS[34]#11600L, MS[35]#11601L, MS[36]#11602L, MS[37]#11603L, MS[38]#11604L, MS[39]#11605L, MS[40]#11606L, MS[41]#11607L, MS[42]#11608L, MS[43]#11609L, MS[44]#11610L, MS[45]#11611L, MS[46]#11612L, MS[47]#11613L, MS[48]#11614L, MS[49]#11615L, MS[50]#11616L, MS[51]#11617L, sum#11732L, sum#11733, sum#11734, count#11735L]
(5) Exchange
Input [59]: [segment#11499, processing_day#11501, count#11731L, MS[0]#11566L, MS[1]#11567L, MS[2]#11568L, MS[3]#11569L, MS[4]#11570L, MS[5]#11571L, MS[6]#11572L, MS[7]#11573L, MS[8]#11574L, MS[9]#11575L, MS[10]#11576L, MS[11]#11577L, MS[12]#11578L, MS[13]#11579L, MS[14]#11580L, MS[15]#11581L, MS[16]#11582L, MS[17]#11583L, MS[18]#11584L, MS[19]#11585L, MS[20]#11586L, MS[21]#11587L, MS[22]#11588L, MS[23]#11589L, MS[24]#11590L, MS[25]#11591L, MS[26]#11592L, MS[27]#11593L, MS[28]#11594L, MS[29]#11595L, MS[30]#11596L, MS[31]#11597L, MS[32]#11598L, MS[33]#11599L, MS[34]#11600L, MS[35]#11601L, MS[36]#11602L, MS[37]#11603L, MS[38]#11604L, MS[39]#11605L, MS[40]#11606L, MS[41]#11607L, MS[42]#11608L, MS[43]#11609L, MS[44]#11610L, MS[45]#11611L, MS[46]#11612L, MS[47]#11613L, MS[48]#11614L, MS[49]#11615L, MS[50]#11616L, MS[51]#11617L, sum#11732L, sum#11733, sum#11734, count#11735L]
Arguments: hashpartitioning(segment#11499, processing_day#11501, 200), ENSURE_REQUIREMENTS, [plan_id=1122]
(6) ShuffleQueryStage
Output [59]: [segment#11499, processing_day#11501, count#11731L, MS[0]#11566L, MS[1]#11567L, MS[2]#11568L, MS[3]#11569L, MS[4]#11570L, MS[5]#11571L, MS[6]#11572L, MS[7]#11573L, MS[8]#11574L, MS[9]#11575L, MS[10]#11576L, MS[11]#11577L, MS[12]#11578L, MS[13]#11579L, MS[14]#11580L, MS[15]#11581L, MS[16]#11582L, MS[17]#11583L, MS[18]#11584L, MS[19]#11585L, MS[20]#11586L, MS[21]#11587L, MS[22]#11588L, MS[23]#11589L, MS[24]#11590L, MS[25]#11591L, MS[26]#11592L, MS[27]#11593L, MS[28]#11594L, MS[29]#11595L, MS[30]#11596L, MS[31]#11597L, MS[32]#11598L, MS[33]#11599L, MS[34]#11600L, MS[35]#11601L, MS[36]#11602L, MS[37]#11603L, MS[38]#11604L, MS[39]#11605L, MS[40]#11606L, MS[41]#11607L, MS[42]#11608L, MS[43]#11609L, MS[44]#11610L, MS[45]#11611L, MS[46]#11612L, MS[47]#11613L, MS[48]#11614L, MS[49]#11615L, MS[50]#11616L, MS[51]#11617L, sum#11732L, sum#11733, sum#11734, count#11735L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#11499, processing_day#11501, count#11731L, MS[0]#11566L, MS[1]#11567L, MS[2]#11568L, MS[3]#11569L, MS[4]#11570L, MS[5]#11571L, MS[6]#11572L, MS[7]#11573L, MS[8]#11574L, MS[9]#11575L, MS[10]#11576L, MS[11]#11577L, MS[12]#11578L, MS[13]#11579L, MS[14]#11580L, MS[15]#11581L, MS[16]#11582L, MS[17]#11583L, MS[18]#11584L, MS[19]#11585L, MS[20]#11586L, MS[21]#11587L, MS[22]#11588L, MS[23]#11589L, MS[24]#11590L, MS[25]#11591L, MS[26]#11592L, MS[27]#11593L, MS[28]#11594L, MS[29]#11595L, MS[30]#11596L, MS[31]#11597L, MS[32]#11598L, MS[33]#11599L, MS[34]#11600L, MS[35]#11601L, MS[36]#11602L, MS[37]#11603L, MS[38]#11604L, MS[39]#11605L, MS[40]#11606L, MS[41]#11607L, MS[42]#11608L, MS[43]#11609L, MS[44]#11610L, MS[45]#11611L, MS[46]#11612L, MS[47]#11613L, MS[48]#11614L, MS[49]#11615L, MS[50]#11616L, MS[51]#11617L, sum#11732L, sum#11733, sum#11734, count#11735L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#11499, processing_day#11501, count#11731L, MS[0]#11566L, MS[1]#11567L, MS[2]#11568L, MS[3]#11569L, MS[4]#11570L, MS[5]#11571L, MS[6]#11572L, MS[7]#11573L, MS[8]#11574L, MS[9]#11575L, MS[10]#11576L, MS[11]#11577L, MS[12]#11578L, MS[13]#11579L, MS[14]#11580L, MS[15]#11581L, MS[16]#11582L, MS[17]#11583L, MS[18]#11584L, MS[19]#11585L, MS[20]#11586L, MS[21]#11587L, MS[22]#11588L, MS[23]#11589L, MS[24]#11590L, MS[25]#11591L, MS[26]#11592L, MS[27]#11593L, MS[28]#11594L, MS[29]#11595L, MS[30]#11596L, MS[31]#11597L, MS[32]#11598L, MS[33]#11599L, MS[34]#11600L, MS[35]#11601L, MS[36]#11602L, MS[37]#11603L, MS[38]#11604L, MS[39]#11605L, MS[40]#11606L, MS[41]#11607L, MS[42]#11608L, MS[43]#11609L, MS[44]#11610L, MS[45]#11611L, MS[46]#11612L, MS[47]#11613L, MS[48]#11614L, MS[49]#11615L, MS[50]#11616L, MS[51]#11617L, sum#11732L, sum#11733, sum#11734, count#11735L]
Keys [2]: [segment#11499, processing_day#11501]
Functions [5]: [count(1), approx_count_distinct(customer_id#11495L, 0.05, 0, 0), sum(events#11505), sum(weighted_amount#11507), avg(amount#11503)]
Aggregate Attributes [5]: [count(1)#11513L, approx_count_distinct(customer_id#11495L, 0.05, 0, 0)#11618L, sum(events#11505)#11619L, sum(weighted_amount#11507)#11620, avg(amount#11503)#11621]
Results [7]: [segment#11499, processing_day#11501, count(1)#11513L AS row_count#11508L, approx_count_distinct(customer_id#11495L, 0.05, 0, 0)#11618L AS unique_customers#11509L, sum(events#11505)#11619L AS event_sum#11510L, sum(weighted_amount#11507)#11620 AS weighted_amount_sum#11511, avg(amount#11503)#11621 AS avg_amount#11512]
(9) Exchange
Input [7]: [segment#11499, processing_day#11501, row_count#11508L, unique_customers#11509L, event_sum#11510L, weighted_amount_sum#11511, avg_amount#11512]
Arguments: rangepartitioning(segment#11499 ASC NULLS FIRST, processing_day#11501 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1144]
(10) ShuffleQueryStage
Output [7]: [segment#11499, processing_day#11501, row_count#11508L, unique_customers#11509L, event_sum#11510L, weighted_amount_sum#11511, avg_amount#11512]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#11499, processing_day#11501, row_count#11508L, unique_customers#11509L, event_sum#11510L, weighted_amount_sum#11511, avg_amount#11512]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#11499, processing_day#11501, row_count#11508L, unique_customers#11509L, event_sum#11510L, weighted_amount_sum#11511, avg_amount#11512]
Arguments: [segment#11499 ASC NULLS FIRST, processing_day#11501 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#11499, processing_day#11501, row_count#11508L, unique_customers#11509L, event_sum#11510L, weighted_amount_sum#11511, avg_amount#11512]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#11495L, segment#11499, processing_day#11501, amount#11503, events#11505, weighted_amount#11507]
Keys [2]: [segment#11499, processing_day#11501]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#11495L, 0.05, 0, 0), partial_sum(events#11505), partial_sum(weighted_amount#11507), partial_avg(amount#11503)]
Aggregate Attributes [57]: [count#11726L, MS[0]#11514L, MS[1]#11515L, MS[2]#11516L, MS[3]#11517L, MS[4]#11518L, MS[5]#11519L, MS[6]#11520L, MS[7]#11521L, MS[8]#11522L, MS[9]#11523L, MS[10]#11524L, MS[11]#11525L, MS[12]#11526L, MS[13]#11527L, MS[14]#11528L, MS[15]#11529L, MS[16]#11530L, MS[17]#11531L, MS[18]#11532L, MS[19]#11533L, MS[20]#11534L, MS[21]#11535L, MS[22]#11536L, MS[23]#11537L, MS[24]#11538L, MS[25]#11539L, MS[26]#11540L, MS[27]#11541L, MS[28]#11542L, MS[29]#11543L, MS[30]#11544L, MS[31]#11545L, MS[32]#11546L, MS[33]#11547L, MS[34]#11548L, MS[35]#11549L, MS[36]#11550L, MS[37]#11551L, MS[38]#11552L, MS[39]#11553L, MS[40]#11554L, MS[41]#11555L, MS[42]#11556L, MS[43]#11557L, MS[44]#11558L, MS[45]#11559L, MS[46]#11560L, MS[47]#11561L, MS[48]#11562L, MS[49]#11563L, MS[50]#11564L, MS[51]#11565L, sum#11727L, sum#11728, sum#11729, count#11730L]
Results [59]: [segment#11499, processing_day#11501, count#11731L, MS[0]#11566L, MS[1]#11567L, MS[2]#11568L, MS[3]#11569L, MS[4]#11570L, MS[5]#11571L, MS[6]#11572L, MS[7]#11573L, MS[8]#11574L, MS[9]#11575L, MS[10]#11576L, MS[11]#11577L, MS[12]#11578L, MS[13]#11579L, MS[14]#11580L, MS[15]#11581L, MS[16]#11582L, MS[17]#11583L, MS[18]#11584L, MS[19]#11585L, MS[20]#11586L, MS[21]#11587L, MS[22]#11588L, MS[23]#11589L, MS[24]#11590L, MS[25]#11591L, MS[26]#11592L, MS[27]#11593L, MS[28]#11594L, MS[29]#11595L, MS[30]#11596L, MS[31]#11597L, MS[32]#11598L, MS[33]#11599L, MS[34]#11600L, MS[35]#11601L, MS[36]#11602L, MS[37]#11603L, MS[38]#11604L, MS[39]#11605L, MS[40]#11606L, MS[41]#11607L, MS[42]#11608L, MS[43]#11609L, MS[44]#11610L, MS[45]#11611L, MS[46]#11612L, MS[47]#11613L, MS[48]#11614L, MS[49]#11615L, MS[50]#11616L, MS[51]#11617L, sum#11732L, sum#11733, sum#11734, count#11735L]
(15) Exchange
Input [59]: [segment#11499, processing_day#11501, count#11731L, MS[0]#11566L, MS[1]#11567L, MS[2]#11568L, MS[3]#11569L, MS[4]#11570L, MS[5]#11571L, MS[6]#11572L, MS[7]#11573L, MS[8]#11574L, MS[9]#11575L, MS[10]#11576L, MS[11]#11577L, MS[12]#11578L, MS[13]#11579L, MS[14]#11580L, MS[15]#11581L, MS[16]#11582L, MS[17]#11583L, MS[18]#11584L, MS[19]#11585L, MS[20]#11586L, MS[21]#11587L, MS[22]#11588L, MS[23]#11589L, MS[24]#11590L, MS[25]#11591L, MS[26]#11592L, MS[27]#11593L, MS[28]#11594L, MS[29]#11595L, MS[30]#11596L, MS[31]#11597L, MS[32]#11598L, MS[33]#11599L, MS[34]#11600L, MS[35]#11601L, MS[36]#11602L, MS[37]#11603L, MS[38]#11604L, MS[39]#11605L, MS[40]#11606L, MS[41]#11607L, MS[42]#11608L, MS[43]#11609L, MS[44]#11610L, MS[45]#11611L, MS[46]#11612L, MS[47]#11613L, MS[48]#11614L, MS[49]#11615L, MS[50]#11616L, MS[51]#11617L, sum#11732L, sum#11733, sum#11734, count#11735L]
Arguments: hashpartitioning(segment#11499, processing_day#11501, 200), ENSURE_REQUIREMENTS, [plan_id=1102]
(16) HashAggregate
Input [59]: [segment#11499, processing_day#11501, count#11731L, MS[0]#11566L, MS[1]#11567L, MS[2]#11568L, MS[3]#11569L, MS[4]#11570L, MS[5]#11571L, MS[6]#11572L, MS[7]#11573L, MS[8]#11574L, MS[9]#11575L, MS[10]#11576L, MS[11]#11577L, MS[12]#11578L, MS[13]#11579L, MS[14]#11580L, MS[15]#11581L, MS[16]#11582L, MS[17]#11583L, MS[18]#11584L, MS[19]#11585L, MS[20]#11586L, MS[21]#11587L, MS[22]#11588L, MS[23]#11589L, MS[24]#11590L, MS[25]#11591L, MS[26]#11592L, MS[27]#11593L, MS[28]#11594L, MS[29]#11595L, MS[30]#11596L, MS[31]#11597L, MS[32]#11598L, MS[33]#11599L, MS[34]#11600L, MS[35]#11601L, MS[36]#11602L, MS[37]#11603L, MS[38]#11604L, MS[39]#11605L, MS[40]#11606L, MS[41]#11607L, MS[42]#11608L, MS[43]#11609L, MS[44]#11610L, MS[45]#11611L, MS[46]#11612L, MS[47]#11613L, MS[48]#11614L, MS[49]#11615L, MS[50]#11616L, MS[51]#11617L, sum#11732L, sum#11733, sum#11734, count#11735L]
Keys [2]: [segment#11499, processing_day#11501]
Functions [5]: [count(1), approx_count_distinct(customer_id#11495L, 0.05, 0, 0), sum(events#11505), sum(weighted_amount#11507), avg(amount#11503)]
Aggregate Attributes [5]: [count(1)#11513L, approx_count_distinct(customer_id#11495L, 0.05, 0, 0)#11618L, sum(events#11505)#11619L, sum(weighted_amount#11507)#11620, avg(amount#11503)#11621]
Results [7]: [segment#11499, processing_day#11501, count(1)#11513L AS row_count#11508L, approx_count_distinct(customer_id#11495L, 0.05, 0, 0)#11618L AS unique_customers#11509L, sum(events#11505)#11619L AS event_sum#11510L, sum(weighted_amount#11507)#11620 AS weighted_amount_sum#11511, avg(amount#11503)#11621 AS avg_amount#11512]
(17) Exchange
Input [7]: [segment#11499, processing_day#11501, row_count#11508L, unique_customers#11509L, event_sum#11510L, weighted_amount_sum#11511, avg_amount#11512]
Arguments: rangepartitioning(segment#11499 ASC NULLS FIRST, processing_day#11501 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1105]
(18) Sort
Input [7]: [segment#11499, processing_day#11501, row_count#11508L, unique_customers#11509L, event_sum#11510L, weighted_amount_sum#11511, avg_amount#11512]
Arguments: [segment#11499 ASC NULLS FIRST, processing_day#11501 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#11499, processing_day#11501, row_count#11508L, unique_customers#11509L, event_sum#11510L, weighted_amount_sum#11511, avg_amount#11512]
Arguments: isFinalPlan=true