== 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#2653L]
Arguments: Range (3000000, 4000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#2653L % 250000) AS customer_id#2655L, concat(segment-, cast(cast((id#2653L % 12) as int) as string)) AS segment#2659, cast((id#2653L % 14) as int) AS processing_day#2661, ((cast(((id#2653L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#2663, cast((((id#2653L * 29) % 7) + 1) as int) AS events#2665]
Input [1]: [id#2653L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#2655L, segment#2659, processing_day#2661, amount#2663, events#2665, (amount#2663 * cast(events#2665 as double)) AS weighted_amount#2667]
Input [5]: [customer_id#2655L, segment#2659, processing_day#2661, amount#2663, events#2665]
(4) HashAggregate
Input [6]: [customer_id#2655L, segment#2659, processing_day#2661, amount#2663, events#2665, weighted_amount#2667]
Keys [2]: [segment#2659, processing_day#2661]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#2655L, 0.05, 0, 0), partial_sum(events#2665), partial_sum(weighted_amount#2667), partial_avg(amount#2663)]
Aggregate Attributes [57]: [count#2886L, MS[0]#2674L, MS[1]#2675L, MS[2]#2676L, MS[3]#2677L, MS[4]#2678L, MS[5]#2679L, MS[6]#2680L, MS[7]#2681L, MS[8]#2682L, MS[9]#2683L, MS[10]#2684L, MS[11]#2685L, MS[12]#2686L, MS[13]#2687L, MS[14]#2688L, MS[15]#2689L, MS[16]#2690L, MS[17]#2691L, MS[18]#2692L, MS[19]#2693L, MS[20]#2694L, MS[21]#2695L, MS[22]#2696L, MS[23]#2697L, MS[24]#2698L, MS[25]#2699L, MS[26]#2700L, MS[27]#2701L, MS[28]#2702L, MS[29]#2703L, MS[30]#2704L, MS[31]#2705L, MS[32]#2706L, MS[33]#2707L, MS[34]#2708L, MS[35]#2709L, MS[36]#2710L, MS[37]#2711L, MS[38]#2712L, MS[39]#2713L, MS[40]#2714L, MS[41]#2715L, MS[42]#2716L, MS[43]#2717L, MS[44]#2718L, MS[45]#2719L, MS[46]#2720L, MS[47]#2721L, MS[48]#2722L, MS[49]#2723L, MS[50]#2724L, MS[51]#2725L, sum#2887L, sum#2888, sum#2889, count#2890L]
Results [59]: [segment#2659, processing_day#2661, count#2891L, MS[0]#2726L, MS[1]#2727L, MS[2]#2728L, MS[3]#2729L, MS[4]#2730L, MS[5]#2731L, MS[6]#2732L, MS[7]#2733L, MS[8]#2734L, MS[9]#2735L, MS[10]#2736L, MS[11]#2737L, MS[12]#2738L, MS[13]#2739L, MS[14]#2740L, MS[15]#2741L, MS[16]#2742L, MS[17]#2743L, MS[18]#2744L, MS[19]#2745L, MS[20]#2746L, MS[21]#2747L, MS[22]#2748L, MS[23]#2749L, MS[24]#2750L, MS[25]#2751L, MS[26]#2752L, MS[27]#2753L, MS[28]#2754L, MS[29]#2755L, MS[30]#2756L, MS[31]#2757L, MS[32]#2758L, MS[33]#2759L, MS[34]#2760L, MS[35]#2761L, MS[36]#2762L, MS[37]#2763L, MS[38]#2764L, MS[39]#2765L, MS[40]#2766L, MS[41]#2767L, MS[42]#2768L, MS[43]#2769L, MS[44]#2770L, MS[45]#2771L, MS[46]#2772L, MS[47]#2773L, MS[48]#2774L, MS[49]#2775L, MS[50]#2776L, MS[51]#2777L, sum#2892L, sum#2893, sum#2894, count#2895L]
(5) Exchange
Input [59]: [segment#2659, processing_day#2661, count#2891L, MS[0]#2726L, MS[1]#2727L, MS[2]#2728L, MS[3]#2729L, MS[4]#2730L, MS[5]#2731L, MS[6]#2732L, MS[7]#2733L, MS[8]#2734L, MS[9]#2735L, MS[10]#2736L, MS[11]#2737L, MS[12]#2738L, MS[13]#2739L, MS[14]#2740L, MS[15]#2741L, MS[16]#2742L, MS[17]#2743L, MS[18]#2744L, MS[19]#2745L, MS[20]#2746L, MS[21]#2747L, MS[22]#2748L, MS[23]#2749L, MS[24]#2750L, MS[25]#2751L, MS[26]#2752L, MS[27]#2753L, MS[28]#2754L, MS[29]#2755L, MS[30]#2756L, MS[31]#2757L, MS[32]#2758L, MS[33]#2759L, MS[34]#2760L, MS[35]#2761L, MS[36]#2762L, MS[37]#2763L, MS[38]#2764L, MS[39]#2765L, MS[40]#2766L, MS[41]#2767L, MS[42]#2768L, MS[43]#2769L, MS[44]#2770L, MS[45]#2771L, MS[46]#2772L, MS[47]#2773L, MS[48]#2774L, MS[49]#2775L, MS[50]#2776L, MS[51]#2777L, sum#2892L, sum#2893, sum#2894, count#2895L]
Arguments: hashpartitioning(segment#2659, processing_day#2661, 200), ENSURE_REQUIREMENTS, [plan_id=292]
(6) ShuffleQueryStage
Output [59]: [segment#2659, processing_day#2661, count#2891L, MS[0]#2726L, MS[1]#2727L, MS[2]#2728L, MS[3]#2729L, MS[4]#2730L, MS[5]#2731L, MS[6]#2732L, MS[7]#2733L, MS[8]#2734L, MS[9]#2735L, MS[10]#2736L, MS[11]#2737L, MS[12]#2738L, MS[13]#2739L, MS[14]#2740L, MS[15]#2741L, MS[16]#2742L, MS[17]#2743L, MS[18]#2744L, MS[19]#2745L, MS[20]#2746L, MS[21]#2747L, MS[22]#2748L, MS[23]#2749L, MS[24]#2750L, MS[25]#2751L, MS[26]#2752L, MS[27]#2753L, MS[28]#2754L, MS[29]#2755L, MS[30]#2756L, MS[31]#2757L, MS[32]#2758L, MS[33]#2759L, MS[34]#2760L, MS[35]#2761L, MS[36]#2762L, MS[37]#2763L, MS[38]#2764L, MS[39]#2765L, MS[40]#2766L, MS[41]#2767L, MS[42]#2768L, MS[43]#2769L, MS[44]#2770L, MS[45]#2771L, MS[46]#2772L, MS[47]#2773L, MS[48]#2774L, MS[49]#2775L, MS[50]#2776L, MS[51]#2777L, sum#2892L, sum#2893, sum#2894, count#2895L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#2659, processing_day#2661, count#2891L, MS[0]#2726L, MS[1]#2727L, MS[2]#2728L, MS[3]#2729L, MS[4]#2730L, MS[5]#2731L, MS[6]#2732L, MS[7]#2733L, MS[8]#2734L, MS[9]#2735L, MS[10]#2736L, MS[11]#2737L, MS[12]#2738L, MS[13]#2739L, MS[14]#2740L, MS[15]#2741L, MS[16]#2742L, MS[17]#2743L, MS[18]#2744L, MS[19]#2745L, MS[20]#2746L, MS[21]#2747L, MS[22]#2748L, MS[23]#2749L, MS[24]#2750L, MS[25]#2751L, MS[26]#2752L, MS[27]#2753L, MS[28]#2754L, MS[29]#2755L, MS[30]#2756L, MS[31]#2757L, MS[32]#2758L, MS[33]#2759L, MS[34]#2760L, MS[35]#2761L, MS[36]#2762L, MS[37]#2763L, MS[38]#2764L, MS[39]#2765L, MS[40]#2766L, MS[41]#2767L, MS[42]#2768L, MS[43]#2769L, MS[44]#2770L, MS[45]#2771L, MS[46]#2772L, MS[47]#2773L, MS[48]#2774L, MS[49]#2775L, MS[50]#2776L, MS[51]#2777L, sum#2892L, sum#2893, sum#2894, count#2895L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#2659, processing_day#2661, count#2891L, MS[0]#2726L, MS[1]#2727L, MS[2]#2728L, MS[3]#2729L, MS[4]#2730L, MS[5]#2731L, MS[6]#2732L, MS[7]#2733L, MS[8]#2734L, MS[9]#2735L, MS[10]#2736L, MS[11]#2737L, MS[12]#2738L, MS[13]#2739L, MS[14]#2740L, MS[15]#2741L, MS[16]#2742L, MS[17]#2743L, MS[18]#2744L, MS[19]#2745L, MS[20]#2746L, MS[21]#2747L, MS[22]#2748L, MS[23]#2749L, MS[24]#2750L, MS[25]#2751L, MS[26]#2752L, MS[27]#2753L, MS[28]#2754L, MS[29]#2755L, MS[30]#2756L, MS[31]#2757L, MS[32]#2758L, MS[33]#2759L, MS[34]#2760L, MS[35]#2761L, MS[36]#2762L, MS[37]#2763L, MS[38]#2764L, MS[39]#2765L, MS[40]#2766L, MS[41]#2767L, MS[42]#2768L, MS[43]#2769L, MS[44]#2770L, MS[45]#2771L, MS[46]#2772L, MS[47]#2773L, MS[48]#2774L, MS[49]#2775L, MS[50]#2776L, MS[51]#2777L, sum#2892L, sum#2893, sum#2894, count#2895L]
Keys [2]: [segment#2659, processing_day#2661]
Functions [5]: [count(1), approx_count_distinct(customer_id#2655L, 0.05, 0, 0), sum(events#2665), sum(weighted_amount#2667), avg(amount#2663)]
Aggregate Attributes [5]: [count(1)#2673L, approx_count_distinct(customer_id#2655L, 0.05, 0, 0)#2778L, sum(events#2665)#2779L, sum(weighted_amount#2667)#2780, avg(amount#2663)#2781]
Results [7]: [segment#2659, processing_day#2661, count(1)#2673L AS row_count#2668L, approx_count_distinct(customer_id#2655L, 0.05, 0, 0)#2778L AS unique_customers#2669L, sum(events#2665)#2779L AS event_sum#2670L, sum(weighted_amount#2667)#2780 AS weighted_amount_sum#2671, avg(amount#2663)#2781 AS avg_amount#2672]
(9) Exchange
Input [7]: [segment#2659, processing_day#2661, row_count#2668L, unique_customers#2669L, event_sum#2670L, weighted_amount_sum#2671, avg_amount#2672]
Arguments: rangepartitioning(segment#2659 ASC NULLS FIRST, processing_day#2661 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=314]
(10) ShuffleQueryStage
Output [7]: [segment#2659, processing_day#2661, row_count#2668L, unique_customers#2669L, event_sum#2670L, weighted_amount_sum#2671, avg_amount#2672]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#2659, processing_day#2661, row_count#2668L, unique_customers#2669L, event_sum#2670L, weighted_amount_sum#2671, avg_amount#2672]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#2659, processing_day#2661, row_count#2668L, unique_customers#2669L, event_sum#2670L, weighted_amount_sum#2671, avg_amount#2672]
Arguments: [segment#2659 ASC NULLS FIRST, processing_day#2661 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#2659, processing_day#2661, row_count#2668L, unique_customers#2669L, event_sum#2670L, weighted_amount_sum#2671, avg_amount#2672]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#2655L, segment#2659, processing_day#2661, amount#2663, events#2665, weighted_amount#2667]
Keys [2]: [segment#2659, processing_day#2661]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#2655L, 0.05, 0, 0), partial_sum(events#2665), partial_sum(weighted_amount#2667), partial_avg(amount#2663)]
Aggregate Attributes [57]: [count#2886L, MS[0]#2674L, MS[1]#2675L, MS[2]#2676L, MS[3]#2677L, MS[4]#2678L, MS[5]#2679L, MS[6]#2680L, MS[7]#2681L, MS[8]#2682L, MS[9]#2683L, MS[10]#2684L, MS[11]#2685L, MS[12]#2686L, MS[13]#2687L, MS[14]#2688L, MS[15]#2689L, MS[16]#2690L, MS[17]#2691L, MS[18]#2692L, MS[19]#2693L, MS[20]#2694L, MS[21]#2695L, MS[22]#2696L, MS[23]#2697L, MS[24]#2698L, MS[25]#2699L, MS[26]#2700L, MS[27]#2701L, MS[28]#2702L, MS[29]#2703L, MS[30]#2704L, MS[31]#2705L, MS[32]#2706L, MS[33]#2707L, MS[34]#2708L, MS[35]#2709L, MS[36]#2710L, MS[37]#2711L, MS[38]#2712L, MS[39]#2713L, MS[40]#2714L, MS[41]#2715L, MS[42]#2716L, MS[43]#2717L, MS[44]#2718L, MS[45]#2719L, MS[46]#2720L, MS[47]#2721L, MS[48]#2722L, MS[49]#2723L, MS[50]#2724L, MS[51]#2725L, sum#2887L, sum#2888, sum#2889, count#2890L]
Results [59]: [segment#2659, processing_day#2661, count#2891L, MS[0]#2726L, MS[1]#2727L, MS[2]#2728L, MS[3]#2729L, MS[4]#2730L, MS[5]#2731L, MS[6]#2732L, MS[7]#2733L, MS[8]#2734L, MS[9]#2735L, MS[10]#2736L, MS[11]#2737L, MS[12]#2738L, MS[13]#2739L, MS[14]#2740L, MS[15]#2741L, MS[16]#2742L, MS[17]#2743L, MS[18]#2744L, MS[19]#2745L, MS[20]#2746L, MS[21]#2747L, MS[22]#2748L, MS[23]#2749L, MS[24]#2750L, MS[25]#2751L, MS[26]#2752L, MS[27]#2753L, MS[28]#2754L, MS[29]#2755L, MS[30]#2756L, MS[31]#2757L, MS[32]#2758L, MS[33]#2759L, MS[34]#2760L, MS[35]#2761L, MS[36]#2762L, MS[37]#2763L, MS[38]#2764L, MS[39]#2765L, MS[40]#2766L, MS[41]#2767L, MS[42]#2768L, MS[43]#2769L, MS[44]#2770L, MS[45]#2771L, MS[46]#2772L, MS[47]#2773L, MS[48]#2774L, MS[49]#2775L, MS[50]#2776L, MS[51]#2777L, sum#2892L, sum#2893, sum#2894, count#2895L]
(15) Exchange
Input [59]: [segment#2659, processing_day#2661, count#2891L, MS[0]#2726L, MS[1]#2727L, MS[2]#2728L, MS[3]#2729L, MS[4]#2730L, MS[5]#2731L, MS[6]#2732L, MS[7]#2733L, MS[8]#2734L, MS[9]#2735L, MS[10]#2736L, MS[11]#2737L, MS[12]#2738L, MS[13]#2739L, MS[14]#2740L, MS[15]#2741L, MS[16]#2742L, MS[17]#2743L, MS[18]#2744L, MS[19]#2745L, MS[20]#2746L, MS[21]#2747L, MS[22]#2748L, MS[23]#2749L, MS[24]#2750L, MS[25]#2751L, MS[26]#2752L, MS[27]#2753L, MS[28]#2754L, MS[29]#2755L, MS[30]#2756L, MS[31]#2757L, MS[32]#2758L, MS[33]#2759L, MS[34]#2760L, MS[35]#2761L, MS[36]#2762L, MS[37]#2763L, MS[38]#2764L, MS[39]#2765L, MS[40]#2766L, MS[41]#2767L, MS[42]#2768L, MS[43]#2769L, MS[44]#2770L, MS[45]#2771L, MS[46]#2772L, MS[47]#2773L, MS[48]#2774L, MS[49]#2775L, MS[50]#2776L, MS[51]#2777L, sum#2892L, sum#2893, sum#2894, count#2895L]
Arguments: hashpartitioning(segment#2659, processing_day#2661, 200), ENSURE_REQUIREMENTS, [plan_id=272]
(16) HashAggregate
Input [59]: [segment#2659, processing_day#2661, count#2891L, MS[0]#2726L, MS[1]#2727L, MS[2]#2728L, MS[3]#2729L, MS[4]#2730L, MS[5]#2731L, MS[6]#2732L, MS[7]#2733L, MS[8]#2734L, MS[9]#2735L, MS[10]#2736L, MS[11]#2737L, MS[12]#2738L, MS[13]#2739L, MS[14]#2740L, MS[15]#2741L, MS[16]#2742L, MS[17]#2743L, MS[18]#2744L, MS[19]#2745L, MS[20]#2746L, MS[21]#2747L, MS[22]#2748L, MS[23]#2749L, MS[24]#2750L, MS[25]#2751L, MS[26]#2752L, MS[27]#2753L, MS[28]#2754L, MS[29]#2755L, MS[30]#2756L, MS[31]#2757L, MS[32]#2758L, MS[33]#2759L, MS[34]#2760L, MS[35]#2761L, MS[36]#2762L, MS[37]#2763L, MS[38]#2764L, MS[39]#2765L, MS[40]#2766L, MS[41]#2767L, MS[42]#2768L, MS[43]#2769L, MS[44]#2770L, MS[45]#2771L, MS[46]#2772L, MS[47]#2773L, MS[48]#2774L, MS[49]#2775L, MS[50]#2776L, MS[51]#2777L, sum#2892L, sum#2893, sum#2894, count#2895L]
Keys [2]: [segment#2659, processing_day#2661]
Functions [5]: [count(1), approx_count_distinct(customer_id#2655L, 0.05, 0, 0), sum(events#2665), sum(weighted_amount#2667), avg(amount#2663)]
Aggregate Attributes [5]: [count(1)#2673L, approx_count_distinct(customer_id#2655L, 0.05, 0, 0)#2778L, sum(events#2665)#2779L, sum(weighted_amount#2667)#2780, avg(amount#2663)#2781]
Results [7]: [segment#2659, processing_day#2661, count(1)#2673L AS row_count#2668L, approx_count_distinct(customer_id#2655L, 0.05, 0, 0)#2778L AS unique_customers#2669L, sum(events#2665)#2779L AS event_sum#2670L, sum(weighted_amount#2667)#2780 AS weighted_amount_sum#2671, avg(amount#2663)#2781 AS avg_amount#2672]
(17) Exchange
Input [7]: [segment#2659, processing_day#2661, row_count#2668L, unique_customers#2669L, event_sum#2670L, weighted_amount_sum#2671, avg_amount#2672]
Arguments: rangepartitioning(segment#2659 ASC NULLS FIRST, processing_day#2661 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=275]
(18) Sort
Input [7]: [segment#2659, processing_day#2661, row_count#2668L, unique_customers#2669L, event_sum#2670L, weighted_amount_sum#2671, avg_amount#2672]
Arguments: [segment#2659 ASC NULLS FIRST, processing_day#2661 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#2659, processing_day#2661, row_count#2668L, unique_customers#2669L, event_sum#2670L, weighted_amount_sum#2671, avg_amount#2672]
Arguments: isFinalPlan=true