== 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#12377L]
Arguments: Range (14000000, 15000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#12377L % 250000) AS customer_id#12379L, concat(segment-, cast(cast((id#12377L % 12) as int) as string)) AS segment#12383, cast((id#12377L % 14) as int) AS processing_day#12385, ((cast(((id#12377L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#12387, cast((((id#12377L * 29) % 7) + 1) as int) AS events#12389]
Input [1]: [id#12377L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#12379L, segment#12383, processing_day#12385, amount#12387, events#12389, (amount#12387 * cast(events#12389 as double)) AS weighted_amount#12391]
Input [5]: [customer_id#12379L, segment#12383, processing_day#12385, amount#12387, events#12389]
(4) HashAggregate
Input [6]: [customer_id#12379L, segment#12383, processing_day#12385, amount#12387, events#12389, weighted_amount#12391]
Keys [2]: [segment#12383, processing_day#12385]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#12379L, 0.05, 0, 0), partial_sum(events#12389), partial_sum(weighted_amount#12391), partial_avg(amount#12387)]
Aggregate Attributes [57]: [count#12610L, MS[0]#12398L, MS[1]#12399L, MS[2]#12400L, MS[3]#12401L, MS[4]#12402L, MS[5]#12403L, MS[6]#12404L, MS[7]#12405L, MS[8]#12406L, MS[9]#12407L, MS[10]#12408L, MS[11]#12409L, MS[12]#12410L, MS[13]#12411L, MS[14]#12412L, MS[15]#12413L, MS[16]#12414L, MS[17]#12415L, MS[18]#12416L, MS[19]#12417L, MS[20]#12418L, MS[21]#12419L, MS[22]#12420L, MS[23]#12421L, MS[24]#12422L, MS[25]#12423L, MS[26]#12424L, MS[27]#12425L, MS[28]#12426L, MS[29]#12427L, MS[30]#12428L, MS[31]#12429L, MS[32]#12430L, MS[33]#12431L, MS[34]#12432L, MS[35]#12433L, MS[36]#12434L, MS[37]#12435L, MS[38]#12436L, MS[39]#12437L, MS[40]#12438L, MS[41]#12439L, MS[42]#12440L, MS[43]#12441L, MS[44]#12442L, MS[45]#12443L, MS[46]#12444L, MS[47]#12445L, MS[48]#12446L, MS[49]#12447L, MS[50]#12448L, MS[51]#12449L, sum#12611L, sum#12612, sum#12613, count#12614L]
Results [59]: [segment#12383, processing_day#12385, count#12615L, MS[0]#12450L, MS[1]#12451L, MS[2]#12452L, MS[3]#12453L, MS[4]#12454L, MS[5]#12455L, MS[6]#12456L, MS[7]#12457L, MS[8]#12458L, MS[9]#12459L, MS[10]#12460L, MS[11]#12461L, MS[12]#12462L, MS[13]#12463L, MS[14]#12464L, MS[15]#12465L, MS[16]#12466L, MS[17]#12467L, MS[18]#12468L, MS[19]#12469L, MS[20]#12470L, MS[21]#12471L, MS[22]#12472L, MS[23]#12473L, MS[24]#12474L, MS[25]#12475L, MS[26]#12476L, MS[27]#12477L, MS[28]#12478L, MS[29]#12479L, MS[30]#12480L, MS[31]#12481L, MS[32]#12482L, MS[33]#12483L, MS[34]#12484L, MS[35]#12485L, MS[36]#12486L, MS[37]#12487L, MS[38]#12488L, MS[39]#12489L, MS[40]#12490L, MS[41]#12491L, MS[42]#12492L, MS[43]#12493L, MS[44]#12494L, MS[45]#12495L, MS[46]#12496L, MS[47]#12497L, MS[48]#12498L, MS[49]#12499L, MS[50]#12500L, MS[51]#12501L, sum#12616L, sum#12617, sum#12618, count#12619L]
(5) Exchange
Input [59]: [segment#12383, processing_day#12385, count#12615L, MS[0]#12450L, MS[1]#12451L, MS[2]#12452L, MS[3]#12453L, MS[4]#12454L, MS[5]#12455L, MS[6]#12456L, MS[7]#12457L, MS[8]#12458L, MS[9]#12459L, MS[10]#12460L, MS[11]#12461L, MS[12]#12462L, MS[13]#12463L, MS[14]#12464L, MS[15]#12465L, MS[16]#12466L, MS[17]#12467L, MS[18]#12468L, MS[19]#12469L, MS[20]#12470L, MS[21]#12471L, MS[22]#12472L, MS[23]#12473L, MS[24]#12474L, MS[25]#12475L, MS[26]#12476L, MS[27]#12477L, MS[28]#12478L, MS[29]#12479L, MS[30]#12480L, MS[31]#12481L, MS[32]#12482L, MS[33]#12483L, MS[34]#12484L, MS[35]#12485L, MS[36]#12486L, MS[37]#12487L, MS[38]#12488L, MS[39]#12489L, MS[40]#12490L, MS[41]#12491L, MS[42]#12492L, MS[43]#12493L, MS[44]#12494L, MS[45]#12495L, MS[46]#12496L, MS[47]#12497L, MS[48]#12498L, MS[49]#12499L, MS[50]#12500L, MS[51]#12501L, sum#12616L, sum#12617, sum#12618, count#12619L]
Arguments: hashpartitioning(segment#12383, processing_day#12385, 200), ENSURE_REQUIREMENTS, [plan_id=1205]
(6) ShuffleQueryStage
Output [59]: [segment#12383, processing_day#12385, count#12615L, MS[0]#12450L, MS[1]#12451L, MS[2]#12452L, MS[3]#12453L, MS[4]#12454L, MS[5]#12455L, MS[6]#12456L, MS[7]#12457L, MS[8]#12458L, MS[9]#12459L, MS[10]#12460L, MS[11]#12461L, MS[12]#12462L, MS[13]#12463L, MS[14]#12464L, MS[15]#12465L, MS[16]#12466L, MS[17]#12467L, MS[18]#12468L, MS[19]#12469L, MS[20]#12470L, MS[21]#12471L, MS[22]#12472L, MS[23]#12473L, MS[24]#12474L, MS[25]#12475L, MS[26]#12476L, MS[27]#12477L, MS[28]#12478L, MS[29]#12479L, MS[30]#12480L, MS[31]#12481L, MS[32]#12482L, MS[33]#12483L, MS[34]#12484L, MS[35]#12485L, MS[36]#12486L, MS[37]#12487L, MS[38]#12488L, MS[39]#12489L, MS[40]#12490L, MS[41]#12491L, MS[42]#12492L, MS[43]#12493L, MS[44]#12494L, MS[45]#12495L, MS[46]#12496L, MS[47]#12497L, MS[48]#12498L, MS[49]#12499L, MS[50]#12500L, MS[51]#12501L, sum#12616L, sum#12617, sum#12618, count#12619L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#12383, processing_day#12385, count#12615L, MS[0]#12450L, MS[1]#12451L, MS[2]#12452L, MS[3]#12453L, MS[4]#12454L, MS[5]#12455L, MS[6]#12456L, MS[7]#12457L, MS[8]#12458L, MS[9]#12459L, MS[10]#12460L, MS[11]#12461L, MS[12]#12462L, MS[13]#12463L, MS[14]#12464L, MS[15]#12465L, MS[16]#12466L, MS[17]#12467L, MS[18]#12468L, MS[19]#12469L, MS[20]#12470L, MS[21]#12471L, MS[22]#12472L, MS[23]#12473L, MS[24]#12474L, MS[25]#12475L, MS[26]#12476L, MS[27]#12477L, MS[28]#12478L, MS[29]#12479L, MS[30]#12480L, MS[31]#12481L, MS[32]#12482L, MS[33]#12483L, MS[34]#12484L, MS[35]#12485L, MS[36]#12486L, MS[37]#12487L, MS[38]#12488L, MS[39]#12489L, MS[40]#12490L, MS[41]#12491L, MS[42]#12492L, MS[43]#12493L, MS[44]#12494L, MS[45]#12495L, MS[46]#12496L, MS[47]#12497L, MS[48]#12498L, MS[49]#12499L, MS[50]#12500L, MS[51]#12501L, sum#12616L, sum#12617, sum#12618, count#12619L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#12383, processing_day#12385, count#12615L, MS[0]#12450L, MS[1]#12451L, MS[2]#12452L, MS[3]#12453L, MS[4]#12454L, MS[5]#12455L, MS[6]#12456L, MS[7]#12457L, MS[8]#12458L, MS[9]#12459L, MS[10]#12460L, MS[11]#12461L, MS[12]#12462L, MS[13]#12463L, MS[14]#12464L, MS[15]#12465L, MS[16]#12466L, MS[17]#12467L, MS[18]#12468L, MS[19]#12469L, MS[20]#12470L, MS[21]#12471L, MS[22]#12472L, MS[23]#12473L, MS[24]#12474L, MS[25]#12475L, MS[26]#12476L, MS[27]#12477L, MS[28]#12478L, MS[29]#12479L, MS[30]#12480L, MS[31]#12481L, MS[32]#12482L, MS[33]#12483L, MS[34]#12484L, MS[35]#12485L, MS[36]#12486L, MS[37]#12487L, MS[38]#12488L, MS[39]#12489L, MS[40]#12490L, MS[41]#12491L, MS[42]#12492L, MS[43]#12493L, MS[44]#12494L, MS[45]#12495L, MS[46]#12496L, MS[47]#12497L, MS[48]#12498L, MS[49]#12499L, MS[50]#12500L, MS[51]#12501L, sum#12616L, sum#12617, sum#12618, count#12619L]
Keys [2]: [segment#12383, processing_day#12385]
Functions [5]: [count(1), approx_count_distinct(customer_id#12379L, 0.05, 0, 0), sum(events#12389), sum(weighted_amount#12391), avg(amount#12387)]
Aggregate Attributes [5]: [count(1)#12397L, approx_count_distinct(customer_id#12379L, 0.05, 0, 0)#12502L, sum(events#12389)#12503L, sum(weighted_amount#12391)#12504, avg(amount#12387)#12505]
Results [7]: [segment#12383, processing_day#12385, count(1)#12397L AS row_count#12392L, approx_count_distinct(customer_id#12379L, 0.05, 0, 0)#12502L AS unique_customers#12393L, sum(events#12389)#12503L AS event_sum#12394L, sum(weighted_amount#12391)#12504 AS weighted_amount_sum#12395, avg(amount#12387)#12505 AS avg_amount#12396]
(9) Exchange
Input [7]: [segment#12383, processing_day#12385, row_count#12392L, unique_customers#12393L, event_sum#12394L, weighted_amount_sum#12395, avg_amount#12396]
Arguments: rangepartitioning(segment#12383 ASC NULLS FIRST, processing_day#12385 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1227]
(10) ShuffleQueryStage
Output [7]: [segment#12383, processing_day#12385, row_count#12392L, unique_customers#12393L, event_sum#12394L, weighted_amount_sum#12395, avg_amount#12396]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#12383, processing_day#12385, row_count#12392L, unique_customers#12393L, event_sum#12394L, weighted_amount_sum#12395, avg_amount#12396]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#12383, processing_day#12385, row_count#12392L, unique_customers#12393L, event_sum#12394L, weighted_amount_sum#12395, avg_amount#12396]
Arguments: [segment#12383 ASC NULLS FIRST, processing_day#12385 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#12383, processing_day#12385, row_count#12392L, unique_customers#12393L, event_sum#12394L, weighted_amount_sum#12395, avg_amount#12396]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#12379L, segment#12383, processing_day#12385, amount#12387, events#12389, weighted_amount#12391]
Keys [2]: [segment#12383, processing_day#12385]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#12379L, 0.05, 0, 0), partial_sum(events#12389), partial_sum(weighted_amount#12391), partial_avg(amount#12387)]
Aggregate Attributes [57]: [count#12610L, MS[0]#12398L, MS[1]#12399L, MS[2]#12400L, MS[3]#12401L, MS[4]#12402L, MS[5]#12403L, MS[6]#12404L, MS[7]#12405L, MS[8]#12406L, MS[9]#12407L, MS[10]#12408L, MS[11]#12409L, MS[12]#12410L, MS[13]#12411L, MS[14]#12412L, MS[15]#12413L, MS[16]#12414L, MS[17]#12415L, MS[18]#12416L, MS[19]#12417L, MS[20]#12418L, MS[21]#12419L, MS[22]#12420L, MS[23]#12421L, MS[24]#12422L, MS[25]#12423L, MS[26]#12424L, MS[27]#12425L, MS[28]#12426L, MS[29]#12427L, MS[30]#12428L, MS[31]#12429L, MS[32]#12430L, MS[33]#12431L, MS[34]#12432L, MS[35]#12433L, MS[36]#12434L, MS[37]#12435L, MS[38]#12436L, MS[39]#12437L, MS[40]#12438L, MS[41]#12439L, MS[42]#12440L, MS[43]#12441L, MS[44]#12442L, MS[45]#12443L, MS[46]#12444L, MS[47]#12445L, MS[48]#12446L, MS[49]#12447L, MS[50]#12448L, MS[51]#12449L, sum#12611L, sum#12612, sum#12613, count#12614L]
Results [59]: [segment#12383, processing_day#12385, count#12615L, MS[0]#12450L, MS[1]#12451L, MS[2]#12452L, MS[3]#12453L, MS[4]#12454L, MS[5]#12455L, MS[6]#12456L, MS[7]#12457L, MS[8]#12458L, MS[9]#12459L, MS[10]#12460L, MS[11]#12461L, MS[12]#12462L, MS[13]#12463L, MS[14]#12464L, MS[15]#12465L, MS[16]#12466L, MS[17]#12467L, MS[18]#12468L, MS[19]#12469L, MS[20]#12470L, MS[21]#12471L, MS[22]#12472L, MS[23]#12473L, MS[24]#12474L, MS[25]#12475L, MS[26]#12476L, MS[27]#12477L, MS[28]#12478L, MS[29]#12479L, MS[30]#12480L, MS[31]#12481L, MS[32]#12482L, MS[33]#12483L, MS[34]#12484L, MS[35]#12485L, MS[36]#12486L, MS[37]#12487L, MS[38]#12488L, MS[39]#12489L, MS[40]#12490L, MS[41]#12491L, MS[42]#12492L, MS[43]#12493L, MS[44]#12494L, MS[45]#12495L, MS[46]#12496L, MS[47]#12497L, MS[48]#12498L, MS[49]#12499L, MS[50]#12500L, MS[51]#12501L, sum#12616L, sum#12617, sum#12618, count#12619L]
(15) Exchange
Input [59]: [segment#12383, processing_day#12385, count#12615L, MS[0]#12450L, MS[1]#12451L, MS[2]#12452L, MS[3]#12453L, MS[4]#12454L, MS[5]#12455L, MS[6]#12456L, MS[7]#12457L, MS[8]#12458L, MS[9]#12459L, MS[10]#12460L, MS[11]#12461L, MS[12]#12462L, MS[13]#12463L, MS[14]#12464L, MS[15]#12465L, MS[16]#12466L, MS[17]#12467L, MS[18]#12468L, MS[19]#12469L, MS[20]#12470L, MS[21]#12471L, MS[22]#12472L, MS[23]#12473L, MS[24]#12474L, MS[25]#12475L, MS[26]#12476L, MS[27]#12477L, MS[28]#12478L, MS[29]#12479L, MS[30]#12480L, MS[31]#12481L, MS[32]#12482L, MS[33]#12483L, MS[34]#12484L, MS[35]#12485L, MS[36]#12486L, MS[37]#12487L, MS[38]#12488L, MS[39]#12489L, MS[40]#12490L, MS[41]#12491L, MS[42]#12492L, MS[43]#12493L, MS[44]#12494L, MS[45]#12495L, MS[46]#12496L, MS[47]#12497L, MS[48]#12498L, MS[49]#12499L, MS[50]#12500L, MS[51]#12501L, sum#12616L, sum#12617, sum#12618, count#12619L]
Arguments: hashpartitioning(segment#12383, processing_day#12385, 200), ENSURE_REQUIREMENTS, [plan_id=1185]
(16) HashAggregate
Input [59]: [segment#12383, processing_day#12385, count#12615L, MS[0]#12450L, MS[1]#12451L, MS[2]#12452L, MS[3]#12453L, MS[4]#12454L, MS[5]#12455L, MS[6]#12456L, MS[7]#12457L, MS[8]#12458L, MS[9]#12459L, MS[10]#12460L, MS[11]#12461L, MS[12]#12462L, MS[13]#12463L, MS[14]#12464L, MS[15]#12465L, MS[16]#12466L, MS[17]#12467L, MS[18]#12468L, MS[19]#12469L, MS[20]#12470L, MS[21]#12471L, MS[22]#12472L, MS[23]#12473L, MS[24]#12474L, MS[25]#12475L, MS[26]#12476L, MS[27]#12477L, MS[28]#12478L, MS[29]#12479L, MS[30]#12480L, MS[31]#12481L, MS[32]#12482L, MS[33]#12483L, MS[34]#12484L, MS[35]#12485L, MS[36]#12486L, MS[37]#12487L, MS[38]#12488L, MS[39]#12489L, MS[40]#12490L, MS[41]#12491L, MS[42]#12492L, MS[43]#12493L, MS[44]#12494L, MS[45]#12495L, MS[46]#12496L, MS[47]#12497L, MS[48]#12498L, MS[49]#12499L, MS[50]#12500L, MS[51]#12501L, sum#12616L, sum#12617, sum#12618, count#12619L]
Keys [2]: [segment#12383, processing_day#12385]
Functions [5]: [count(1), approx_count_distinct(customer_id#12379L, 0.05, 0, 0), sum(events#12389), sum(weighted_amount#12391), avg(amount#12387)]
Aggregate Attributes [5]: [count(1)#12397L, approx_count_distinct(customer_id#12379L, 0.05, 0, 0)#12502L, sum(events#12389)#12503L, sum(weighted_amount#12391)#12504, avg(amount#12387)#12505]
Results [7]: [segment#12383, processing_day#12385, count(1)#12397L AS row_count#12392L, approx_count_distinct(customer_id#12379L, 0.05, 0, 0)#12502L AS unique_customers#12393L, sum(events#12389)#12503L AS event_sum#12394L, sum(weighted_amount#12391)#12504 AS weighted_amount_sum#12395, avg(amount#12387)#12505 AS avg_amount#12396]
(17) Exchange
Input [7]: [segment#12383, processing_day#12385, row_count#12392L, unique_customers#12393L, event_sum#12394L, weighted_amount_sum#12395, avg_amount#12396]
Arguments: rangepartitioning(segment#12383 ASC NULLS FIRST, processing_day#12385 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1188]
(18) Sort
Input [7]: [segment#12383, processing_day#12385, row_count#12392L, unique_customers#12393L, event_sum#12394L, weighted_amount_sum#12395, avg_amount#12396]
Arguments: [segment#12383 ASC NULLS FIRST, processing_day#12385 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#12383, processing_day#12385, row_count#12392L, unique_customers#12393L, event_sum#12394L, weighted_amount_sum#12395, avg_amount#12396]
Arguments: isFinalPlan=true