== 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#27441L]
Arguments: Range (7000000, 8000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#27441L % 250000) AS customer_id#27443L, concat(segment-, cast(cast((id#27441L % 12) as int) as string)) AS segment#27447, cast((id#27441L % 14) as int) AS processing_day#27449, ((cast(((id#27441L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#27451, cast((((id#27441L * 29) % 7) + 1) as int) AS events#27453]
Input [1]: [id#27441L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#27443L, segment#27447, processing_day#27449, amount#27451, events#27453, (amount#27451 * cast(events#27453 as double)) AS weighted_amount#27455]
Input [5]: [customer_id#27443L, segment#27447, processing_day#27449, amount#27451, events#27453]
(4) HashAggregate
Input [6]: [customer_id#27443L, segment#27447, processing_day#27449, amount#27451, events#27453, weighted_amount#27455]
Keys [2]: [segment#27447, processing_day#27449]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#27443L, 0.05, 0, 0), partial_sum(events#27453), partial_sum(weighted_amount#27455), partial_avg(amount#27451)]
Aggregate Attributes [57]: [count#27674L, MS[0]#27462L, MS[1]#27463L, MS[2]#27464L, MS[3]#27465L, MS[4]#27466L, MS[5]#27467L, MS[6]#27468L, MS[7]#27469L, MS[8]#27470L, MS[9]#27471L, MS[10]#27472L, MS[11]#27473L, MS[12]#27474L, MS[13]#27475L, MS[14]#27476L, MS[15]#27477L, MS[16]#27478L, MS[17]#27479L, MS[18]#27480L, MS[19]#27481L, MS[20]#27482L, MS[21]#27483L, MS[22]#27484L, MS[23]#27485L, MS[24]#27486L, MS[25]#27487L, MS[26]#27488L, MS[27]#27489L, MS[28]#27490L, MS[29]#27491L, MS[30]#27492L, MS[31]#27493L, MS[32]#27494L, MS[33]#27495L, MS[34]#27496L, MS[35]#27497L, MS[36]#27498L, MS[37]#27499L, MS[38]#27500L, MS[39]#27501L, MS[40]#27502L, MS[41]#27503L, MS[42]#27504L, MS[43]#27505L, MS[44]#27506L, MS[45]#27507L, MS[46]#27508L, MS[47]#27509L, MS[48]#27510L, MS[49]#27511L, MS[50]#27512L, MS[51]#27513L, sum#27675L, sum#27676, sum#27677, count#27678L]
Results [59]: [segment#27447, processing_day#27449, count#27679L, MS[0]#27514L, MS[1]#27515L, MS[2]#27516L, MS[3]#27517L, MS[4]#27518L, MS[5]#27519L, MS[6]#27520L, MS[7]#27521L, MS[8]#27522L, MS[9]#27523L, MS[10]#27524L, MS[11]#27525L, MS[12]#27526L, MS[13]#27527L, MS[14]#27528L, MS[15]#27529L, MS[16]#27530L, MS[17]#27531L, MS[18]#27532L, MS[19]#27533L, MS[20]#27534L, MS[21]#27535L, MS[22]#27536L, MS[23]#27537L, MS[24]#27538L, MS[25]#27539L, MS[26]#27540L, MS[27]#27541L, MS[28]#27542L, MS[29]#27543L, MS[30]#27544L, MS[31]#27545L, MS[32]#27546L, MS[33]#27547L, MS[34]#27548L, MS[35]#27549L, MS[36]#27550L, MS[37]#27551L, MS[38]#27552L, MS[39]#27553L, MS[40]#27554L, MS[41]#27555L, MS[42]#27556L, MS[43]#27557L, MS[44]#27558L, MS[45]#27559L, MS[46]#27560L, MS[47]#27561L, MS[48]#27562L, MS[49]#27563L, MS[50]#27564L, MS[51]#27565L, sum#27680L, sum#27681, sum#27682, count#27683L]
(5) Exchange
Input [59]: [segment#27447, processing_day#27449, count#27679L, MS[0]#27514L, MS[1]#27515L, MS[2]#27516L, MS[3]#27517L, MS[4]#27518L, MS[5]#27519L, MS[6]#27520L, MS[7]#27521L, MS[8]#27522L, MS[9]#27523L, MS[10]#27524L, MS[11]#27525L, MS[12]#27526L, MS[13]#27527L, MS[14]#27528L, MS[15]#27529L, MS[16]#27530L, MS[17]#27531L, MS[18]#27532L, MS[19]#27533L, MS[20]#27534L, MS[21]#27535L, MS[22]#27536L, MS[23]#27537L, MS[24]#27538L, MS[25]#27539L, MS[26]#27540L, MS[27]#27541L, MS[28]#27542L, MS[29]#27543L, MS[30]#27544L, MS[31]#27545L, MS[32]#27546L, MS[33]#27547L, MS[34]#27548L, MS[35]#27549L, MS[36]#27550L, MS[37]#27551L, MS[38]#27552L, MS[39]#27553L, MS[40]#27554L, MS[41]#27555L, MS[42]#27556L, MS[43]#27557L, MS[44]#27558L, MS[45]#27559L, MS[46]#27560L, MS[47]#27561L, MS[48]#27562L, MS[49]#27563L, MS[50]#27564L, MS[51]#27565L, sum#27680L, sum#27681, sum#27682, count#27683L]
Arguments: hashpartitioning(segment#27447, processing_day#27449, 200), ENSURE_REQUIREMENTS, [plan_id=2622]
(6) ShuffleQueryStage
Output [59]: [segment#27447, processing_day#27449, count#27679L, MS[0]#27514L, MS[1]#27515L, MS[2]#27516L, MS[3]#27517L, MS[4]#27518L, MS[5]#27519L, MS[6]#27520L, MS[7]#27521L, MS[8]#27522L, MS[9]#27523L, MS[10]#27524L, MS[11]#27525L, MS[12]#27526L, MS[13]#27527L, MS[14]#27528L, MS[15]#27529L, MS[16]#27530L, MS[17]#27531L, MS[18]#27532L, MS[19]#27533L, MS[20]#27534L, MS[21]#27535L, MS[22]#27536L, MS[23]#27537L, MS[24]#27538L, MS[25]#27539L, MS[26]#27540L, MS[27]#27541L, MS[28]#27542L, MS[29]#27543L, MS[30]#27544L, MS[31]#27545L, MS[32]#27546L, MS[33]#27547L, MS[34]#27548L, MS[35]#27549L, MS[36]#27550L, MS[37]#27551L, MS[38]#27552L, MS[39]#27553L, MS[40]#27554L, MS[41]#27555L, MS[42]#27556L, MS[43]#27557L, MS[44]#27558L, MS[45]#27559L, MS[46]#27560L, MS[47]#27561L, MS[48]#27562L, MS[49]#27563L, MS[50]#27564L, MS[51]#27565L, sum#27680L, sum#27681, sum#27682, count#27683L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#27447, processing_day#27449, count#27679L, MS[0]#27514L, MS[1]#27515L, MS[2]#27516L, MS[3]#27517L, MS[4]#27518L, MS[5]#27519L, MS[6]#27520L, MS[7]#27521L, MS[8]#27522L, MS[9]#27523L, MS[10]#27524L, MS[11]#27525L, MS[12]#27526L, MS[13]#27527L, MS[14]#27528L, MS[15]#27529L, MS[16]#27530L, MS[17]#27531L, MS[18]#27532L, MS[19]#27533L, MS[20]#27534L, MS[21]#27535L, MS[22]#27536L, MS[23]#27537L, MS[24]#27538L, MS[25]#27539L, MS[26]#27540L, MS[27]#27541L, MS[28]#27542L, MS[29]#27543L, MS[30]#27544L, MS[31]#27545L, MS[32]#27546L, MS[33]#27547L, MS[34]#27548L, MS[35]#27549L, MS[36]#27550L, MS[37]#27551L, MS[38]#27552L, MS[39]#27553L, MS[40]#27554L, MS[41]#27555L, MS[42]#27556L, MS[43]#27557L, MS[44]#27558L, MS[45]#27559L, MS[46]#27560L, MS[47]#27561L, MS[48]#27562L, MS[49]#27563L, MS[50]#27564L, MS[51]#27565L, sum#27680L, sum#27681, sum#27682, count#27683L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#27447, processing_day#27449, count#27679L, MS[0]#27514L, MS[1]#27515L, MS[2]#27516L, MS[3]#27517L, MS[4]#27518L, MS[5]#27519L, MS[6]#27520L, MS[7]#27521L, MS[8]#27522L, MS[9]#27523L, MS[10]#27524L, MS[11]#27525L, MS[12]#27526L, MS[13]#27527L, MS[14]#27528L, MS[15]#27529L, MS[16]#27530L, MS[17]#27531L, MS[18]#27532L, MS[19]#27533L, MS[20]#27534L, MS[21]#27535L, MS[22]#27536L, MS[23]#27537L, MS[24]#27538L, MS[25]#27539L, MS[26]#27540L, MS[27]#27541L, MS[28]#27542L, MS[29]#27543L, MS[30]#27544L, MS[31]#27545L, MS[32]#27546L, MS[33]#27547L, MS[34]#27548L, MS[35]#27549L, MS[36]#27550L, MS[37]#27551L, MS[38]#27552L, MS[39]#27553L, MS[40]#27554L, MS[41]#27555L, MS[42]#27556L, MS[43]#27557L, MS[44]#27558L, MS[45]#27559L, MS[46]#27560L, MS[47]#27561L, MS[48]#27562L, MS[49]#27563L, MS[50]#27564L, MS[51]#27565L, sum#27680L, sum#27681, sum#27682, count#27683L]
Keys [2]: [segment#27447, processing_day#27449]
Functions [5]: [count(1), approx_count_distinct(customer_id#27443L, 0.05, 0, 0), sum(events#27453), sum(weighted_amount#27455), avg(amount#27451)]
Aggregate Attributes [5]: [count(1)#27461L, approx_count_distinct(customer_id#27443L, 0.05, 0, 0)#27566L, sum(events#27453)#27567L, sum(weighted_amount#27455)#27568, avg(amount#27451)#27569]
Results [7]: [segment#27447, processing_day#27449, count(1)#27461L AS row_count#27456L, approx_count_distinct(customer_id#27443L, 0.05, 0, 0)#27566L AS unique_customers#27457L, sum(events#27453)#27567L AS event_sum#27458L, sum(weighted_amount#27455)#27568 AS weighted_amount_sum#27459, avg(amount#27451)#27569 AS avg_amount#27460]
(9) Exchange
Input [7]: [segment#27447, processing_day#27449, row_count#27456L, unique_customers#27457L, event_sum#27458L, weighted_amount_sum#27459, avg_amount#27460]
Arguments: rangepartitioning(segment#27447 ASC NULLS FIRST, processing_day#27449 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2644]
(10) ShuffleQueryStage
Output [7]: [segment#27447, processing_day#27449, row_count#27456L, unique_customers#27457L, event_sum#27458L, weighted_amount_sum#27459, avg_amount#27460]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#27447, processing_day#27449, row_count#27456L, unique_customers#27457L, event_sum#27458L, weighted_amount_sum#27459, avg_amount#27460]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#27447, processing_day#27449, row_count#27456L, unique_customers#27457L, event_sum#27458L, weighted_amount_sum#27459, avg_amount#27460]
Arguments: [segment#27447 ASC NULLS FIRST, processing_day#27449 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#27447, processing_day#27449, row_count#27456L, unique_customers#27457L, event_sum#27458L, weighted_amount_sum#27459, avg_amount#27460]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#27443L, segment#27447, processing_day#27449, amount#27451, events#27453, weighted_amount#27455]
Keys [2]: [segment#27447, processing_day#27449]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#27443L, 0.05, 0, 0), partial_sum(events#27453), partial_sum(weighted_amount#27455), partial_avg(amount#27451)]
Aggregate Attributes [57]: [count#27674L, MS[0]#27462L, MS[1]#27463L, MS[2]#27464L, MS[3]#27465L, MS[4]#27466L, MS[5]#27467L, MS[6]#27468L, MS[7]#27469L, MS[8]#27470L, MS[9]#27471L, MS[10]#27472L, MS[11]#27473L, MS[12]#27474L, MS[13]#27475L, MS[14]#27476L, MS[15]#27477L, MS[16]#27478L, MS[17]#27479L, MS[18]#27480L, MS[19]#27481L, MS[20]#27482L, MS[21]#27483L, MS[22]#27484L, MS[23]#27485L, MS[24]#27486L, MS[25]#27487L, MS[26]#27488L, MS[27]#27489L, MS[28]#27490L, MS[29]#27491L, MS[30]#27492L, MS[31]#27493L, MS[32]#27494L, MS[33]#27495L, MS[34]#27496L, MS[35]#27497L, MS[36]#27498L, MS[37]#27499L, MS[38]#27500L, MS[39]#27501L, MS[40]#27502L, MS[41]#27503L, MS[42]#27504L, MS[43]#27505L, MS[44]#27506L, MS[45]#27507L, MS[46]#27508L, MS[47]#27509L, MS[48]#27510L, MS[49]#27511L, MS[50]#27512L, MS[51]#27513L, sum#27675L, sum#27676, sum#27677, count#27678L]
Results [59]: [segment#27447, processing_day#27449, count#27679L, MS[0]#27514L, MS[1]#27515L, MS[2]#27516L, MS[3]#27517L, MS[4]#27518L, MS[5]#27519L, MS[6]#27520L, MS[7]#27521L, MS[8]#27522L, MS[9]#27523L, MS[10]#27524L, MS[11]#27525L, MS[12]#27526L, MS[13]#27527L, MS[14]#27528L, MS[15]#27529L, MS[16]#27530L, MS[17]#27531L, MS[18]#27532L, MS[19]#27533L, MS[20]#27534L, MS[21]#27535L, MS[22]#27536L, MS[23]#27537L, MS[24]#27538L, MS[25]#27539L, MS[26]#27540L, MS[27]#27541L, MS[28]#27542L, MS[29]#27543L, MS[30]#27544L, MS[31]#27545L, MS[32]#27546L, MS[33]#27547L, MS[34]#27548L, MS[35]#27549L, MS[36]#27550L, MS[37]#27551L, MS[38]#27552L, MS[39]#27553L, MS[40]#27554L, MS[41]#27555L, MS[42]#27556L, MS[43]#27557L, MS[44]#27558L, MS[45]#27559L, MS[46]#27560L, MS[47]#27561L, MS[48]#27562L, MS[49]#27563L, MS[50]#27564L, MS[51]#27565L, sum#27680L, sum#27681, sum#27682, count#27683L]
(15) Exchange
Input [59]: [segment#27447, processing_day#27449, count#27679L, MS[0]#27514L, MS[1]#27515L, MS[2]#27516L, MS[3]#27517L, MS[4]#27518L, MS[5]#27519L, MS[6]#27520L, MS[7]#27521L, MS[8]#27522L, MS[9]#27523L, MS[10]#27524L, MS[11]#27525L, MS[12]#27526L, MS[13]#27527L, MS[14]#27528L, MS[15]#27529L, MS[16]#27530L, MS[17]#27531L, MS[18]#27532L, MS[19]#27533L, MS[20]#27534L, MS[21]#27535L, MS[22]#27536L, MS[23]#27537L, MS[24]#27538L, MS[25]#27539L, MS[26]#27540L, MS[27]#27541L, MS[28]#27542L, MS[29]#27543L, MS[30]#27544L, MS[31]#27545L, MS[32]#27546L, MS[33]#27547L, MS[34]#27548L, MS[35]#27549L, MS[36]#27550L, MS[37]#27551L, MS[38]#27552L, MS[39]#27553L, MS[40]#27554L, MS[41]#27555L, MS[42]#27556L, MS[43]#27557L, MS[44]#27558L, MS[45]#27559L, MS[46]#27560L, MS[47]#27561L, MS[48]#27562L, MS[49]#27563L, MS[50]#27564L, MS[51]#27565L, sum#27680L, sum#27681, sum#27682, count#27683L]
Arguments: hashpartitioning(segment#27447, processing_day#27449, 200), ENSURE_REQUIREMENTS, [plan_id=2602]
(16) HashAggregate
Input [59]: [segment#27447, processing_day#27449, count#27679L, MS[0]#27514L, MS[1]#27515L, MS[2]#27516L, MS[3]#27517L, MS[4]#27518L, MS[5]#27519L, MS[6]#27520L, MS[7]#27521L, MS[8]#27522L, MS[9]#27523L, MS[10]#27524L, MS[11]#27525L, MS[12]#27526L, MS[13]#27527L, MS[14]#27528L, MS[15]#27529L, MS[16]#27530L, MS[17]#27531L, MS[18]#27532L, MS[19]#27533L, MS[20]#27534L, MS[21]#27535L, MS[22]#27536L, MS[23]#27537L, MS[24]#27538L, MS[25]#27539L, MS[26]#27540L, MS[27]#27541L, MS[28]#27542L, MS[29]#27543L, MS[30]#27544L, MS[31]#27545L, MS[32]#27546L, MS[33]#27547L, MS[34]#27548L, MS[35]#27549L, MS[36]#27550L, MS[37]#27551L, MS[38]#27552L, MS[39]#27553L, MS[40]#27554L, MS[41]#27555L, MS[42]#27556L, MS[43]#27557L, MS[44]#27558L, MS[45]#27559L, MS[46]#27560L, MS[47]#27561L, MS[48]#27562L, MS[49]#27563L, MS[50]#27564L, MS[51]#27565L, sum#27680L, sum#27681, sum#27682, count#27683L]
Keys [2]: [segment#27447, processing_day#27449]
Functions [5]: [count(1), approx_count_distinct(customer_id#27443L, 0.05, 0, 0), sum(events#27453), sum(weighted_amount#27455), avg(amount#27451)]
Aggregate Attributes [5]: [count(1)#27461L, approx_count_distinct(customer_id#27443L, 0.05, 0, 0)#27566L, sum(events#27453)#27567L, sum(weighted_amount#27455)#27568, avg(amount#27451)#27569]
Results [7]: [segment#27447, processing_day#27449, count(1)#27461L AS row_count#27456L, approx_count_distinct(customer_id#27443L, 0.05, 0, 0)#27566L AS unique_customers#27457L, sum(events#27453)#27567L AS event_sum#27458L, sum(weighted_amount#27455)#27568 AS weighted_amount_sum#27459, avg(amount#27451)#27569 AS avg_amount#27460]
(17) Exchange
Input [7]: [segment#27447, processing_day#27449, row_count#27456L, unique_customers#27457L, event_sum#27458L, weighted_amount_sum#27459, avg_amount#27460]
Arguments: rangepartitioning(segment#27447 ASC NULLS FIRST, processing_day#27449 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2605]
(18) Sort
Input [7]: [segment#27447, processing_day#27449, row_count#27456L, unique_customers#27457L, event_sum#27458L, weighted_amount_sum#27459, avg_amount#27460]
Arguments: [segment#27447 ASC NULLS FIRST, processing_day#27449 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#27447, processing_day#27449, row_count#27456L, unique_customers#27457L, event_sum#27458L, weighted_amount_sum#27459, avg_amount#27460]
Arguments: isFinalPlan=true