== 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#37165L]
Arguments: Range (18000000, 19000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#37165L % 250000) AS customer_id#37167L, concat(segment-, cast(cast((id#37165L % 12) as int) as string)) AS segment#37171, cast((id#37165L % 14) as int) AS processing_day#37173, ((cast(((id#37165L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#37175, cast((((id#37165L * 29) % 7) + 1) as int) AS events#37177]
Input [1]: [id#37165L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#37167L, segment#37171, processing_day#37173, amount#37175, events#37177, (amount#37175 * cast(events#37177 as double)) AS weighted_amount#37179]
Input [5]: [customer_id#37167L, segment#37171, processing_day#37173, amount#37175, events#37177]
(4) HashAggregate
Input [6]: [customer_id#37167L, segment#37171, processing_day#37173, amount#37175, events#37177, weighted_amount#37179]
Keys [2]: [segment#37171, processing_day#37173]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#37167L, 0.05, 0, 0), partial_sum(events#37177), partial_sum(weighted_amount#37179), partial_avg(amount#37175)]
Aggregate Attributes [57]: [count#37398L, MS[0]#37186L, MS[1]#37187L, MS[2]#37188L, MS[3]#37189L, MS[4]#37190L, MS[5]#37191L, MS[6]#37192L, MS[7]#37193L, MS[8]#37194L, MS[9]#37195L, MS[10]#37196L, MS[11]#37197L, MS[12]#37198L, MS[13]#37199L, MS[14]#37200L, MS[15]#37201L, MS[16]#37202L, MS[17]#37203L, MS[18]#37204L, MS[19]#37205L, MS[20]#37206L, MS[21]#37207L, MS[22]#37208L, MS[23]#37209L, MS[24]#37210L, MS[25]#37211L, MS[26]#37212L, MS[27]#37213L, MS[28]#37214L, MS[29]#37215L, MS[30]#37216L, MS[31]#37217L, MS[32]#37218L, MS[33]#37219L, MS[34]#37220L, MS[35]#37221L, MS[36]#37222L, MS[37]#37223L, MS[38]#37224L, MS[39]#37225L, MS[40]#37226L, MS[41]#37227L, MS[42]#37228L, MS[43]#37229L, MS[44]#37230L, MS[45]#37231L, MS[46]#37232L, MS[47]#37233L, MS[48]#37234L, MS[49]#37235L, MS[50]#37236L, MS[51]#37237L, sum#37399L, sum#37400, sum#37401, count#37402L]
Results [59]: [segment#37171, processing_day#37173, count#37403L, MS[0]#37238L, MS[1]#37239L, MS[2]#37240L, MS[3]#37241L, MS[4]#37242L, MS[5]#37243L, MS[6]#37244L, MS[7]#37245L, MS[8]#37246L, MS[9]#37247L, MS[10]#37248L, MS[11]#37249L, MS[12]#37250L, MS[13]#37251L, MS[14]#37252L, MS[15]#37253L, MS[16]#37254L, MS[17]#37255L, MS[18]#37256L, MS[19]#37257L, MS[20]#37258L, MS[21]#37259L, MS[22]#37260L, MS[23]#37261L, MS[24]#37262L, MS[25]#37263L, MS[26]#37264L, MS[27]#37265L, MS[28]#37266L, MS[29]#37267L, MS[30]#37268L, MS[31]#37269L, MS[32]#37270L, MS[33]#37271L, MS[34]#37272L, MS[35]#37273L, MS[36]#37274L, MS[37]#37275L, MS[38]#37276L, MS[39]#37277L, MS[40]#37278L, MS[41]#37279L, MS[42]#37280L, MS[43]#37281L, MS[44]#37282L, MS[45]#37283L, MS[46]#37284L, MS[47]#37285L, MS[48]#37286L, MS[49]#37287L, MS[50]#37288L, MS[51]#37289L, sum#37404L, sum#37405, sum#37406, count#37407L]
(5) Exchange
Input [59]: [segment#37171, processing_day#37173, count#37403L, MS[0]#37238L, MS[1]#37239L, MS[2]#37240L, MS[3]#37241L, MS[4]#37242L, MS[5]#37243L, MS[6]#37244L, MS[7]#37245L, MS[8]#37246L, MS[9]#37247L, MS[10]#37248L, MS[11]#37249L, MS[12]#37250L, MS[13]#37251L, MS[14]#37252L, MS[15]#37253L, MS[16]#37254L, MS[17]#37255L, MS[18]#37256L, MS[19]#37257L, MS[20]#37258L, MS[21]#37259L, MS[22]#37260L, MS[23]#37261L, MS[24]#37262L, MS[25]#37263L, MS[26]#37264L, MS[27]#37265L, MS[28]#37266L, MS[29]#37267L, MS[30]#37268L, MS[31]#37269L, MS[32]#37270L, MS[33]#37271L, MS[34]#37272L, MS[35]#37273L, MS[36]#37274L, MS[37]#37275L, MS[38]#37276L, MS[39]#37277L, MS[40]#37278L, MS[41]#37279L, MS[42]#37280L, MS[43]#37281L, MS[44]#37282L, MS[45]#37283L, MS[46]#37284L, MS[47]#37285L, MS[48]#37286L, MS[49]#37287L, MS[50]#37288L, MS[51]#37289L, sum#37404L, sum#37405, sum#37406, count#37407L]
Arguments: hashpartitioning(segment#37171, processing_day#37173, 200), ENSURE_REQUIREMENTS, [plan_id=3535]
(6) ShuffleQueryStage
Output [59]: [segment#37171, processing_day#37173, count#37403L, MS[0]#37238L, MS[1]#37239L, MS[2]#37240L, MS[3]#37241L, MS[4]#37242L, MS[5]#37243L, MS[6]#37244L, MS[7]#37245L, MS[8]#37246L, MS[9]#37247L, MS[10]#37248L, MS[11]#37249L, MS[12]#37250L, MS[13]#37251L, MS[14]#37252L, MS[15]#37253L, MS[16]#37254L, MS[17]#37255L, MS[18]#37256L, MS[19]#37257L, MS[20]#37258L, MS[21]#37259L, MS[22]#37260L, MS[23]#37261L, MS[24]#37262L, MS[25]#37263L, MS[26]#37264L, MS[27]#37265L, MS[28]#37266L, MS[29]#37267L, MS[30]#37268L, MS[31]#37269L, MS[32]#37270L, MS[33]#37271L, MS[34]#37272L, MS[35]#37273L, MS[36]#37274L, MS[37]#37275L, MS[38]#37276L, MS[39]#37277L, MS[40]#37278L, MS[41]#37279L, MS[42]#37280L, MS[43]#37281L, MS[44]#37282L, MS[45]#37283L, MS[46]#37284L, MS[47]#37285L, MS[48]#37286L, MS[49]#37287L, MS[50]#37288L, MS[51]#37289L, sum#37404L, sum#37405, sum#37406, count#37407L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#37171, processing_day#37173, count#37403L, MS[0]#37238L, MS[1]#37239L, MS[2]#37240L, MS[3]#37241L, MS[4]#37242L, MS[5]#37243L, MS[6]#37244L, MS[7]#37245L, MS[8]#37246L, MS[9]#37247L, MS[10]#37248L, MS[11]#37249L, MS[12]#37250L, MS[13]#37251L, MS[14]#37252L, MS[15]#37253L, MS[16]#37254L, MS[17]#37255L, MS[18]#37256L, MS[19]#37257L, MS[20]#37258L, MS[21]#37259L, MS[22]#37260L, MS[23]#37261L, MS[24]#37262L, MS[25]#37263L, MS[26]#37264L, MS[27]#37265L, MS[28]#37266L, MS[29]#37267L, MS[30]#37268L, MS[31]#37269L, MS[32]#37270L, MS[33]#37271L, MS[34]#37272L, MS[35]#37273L, MS[36]#37274L, MS[37]#37275L, MS[38]#37276L, MS[39]#37277L, MS[40]#37278L, MS[41]#37279L, MS[42]#37280L, MS[43]#37281L, MS[44]#37282L, MS[45]#37283L, MS[46]#37284L, MS[47]#37285L, MS[48]#37286L, MS[49]#37287L, MS[50]#37288L, MS[51]#37289L, sum#37404L, sum#37405, sum#37406, count#37407L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#37171, processing_day#37173, count#37403L, MS[0]#37238L, MS[1]#37239L, MS[2]#37240L, MS[3]#37241L, MS[4]#37242L, MS[5]#37243L, MS[6]#37244L, MS[7]#37245L, MS[8]#37246L, MS[9]#37247L, MS[10]#37248L, MS[11]#37249L, MS[12]#37250L, MS[13]#37251L, MS[14]#37252L, MS[15]#37253L, MS[16]#37254L, MS[17]#37255L, MS[18]#37256L, MS[19]#37257L, MS[20]#37258L, MS[21]#37259L, MS[22]#37260L, MS[23]#37261L, MS[24]#37262L, MS[25]#37263L, MS[26]#37264L, MS[27]#37265L, MS[28]#37266L, MS[29]#37267L, MS[30]#37268L, MS[31]#37269L, MS[32]#37270L, MS[33]#37271L, MS[34]#37272L, MS[35]#37273L, MS[36]#37274L, MS[37]#37275L, MS[38]#37276L, MS[39]#37277L, MS[40]#37278L, MS[41]#37279L, MS[42]#37280L, MS[43]#37281L, MS[44]#37282L, MS[45]#37283L, MS[46]#37284L, MS[47]#37285L, MS[48]#37286L, MS[49]#37287L, MS[50]#37288L, MS[51]#37289L, sum#37404L, sum#37405, sum#37406, count#37407L]
Keys [2]: [segment#37171, processing_day#37173]
Functions [5]: [count(1), approx_count_distinct(customer_id#37167L, 0.05, 0, 0), sum(events#37177), sum(weighted_amount#37179), avg(amount#37175)]
Aggregate Attributes [5]: [count(1)#37185L, approx_count_distinct(customer_id#37167L, 0.05, 0, 0)#37290L, sum(events#37177)#37291L, sum(weighted_amount#37179)#37292, avg(amount#37175)#37293]
Results [7]: [segment#37171, processing_day#37173, count(1)#37185L AS row_count#37180L, approx_count_distinct(customer_id#37167L, 0.05, 0, 0)#37290L AS unique_customers#37181L, sum(events#37177)#37291L AS event_sum#37182L, sum(weighted_amount#37179)#37292 AS weighted_amount_sum#37183, avg(amount#37175)#37293 AS avg_amount#37184]
(9) Exchange
Input [7]: [segment#37171, processing_day#37173, row_count#37180L, unique_customers#37181L, event_sum#37182L, weighted_amount_sum#37183, avg_amount#37184]
Arguments: rangepartitioning(segment#37171 ASC NULLS FIRST, processing_day#37173 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3557]
(10) ShuffleQueryStage
Output [7]: [segment#37171, processing_day#37173, row_count#37180L, unique_customers#37181L, event_sum#37182L, weighted_amount_sum#37183, avg_amount#37184]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#37171, processing_day#37173, row_count#37180L, unique_customers#37181L, event_sum#37182L, weighted_amount_sum#37183, avg_amount#37184]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#37171, processing_day#37173, row_count#37180L, unique_customers#37181L, event_sum#37182L, weighted_amount_sum#37183, avg_amount#37184]
Arguments: [segment#37171 ASC NULLS FIRST, processing_day#37173 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#37171, processing_day#37173, row_count#37180L, unique_customers#37181L, event_sum#37182L, weighted_amount_sum#37183, avg_amount#37184]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#37167L, segment#37171, processing_day#37173, amount#37175, events#37177, weighted_amount#37179]
Keys [2]: [segment#37171, processing_day#37173]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#37167L, 0.05, 0, 0), partial_sum(events#37177), partial_sum(weighted_amount#37179), partial_avg(amount#37175)]
Aggregate Attributes [57]: [count#37398L, MS[0]#37186L, MS[1]#37187L, MS[2]#37188L, MS[3]#37189L, MS[4]#37190L, MS[5]#37191L, MS[6]#37192L, MS[7]#37193L, MS[8]#37194L, MS[9]#37195L, MS[10]#37196L, MS[11]#37197L, MS[12]#37198L, MS[13]#37199L, MS[14]#37200L, MS[15]#37201L, MS[16]#37202L, MS[17]#37203L, MS[18]#37204L, MS[19]#37205L, MS[20]#37206L, MS[21]#37207L, MS[22]#37208L, MS[23]#37209L, MS[24]#37210L, MS[25]#37211L, MS[26]#37212L, MS[27]#37213L, MS[28]#37214L, MS[29]#37215L, MS[30]#37216L, MS[31]#37217L, MS[32]#37218L, MS[33]#37219L, MS[34]#37220L, MS[35]#37221L, MS[36]#37222L, MS[37]#37223L, MS[38]#37224L, MS[39]#37225L, MS[40]#37226L, MS[41]#37227L, MS[42]#37228L, MS[43]#37229L, MS[44]#37230L, MS[45]#37231L, MS[46]#37232L, MS[47]#37233L, MS[48]#37234L, MS[49]#37235L, MS[50]#37236L, MS[51]#37237L, sum#37399L, sum#37400, sum#37401, count#37402L]
Results [59]: [segment#37171, processing_day#37173, count#37403L, MS[0]#37238L, MS[1]#37239L, MS[2]#37240L, MS[3]#37241L, MS[4]#37242L, MS[5]#37243L, MS[6]#37244L, MS[7]#37245L, MS[8]#37246L, MS[9]#37247L, MS[10]#37248L, MS[11]#37249L, MS[12]#37250L, MS[13]#37251L, MS[14]#37252L, MS[15]#37253L, MS[16]#37254L, MS[17]#37255L, MS[18]#37256L, MS[19]#37257L, MS[20]#37258L, MS[21]#37259L, MS[22]#37260L, MS[23]#37261L, MS[24]#37262L, MS[25]#37263L, MS[26]#37264L, MS[27]#37265L, MS[28]#37266L, MS[29]#37267L, MS[30]#37268L, MS[31]#37269L, MS[32]#37270L, MS[33]#37271L, MS[34]#37272L, MS[35]#37273L, MS[36]#37274L, MS[37]#37275L, MS[38]#37276L, MS[39]#37277L, MS[40]#37278L, MS[41]#37279L, MS[42]#37280L, MS[43]#37281L, MS[44]#37282L, MS[45]#37283L, MS[46]#37284L, MS[47]#37285L, MS[48]#37286L, MS[49]#37287L, MS[50]#37288L, MS[51]#37289L, sum#37404L, sum#37405, sum#37406, count#37407L]
(15) Exchange
Input [59]: [segment#37171, processing_day#37173, count#37403L, MS[0]#37238L, MS[1]#37239L, MS[2]#37240L, MS[3]#37241L, MS[4]#37242L, MS[5]#37243L, MS[6]#37244L, MS[7]#37245L, MS[8]#37246L, MS[9]#37247L, MS[10]#37248L, MS[11]#37249L, MS[12]#37250L, MS[13]#37251L, MS[14]#37252L, MS[15]#37253L, MS[16]#37254L, MS[17]#37255L, MS[18]#37256L, MS[19]#37257L, MS[20]#37258L, MS[21]#37259L, MS[22]#37260L, MS[23]#37261L, MS[24]#37262L, MS[25]#37263L, MS[26]#37264L, MS[27]#37265L, MS[28]#37266L, MS[29]#37267L, MS[30]#37268L, MS[31]#37269L, MS[32]#37270L, MS[33]#37271L, MS[34]#37272L, MS[35]#37273L, MS[36]#37274L, MS[37]#37275L, MS[38]#37276L, MS[39]#37277L, MS[40]#37278L, MS[41]#37279L, MS[42]#37280L, MS[43]#37281L, MS[44]#37282L, MS[45]#37283L, MS[46]#37284L, MS[47]#37285L, MS[48]#37286L, MS[49]#37287L, MS[50]#37288L, MS[51]#37289L, sum#37404L, sum#37405, sum#37406, count#37407L]
Arguments: hashpartitioning(segment#37171, processing_day#37173, 200), ENSURE_REQUIREMENTS, [plan_id=3515]
(16) HashAggregate
Input [59]: [segment#37171, processing_day#37173, count#37403L, MS[0]#37238L, MS[1]#37239L, MS[2]#37240L, MS[3]#37241L, MS[4]#37242L, MS[5]#37243L, MS[6]#37244L, MS[7]#37245L, MS[8]#37246L, MS[9]#37247L, MS[10]#37248L, MS[11]#37249L, MS[12]#37250L, MS[13]#37251L, MS[14]#37252L, MS[15]#37253L, MS[16]#37254L, MS[17]#37255L, MS[18]#37256L, MS[19]#37257L, MS[20]#37258L, MS[21]#37259L, MS[22]#37260L, MS[23]#37261L, MS[24]#37262L, MS[25]#37263L, MS[26]#37264L, MS[27]#37265L, MS[28]#37266L, MS[29]#37267L, MS[30]#37268L, MS[31]#37269L, MS[32]#37270L, MS[33]#37271L, MS[34]#37272L, MS[35]#37273L, MS[36]#37274L, MS[37]#37275L, MS[38]#37276L, MS[39]#37277L, MS[40]#37278L, MS[41]#37279L, MS[42]#37280L, MS[43]#37281L, MS[44]#37282L, MS[45]#37283L, MS[46]#37284L, MS[47]#37285L, MS[48]#37286L, MS[49]#37287L, MS[50]#37288L, MS[51]#37289L, sum#37404L, sum#37405, sum#37406, count#37407L]
Keys [2]: [segment#37171, processing_day#37173]
Functions [5]: [count(1), approx_count_distinct(customer_id#37167L, 0.05, 0, 0), sum(events#37177), sum(weighted_amount#37179), avg(amount#37175)]
Aggregate Attributes [5]: [count(1)#37185L, approx_count_distinct(customer_id#37167L, 0.05, 0, 0)#37290L, sum(events#37177)#37291L, sum(weighted_amount#37179)#37292, avg(amount#37175)#37293]
Results [7]: [segment#37171, processing_day#37173, count(1)#37185L AS row_count#37180L, approx_count_distinct(customer_id#37167L, 0.05, 0, 0)#37290L AS unique_customers#37181L, sum(events#37177)#37291L AS event_sum#37182L, sum(weighted_amount#37179)#37292 AS weighted_amount_sum#37183, avg(amount#37175)#37293 AS avg_amount#37184]
(17) Exchange
Input [7]: [segment#37171, processing_day#37173, row_count#37180L, unique_customers#37181L, event_sum#37182L, weighted_amount_sum#37183, avg_amount#37184]
Arguments: rangepartitioning(segment#37171 ASC NULLS FIRST, processing_day#37173 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3518]
(18) Sort
Input [7]: [segment#37171, processing_day#37173, row_count#37180L, unique_customers#37181L, event_sum#37182L, weighted_amount_sum#37183, avg_amount#37184]
Arguments: [segment#37171 ASC NULLS FIRST, processing_day#37173 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#37171, processing_day#37173, row_count#37180L, unique_customers#37181L, event_sum#37182L, weighted_amount_sum#37183, avg_amount#37184]
Arguments: isFinalPlan=true