== 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#103567L]
Arguments: Range (21000000, 22000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#103567L % 250000) AS customer_id#103569L, concat(segment-, cast(cast((id#103567L % 12) as int) as string)) AS segment#103573, cast((id#103567L % 14) as int) AS processing_day#103575, ((cast(((id#103567L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#103577, cast((((id#103567L * 29) % 7) + 1) as int) AS events#103579]
Input [1]: [id#103567L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#103569L, segment#103573, processing_day#103575, amount#103577, events#103579, (amount#103577 * cast(events#103579 as double)) AS weighted_amount#103581]
Input [5]: [customer_id#103569L, segment#103573, processing_day#103575, amount#103577, events#103579]
(4) HashAggregate
Input [6]: [customer_id#103569L, segment#103573, processing_day#103575, amount#103577, events#103579, weighted_amount#103581]
Keys [2]: [segment#103573, processing_day#103575]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#103569L, 0.05, 0, 0), partial_sum(events#103579), partial_sum(weighted_amount#103581), partial_avg(amount#103577)]
Aggregate Attributes [57]: [count#103800L, MS[0]#103588L, MS[1]#103589L, MS[2]#103590L, MS[3]#103591L, MS[4]#103592L, MS[5]#103593L, MS[6]#103594L, MS[7]#103595L, MS[8]#103596L, MS[9]#103597L, MS[10]#103598L, MS[11]#103599L, MS[12]#103600L, MS[13]#103601L, MS[14]#103602L, MS[15]#103603L, MS[16]#103604L, MS[17]#103605L, MS[18]#103606L, MS[19]#103607L, MS[20]#103608L, MS[21]#103609L, MS[22]#103610L, MS[23]#103611L, MS[24]#103612L, MS[25]#103613L, MS[26]#103614L, MS[27]#103615L, MS[28]#103616L, MS[29]#103617L, MS[30]#103618L, MS[31]#103619L, MS[32]#103620L, MS[33]#103621L, MS[34]#103622L, MS[35]#103623L, MS[36]#103624L, MS[37]#103625L, MS[38]#103626L, MS[39]#103627L, MS[40]#103628L, MS[41]#103629L, MS[42]#103630L, MS[43]#103631L, MS[44]#103632L, MS[45]#103633L, MS[46]#103634L, MS[47]#103635L, MS[48]#103636L, MS[49]#103637L, MS[50]#103638L, MS[51]#103639L, sum#103801L, sum#103802, sum#103803, count#103804L]
Results [59]: [segment#103573, processing_day#103575, count#103805L, MS[0]#103640L, MS[1]#103641L, MS[2]#103642L, MS[3]#103643L, MS[4]#103644L, MS[5]#103645L, MS[6]#103646L, MS[7]#103647L, MS[8]#103648L, MS[9]#103649L, MS[10]#103650L, MS[11]#103651L, MS[12]#103652L, MS[13]#103653L, MS[14]#103654L, MS[15]#103655L, MS[16]#103656L, MS[17]#103657L, MS[18]#103658L, MS[19]#103659L, MS[20]#103660L, MS[21]#103661L, MS[22]#103662L, MS[23]#103663L, MS[24]#103664L, MS[25]#103665L, MS[26]#103666L, MS[27]#103667L, MS[28]#103668L, MS[29]#103669L, MS[30]#103670L, MS[31]#103671L, MS[32]#103672L, MS[33]#103673L, MS[34]#103674L, MS[35]#103675L, MS[36]#103676L, MS[37]#103677L, MS[38]#103678L, MS[39]#103679L, MS[40]#103680L, MS[41]#103681L, MS[42]#103682L, MS[43]#103683L, MS[44]#103684L, MS[45]#103685L, MS[46]#103686L, MS[47]#103687L, MS[48]#103688L, MS[49]#103689L, MS[50]#103690L, MS[51]#103691L, sum#103806L, sum#103807, sum#103808, count#103809L]
(5) Exchange
Input [59]: [segment#103573, processing_day#103575, count#103805L, MS[0]#103640L, MS[1]#103641L, MS[2]#103642L, MS[3]#103643L, MS[4]#103644L, MS[5]#103645L, MS[6]#103646L, MS[7]#103647L, MS[8]#103648L, MS[9]#103649L, MS[10]#103650L, MS[11]#103651L, MS[12]#103652L, MS[13]#103653L, MS[14]#103654L, MS[15]#103655L, MS[16]#103656L, MS[17]#103657L, MS[18]#103658L, MS[19]#103659L, MS[20]#103660L, MS[21]#103661L, MS[22]#103662L, MS[23]#103663L, MS[24]#103664L, MS[25]#103665L, MS[26]#103666L, MS[27]#103667L, MS[28]#103668L, MS[29]#103669L, MS[30]#103670L, MS[31]#103671L, MS[32]#103672L, MS[33]#103673L, MS[34]#103674L, MS[35]#103675L, MS[36]#103676L, MS[37]#103677L, MS[38]#103678L, MS[39]#103679L, MS[40]#103680L, MS[41]#103681L, MS[42]#103682L, MS[43]#103683L, MS[44]#103684L, MS[45]#103685L, MS[46]#103686L, MS[47]#103687L, MS[48]#103688L, MS[49]#103689L, MS[50]#103690L, MS[51]#103691L, sum#103806L, sum#103807, sum#103808, count#103809L]
Arguments: hashpartitioning(segment#103573, processing_day#103575, 200), ENSURE_REQUIREMENTS, [plan_id=9778]
(6) ShuffleQueryStage
Output [59]: [segment#103573, processing_day#103575, count#103805L, MS[0]#103640L, MS[1]#103641L, MS[2]#103642L, MS[3]#103643L, MS[4]#103644L, MS[5]#103645L, MS[6]#103646L, MS[7]#103647L, MS[8]#103648L, MS[9]#103649L, MS[10]#103650L, MS[11]#103651L, MS[12]#103652L, MS[13]#103653L, MS[14]#103654L, MS[15]#103655L, MS[16]#103656L, MS[17]#103657L, MS[18]#103658L, MS[19]#103659L, MS[20]#103660L, MS[21]#103661L, MS[22]#103662L, MS[23]#103663L, MS[24]#103664L, MS[25]#103665L, MS[26]#103666L, MS[27]#103667L, MS[28]#103668L, MS[29]#103669L, MS[30]#103670L, MS[31]#103671L, MS[32]#103672L, MS[33]#103673L, MS[34]#103674L, MS[35]#103675L, MS[36]#103676L, MS[37]#103677L, MS[38]#103678L, MS[39]#103679L, MS[40]#103680L, MS[41]#103681L, MS[42]#103682L, MS[43]#103683L, MS[44]#103684L, MS[45]#103685L, MS[46]#103686L, MS[47]#103687L, MS[48]#103688L, MS[49]#103689L, MS[50]#103690L, MS[51]#103691L, sum#103806L, sum#103807, sum#103808, count#103809L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#103573, processing_day#103575, count#103805L, MS[0]#103640L, MS[1]#103641L, MS[2]#103642L, MS[3]#103643L, MS[4]#103644L, MS[5]#103645L, MS[6]#103646L, MS[7]#103647L, MS[8]#103648L, MS[9]#103649L, MS[10]#103650L, MS[11]#103651L, MS[12]#103652L, MS[13]#103653L, MS[14]#103654L, MS[15]#103655L, MS[16]#103656L, MS[17]#103657L, MS[18]#103658L, MS[19]#103659L, MS[20]#103660L, MS[21]#103661L, MS[22]#103662L, MS[23]#103663L, MS[24]#103664L, MS[25]#103665L, MS[26]#103666L, MS[27]#103667L, MS[28]#103668L, MS[29]#103669L, MS[30]#103670L, MS[31]#103671L, MS[32]#103672L, MS[33]#103673L, MS[34]#103674L, MS[35]#103675L, MS[36]#103676L, MS[37]#103677L, MS[38]#103678L, MS[39]#103679L, MS[40]#103680L, MS[41]#103681L, MS[42]#103682L, MS[43]#103683L, MS[44]#103684L, MS[45]#103685L, MS[46]#103686L, MS[47]#103687L, MS[48]#103688L, MS[49]#103689L, MS[50]#103690L, MS[51]#103691L, sum#103806L, sum#103807, sum#103808, count#103809L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#103573, processing_day#103575, count#103805L, MS[0]#103640L, MS[1]#103641L, MS[2]#103642L, MS[3]#103643L, MS[4]#103644L, MS[5]#103645L, MS[6]#103646L, MS[7]#103647L, MS[8]#103648L, MS[9]#103649L, MS[10]#103650L, MS[11]#103651L, MS[12]#103652L, MS[13]#103653L, MS[14]#103654L, MS[15]#103655L, MS[16]#103656L, MS[17]#103657L, MS[18]#103658L, MS[19]#103659L, MS[20]#103660L, MS[21]#103661L, MS[22]#103662L, MS[23]#103663L, MS[24]#103664L, MS[25]#103665L, MS[26]#103666L, MS[27]#103667L, MS[28]#103668L, MS[29]#103669L, MS[30]#103670L, MS[31]#103671L, MS[32]#103672L, MS[33]#103673L, MS[34]#103674L, MS[35]#103675L, MS[36]#103676L, MS[37]#103677L, MS[38]#103678L, MS[39]#103679L, MS[40]#103680L, MS[41]#103681L, MS[42]#103682L, MS[43]#103683L, MS[44]#103684L, MS[45]#103685L, MS[46]#103686L, MS[47]#103687L, MS[48]#103688L, MS[49]#103689L, MS[50]#103690L, MS[51]#103691L, sum#103806L, sum#103807, sum#103808, count#103809L]
Keys [2]: [segment#103573, processing_day#103575]
Functions [5]: [count(1), approx_count_distinct(customer_id#103569L, 0.05, 0, 0), sum(events#103579), sum(weighted_amount#103581), avg(amount#103577)]
Aggregate Attributes [5]: [count(1)#103587L, approx_count_distinct(customer_id#103569L, 0.05, 0, 0)#103692L, sum(events#103579)#103693L, sum(weighted_amount#103581)#103694, avg(amount#103577)#103695]
Results [7]: [segment#103573, processing_day#103575, count(1)#103587L AS row_count#103582L, approx_count_distinct(customer_id#103569L, 0.05, 0, 0)#103692L AS unique_customers#103583L, sum(events#103579)#103693L AS event_sum#103584L, sum(weighted_amount#103581)#103694 AS weighted_amount_sum#103585, avg(amount#103577)#103695 AS avg_amount#103586]
(9) Exchange
Input [7]: [segment#103573, processing_day#103575, row_count#103582L, unique_customers#103583L, event_sum#103584L, weighted_amount_sum#103585, avg_amount#103586]
Arguments: rangepartitioning(segment#103573 ASC NULLS FIRST, processing_day#103575 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9800]
(10) ShuffleQueryStage
Output [7]: [segment#103573, processing_day#103575, row_count#103582L, unique_customers#103583L, event_sum#103584L, weighted_amount_sum#103585, avg_amount#103586]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#103573, processing_day#103575, row_count#103582L, unique_customers#103583L, event_sum#103584L, weighted_amount_sum#103585, avg_amount#103586]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#103573, processing_day#103575, row_count#103582L, unique_customers#103583L, event_sum#103584L, weighted_amount_sum#103585, avg_amount#103586]
Arguments: [segment#103573 ASC NULLS FIRST, processing_day#103575 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#103573, processing_day#103575, row_count#103582L, unique_customers#103583L, event_sum#103584L, weighted_amount_sum#103585, avg_amount#103586]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#103569L, segment#103573, processing_day#103575, amount#103577, events#103579, weighted_amount#103581]
Keys [2]: [segment#103573, processing_day#103575]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#103569L, 0.05, 0, 0), partial_sum(events#103579), partial_sum(weighted_amount#103581), partial_avg(amount#103577)]
Aggregate Attributes [57]: [count#103800L, MS[0]#103588L, MS[1]#103589L, MS[2]#103590L, MS[3]#103591L, MS[4]#103592L, MS[5]#103593L, MS[6]#103594L, MS[7]#103595L, MS[8]#103596L, MS[9]#103597L, MS[10]#103598L, MS[11]#103599L, MS[12]#103600L, MS[13]#103601L, MS[14]#103602L, MS[15]#103603L, MS[16]#103604L, MS[17]#103605L, MS[18]#103606L, MS[19]#103607L, MS[20]#103608L, MS[21]#103609L, MS[22]#103610L, MS[23]#103611L, MS[24]#103612L, MS[25]#103613L, MS[26]#103614L, MS[27]#103615L, MS[28]#103616L, MS[29]#103617L, MS[30]#103618L, MS[31]#103619L, MS[32]#103620L, MS[33]#103621L, MS[34]#103622L, MS[35]#103623L, MS[36]#103624L, MS[37]#103625L, MS[38]#103626L, MS[39]#103627L, MS[40]#103628L, MS[41]#103629L, MS[42]#103630L, MS[43]#103631L, MS[44]#103632L, MS[45]#103633L, MS[46]#103634L, MS[47]#103635L, MS[48]#103636L, MS[49]#103637L, MS[50]#103638L, MS[51]#103639L, sum#103801L, sum#103802, sum#103803, count#103804L]
Results [59]: [segment#103573, processing_day#103575, count#103805L, MS[0]#103640L, MS[1]#103641L, MS[2]#103642L, MS[3]#103643L, MS[4]#103644L, MS[5]#103645L, MS[6]#103646L, MS[7]#103647L, MS[8]#103648L, MS[9]#103649L, MS[10]#103650L, MS[11]#103651L, MS[12]#103652L, MS[13]#103653L, MS[14]#103654L, MS[15]#103655L, MS[16]#103656L, MS[17]#103657L, MS[18]#103658L, MS[19]#103659L, MS[20]#103660L, MS[21]#103661L, MS[22]#103662L, MS[23]#103663L, MS[24]#103664L, MS[25]#103665L, MS[26]#103666L, MS[27]#103667L, MS[28]#103668L, MS[29]#103669L, MS[30]#103670L, MS[31]#103671L, MS[32]#103672L, MS[33]#103673L, MS[34]#103674L, MS[35]#103675L, MS[36]#103676L, MS[37]#103677L, MS[38]#103678L, MS[39]#103679L, MS[40]#103680L, MS[41]#103681L, MS[42]#103682L, MS[43]#103683L, MS[44]#103684L, MS[45]#103685L, MS[46]#103686L, MS[47]#103687L, MS[48]#103688L, MS[49]#103689L, MS[50]#103690L, MS[51]#103691L, sum#103806L, sum#103807, sum#103808, count#103809L]
(15) Exchange
Input [59]: [segment#103573, processing_day#103575, count#103805L, MS[0]#103640L, MS[1]#103641L, MS[2]#103642L, MS[3]#103643L, MS[4]#103644L, MS[5]#103645L, MS[6]#103646L, MS[7]#103647L, MS[8]#103648L, MS[9]#103649L, MS[10]#103650L, MS[11]#103651L, MS[12]#103652L, MS[13]#103653L, MS[14]#103654L, MS[15]#103655L, MS[16]#103656L, MS[17]#103657L, MS[18]#103658L, MS[19]#103659L, MS[20]#103660L, MS[21]#103661L, MS[22]#103662L, MS[23]#103663L, MS[24]#103664L, MS[25]#103665L, MS[26]#103666L, MS[27]#103667L, MS[28]#103668L, MS[29]#103669L, MS[30]#103670L, MS[31]#103671L, MS[32]#103672L, MS[33]#103673L, MS[34]#103674L, MS[35]#103675L, MS[36]#103676L, MS[37]#103677L, MS[38]#103678L, MS[39]#103679L, MS[40]#103680L, MS[41]#103681L, MS[42]#103682L, MS[43]#103683L, MS[44]#103684L, MS[45]#103685L, MS[46]#103686L, MS[47]#103687L, MS[48]#103688L, MS[49]#103689L, MS[50]#103690L, MS[51]#103691L, sum#103806L, sum#103807, sum#103808, count#103809L]
Arguments: hashpartitioning(segment#103573, processing_day#103575, 200), ENSURE_REQUIREMENTS, [plan_id=9758]
(16) HashAggregate
Input [59]: [segment#103573, processing_day#103575, count#103805L, MS[0]#103640L, MS[1]#103641L, MS[2]#103642L, MS[3]#103643L, MS[4]#103644L, MS[5]#103645L, MS[6]#103646L, MS[7]#103647L, MS[8]#103648L, MS[9]#103649L, MS[10]#103650L, MS[11]#103651L, MS[12]#103652L, MS[13]#103653L, MS[14]#103654L, MS[15]#103655L, MS[16]#103656L, MS[17]#103657L, MS[18]#103658L, MS[19]#103659L, MS[20]#103660L, MS[21]#103661L, MS[22]#103662L, MS[23]#103663L, MS[24]#103664L, MS[25]#103665L, MS[26]#103666L, MS[27]#103667L, MS[28]#103668L, MS[29]#103669L, MS[30]#103670L, MS[31]#103671L, MS[32]#103672L, MS[33]#103673L, MS[34]#103674L, MS[35]#103675L, MS[36]#103676L, MS[37]#103677L, MS[38]#103678L, MS[39]#103679L, MS[40]#103680L, MS[41]#103681L, MS[42]#103682L, MS[43]#103683L, MS[44]#103684L, MS[45]#103685L, MS[46]#103686L, MS[47]#103687L, MS[48]#103688L, MS[49]#103689L, MS[50]#103690L, MS[51]#103691L, sum#103806L, sum#103807, sum#103808, count#103809L]
Keys [2]: [segment#103573, processing_day#103575]
Functions [5]: [count(1), approx_count_distinct(customer_id#103569L, 0.05, 0, 0), sum(events#103579), sum(weighted_amount#103581), avg(amount#103577)]
Aggregate Attributes [5]: [count(1)#103587L, approx_count_distinct(customer_id#103569L, 0.05, 0, 0)#103692L, sum(events#103579)#103693L, sum(weighted_amount#103581)#103694, avg(amount#103577)#103695]
Results [7]: [segment#103573, processing_day#103575, count(1)#103587L AS row_count#103582L, approx_count_distinct(customer_id#103569L, 0.05, 0, 0)#103692L AS unique_customers#103583L, sum(events#103579)#103693L AS event_sum#103584L, sum(weighted_amount#103581)#103694 AS weighted_amount_sum#103585, avg(amount#103577)#103695 AS avg_amount#103586]
(17) Exchange
Input [7]: [segment#103573, processing_day#103575, row_count#103582L, unique_customers#103583L, event_sum#103584L, weighted_amount_sum#103585, avg_amount#103586]
Arguments: rangepartitioning(segment#103573 ASC NULLS FIRST, processing_day#103575 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9761]
(18) Sort
Input [7]: [segment#103573, processing_day#103575, row_count#103582L, unique_customers#103583L, event_sum#103584L, weighted_amount_sum#103585, avg_amount#103586]
Arguments: [segment#103573 ASC NULLS FIRST, processing_day#103575 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#103573, processing_day#103575, row_count#103582L, unique_customers#103583L, event_sum#103584L, weighted_amount_sum#103585, avg_amount#103586]
Arguments: isFinalPlan=true