== 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#26557L]
Arguments: Range (6000000, 7000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#26557L % 250000) AS customer_id#26559L, concat(segment-, cast(cast((id#26557L % 12) as int) as string)) AS segment#26563, cast((id#26557L % 14) as int) AS processing_day#26565, ((cast(((id#26557L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#26567, cast((((id#26557L * 29) % 7) + 1) as int) AS events#26569]
Input [1]: [id#26557L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#26559L, segment#26563, processing_day#26565, amount#26567, events#26569, (amount#26567 * cast(events#26569 as double)) AS weighted_amount#26571]
Input [5]: [customer_id#26559L, segment#26563, processing_day#26565, amount#26567, events#26569]
(4) HashAggregate
Input [6]: [customer_id#26559L, segment#26563, processing_day#26565, amount#26567, events#26569, weighted_amount#26571]
Keys [2]: [segment#26563, processing_day#26565]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#26559L, 0.05, 0, 0), partial_sum(events#26569), partial_sum(weighted_amount#26571), partial_avg(amount#26567)]
Aggregate Attributes [57]: [count#26790L, MS[0]#26578L, MS[1]#26579L, MS[2]#26580L, MS[3]#26581L, MS[4]#26582L, MS[5]#26583L, MS[6]#26584L, MS[7]#26585L, MS[8]#26586L, MS[9]#26587L, MS[10]#26588L, MS[11]#26589L, MS[12]#26590L, MS[13]#26591L, MS[14]#26592L, MS[15]#26593L, MS[16]#26594L, MS[17]#26595L, MS[18]#26596L, MS[19]#26597L, MS[20]#26598L, MS[21]#26599L, MS[22]#26600L, MS[23]#26601L, MS[24]#26602L, MS[25]#26603L, MS[26]#26604L, MS[27]#26605L, MS[28]#26606L, MS[29]#26607L, MS[30]#26608L, MS[31]#26609L, MS[32]#26610L, MS[33]#26611L, MS[34]#26612L, MS[35]#26613L, MS[36]#26614L, MS[37]#26615L, MS[38]#26616L, MS[39]#26617L, MS[40]#26618L, MS[41]#26619L, MS[42]#26620L, MS[43]#26621L, MS[44]#26622L, MS[45]#26623L, MS[46]#26624L, MS[47]#26625L, MS[48]#26626L, MS[49]#26627L, MS[50]#26628L, MS[51]#26629L, sum#26791L, sum#26792, sum#26793, count#26794L]
Results [59]: [segment#26563, processing_day#26565, count#26795L, MS[0]#26630L, MS[1]#26631L, MS[2]#26632L, MS[3]#26633L, MS[4]#26634L, MS[5]#26635L, MS[6]#26636L, MS[7]#26637L, MS[8]#26638L, MS[9]#26639L, MS[10]#26640L, MS[11]#26641L, MS[12]#26642L, MS[13]#26643L, MS[14]#26644L, MS[15]#26645L, MS[16]#26646L, MS[17]#26647L, MS[18]#26648L, MS[19]#26649L, MS[20]#26650L, MS[21]#26651L, MS[22]#26652L, MS[23]#26653L, MS[24]#26654L, MS[25]#26655L, MS[26]#26656L, MS[27]#26657L, MS[28]#26658L, MS[29]#26659L, MS[30]#26660L, MS[31]#26661L, MS[32]#26662L, MS[33]#26663L, MS[34]#26664L, MS[35]#26665L, MS[36]#26666L, MS[37]#26667L, MS[38]#26668L, MS[39]#26669L, MS[40]#26670L, MS[41]#26671L, MS[42]#26672L, MS[43]#26673L, MS[44]#26674L, MS[45]#26675L, MS[46]#26676L, MS[47]#26677L, MS[48]#26678L, MS[49]#26679L, MS[50]#26680L, MS[51]#26681L, sum#26796L, sum#26797, sum#26798, count#26799L]
(5) Exchange
Input [59]: [segment#26563, processing_day#26565, count#26795L, MS[0]#26630L, MS[1]#26631L, MS[2]#26632L, MS[3]#26633L, MS[4]#26634L, MS[5]#26635L, MS[6]#26636L, MS[7]#26637L, MS[8]#26638L, MS[9]#26639L, MS[10]#26640L, MS[11]#26641L, MS[12]#26642L, MS[13]#26643L, MS[14]#26644L, MS[15]#26645L, MS[16]#26646L, MS[17]#26647L, MS[18]#26648L, MS[19]#26649L, MS[20]#26650L, MS[21]#26651L, MS[22]#26652L, MS[23]#26653L, MS[24]#26654L, MS[25]#26655L, MS[26]#26656L, MS[27]#26657L, MS[28]#26658L, MS[29]#26659L, MS[30]#26660L, MS[31]#26661L, MS[32]#26662L, MS[33]#26663L, MS[34]#26664L, MS[35]#26665L, MS[36]#26666L, MS[37]#26667L, MS[38]#26668L, MS[39]#26669L, MS[40]#26670L, MS[41]#26671L, MS[42]#26672L, MS[43]#26673L, MS[44]#26674L, MS[45]#26675L, MS[46]#26676L, MS[47]#26677L, MS[48]#26678L, MS[49]#26679L, MS[50]#26680L, MS[51]#26681L, sum#26796L, sum#26797, sum#26798, count#26799L]
Arguments: hashpartitioning(segment#26563, processing_day#26565, 200), ENSURE_REQUIREMENTS, [plan_id=2539]
(6) ShuffleQueryStage
Output [59]: [segment#26563, processing_day#26565, count#26795L, MS[0]#26630L, MS[1]#26631L, MS[2]#26632L, MS[3]#26633L, MS[4]#26634L, MS[5]#26635L, MS[6]#26636L, MS[7]#26637L, MS[8]#26638L, MS[9]#26639L, MS[10]#26640L, MS[11]#26641L, MS[12]#26642L, MS[13]#26643L, MS[14]#26644L, MS[15]#26645L, MS[16]#26646L, MS[17]#26647L, MS[18]#26648L, MS[19]#26649L, MS[20]#26650L, MS[21]#26651L, MS[22]#26652L, MS[23]#26653L, MS[24]#26654L, MS[25]#26655L, MS[26]#26656L, MS[27]#26657L, MS[28]#26658L, MS[29]#26659L, MS[30]#26660L, MS[31]#26661L, MS[32]#26662L, MS[33]#26663L, MS[34]#26664L, MS[35]#26665L, MS[36]#26666L, MS[37]#26667L, MS[38]#26668L, MS[39]#26669L, MS[40]#26670L, MS[41]#26671L, MS[42]#26672L, MS[43]#26673L, MS[44]#26674L, MS[45]#26675L, MS[46]#26676L, MS[47]#26677L, MS[48]#26678L, MS[49]#26679L, MS[50]#26680L, MS[51]#26681L, sum#26796L, sum#26797, sum#26798, count#26799L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#26563, processing_day#26565, count#26795L, MS[0]#26630L, MS[1]#26631L, MS[2]#26632L, MS[3]#26633L, MS[4]#26634L, MS[5]#26635L, MS[6]#26636L, MS[7]#26637L, MS[8]#26638L, MS[9]#26639L, MS[10]#26640L, MS[11]#26641L, MS[12]#26642L, MS[13]#26643L, MS[14]#26644L, MS[15]#26645L, MS[16]#26646L, MS[17]#26647L, MS[18]#26648L, MS[19]#26649L, MS[20]#26650L, MS[21]#26651L, MS[22]#26652L, MS[23]#26653L, MS[24]#26654L, MS[25]#26655L, MS[26]#26656L, MS[27]#26657L, MS[28]#26658L, MS[29]#26659L, MS[30]#26660L, MS[31]#26661L, MS[32]#26662L, MS[33]#26663L, MS[34]#26664L, MS[35]#26665L, MS[36]#26666L, MS[37]#26667L, MS[38]#26668L, MS[39]#26669L, MS[40]#26670L, MS[41]#26671L, MS[42]#26672L, MS[43]#26673L, MS[44]#26674L, MS[45]#26675L, MS[46]#26676L, MS[47]#26677L, MS[48]#26678L, MS[49]#26679L, MS[50]#26680L, MS[51]#26681L, sum#26796L, sum#26797, sum#26798, count#26799L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#26563, processing_day#26565, count#26795L, MS[0]#26630L, MS[1]#26631L, MS[2]#26632L, MS[3]#26633L, MS[4]#26634L, MS[5]#26635L, MS[6]#26636L, MS[7]#26637L, MS[8]#26638L, MS[9]#26639L, MS[10]#26640L, MS[11]#26641L, MS[12]#26642L, MS[13]#26643L, MS[14]#26644L, MS[15]#26645L, MS[16]#26646L, MS[17]#26647L, MS[18]#26648L, MS[19]#26649L, MS[20]#26650L, MS[21]#26651L, MS[22]#26652L, MS[23]#26653L, MS[24]#26654L, MS[25]#26655L, MS[26]#26656L, MS[27]#26657L, MS[28]#26658L, MS[29]#26659L, MS[30]#26660L, MS[31]#26661L, MS[32]#26662L, MS[33]#26663L, MS[34]#26664L, MS[35]#26665L, MS[36]#26666L, MS[37]#26667L, MS[38]#26668L, MS[39]#26669L, MS[40]#26670L, MS[41]#26671L, MS[42]#26672L, MS[43]#26673L, MS[44]#26674L, MS[45]#26675L, MS[46]#26676L, MS[47]#26677L, MS[48]#26678L, MS[49]#26679L, MS[50]#26680L, MS[51]#26681L, sum#26796L, sum#26797, sum#26798, count#26799L]
Keys [2]: [segment#26563, processing_day#26565]
Functions [5]: [count(1), approx_count_distinct(customer_id#26559L, 0.05, 0, 0), sum(events#26569), sum(weighted_amount#26571), avg(amount#26567)]
Aggregate Attributes [5]: [count(1)#26577L, approx_count_distinct(customer_id#26559L, 0.05, 0, 0)#26682L, sum(events#26569)#26683L, sum(weighted_amount#26571)#26684, avg(amount#26567)#26685]
Results [7]: [segment#26563, processing_day#26565, count(1)#26577L AS row_count#26572L, approx_count_distinct(customer_id#26559L, 0.05, 0, 0)#26682L AS unique_customers#26573L, sum(events#26569)#26683L AS event_sum#26574L, sum(weighted_amount#26571)#26684 AS weighted_amount_sum#26575, avg(amount#26567)#26685 AS avg_amount#26576]
(9) Exchange
Input [7]: [segment#26563, processing_day#26565, row_count#26572L, unique_customers#26573L, event_sum#26574L, weighted_amount_sum#26575, avg_amount#26576]
Arguments: rangepartitioning(segment#26563 ASC NULLS FIRST, processing_day#26565 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2561]
(10) ShuffleQueryStage
Output [7]: [segment#26563, processing_day#26565, row_count#26572L, unique_customers#26573L, event_sum#26574L, weighted_amount_sum#26575, avg_amount#26576]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#26563, processing_day#26565, row_count#26572L, unique_customers#26573L, event_sum#26574L, weighted_amount_sum#26575, avg_amount#26576]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#26563, processing_day#26565, row_count#26572L, unique_customers#26573L, event_sum#26574L, weighted_amount_sum#26575, avg_amount#26576]
Arguments: [segment#26563 ASC NULLS FIRST, processing_day#26565 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#26563, processing_day#26565, row_count#26572L, unique_customers#26573L, event_sum#26574L, weighted_amount_sum#26575, avg_amount#26576]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#26559L, segment#26563, processing_day#26565, amount#26567, events#26569, weighted_amount#26571]
Keys [2]: [segment#26563, processing_day#26565]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#26559L, 0.05, 0, 0), partial_sum(events#26569), partial_sum(weighted_amount#26571), partial_avg(amount#26567)]
Aggregate Attributes [57]: [count#26790L, MS[0]#26578L, MS[1]#26579L, MS[2]#26580L, MS[3]#26581L, MS[4]#26582L, MS[5]#26583L, MS[6]#26584L, MS[7]#26585L, MS[8]#26586L, MS[9]#26587L, MS[10]#26588L, MS[11]#26589L, MS[12]#26590L, MS[13]#26591L, MS[14]#26592L, MS[15]#26593L, MS[16]#26594L, MS[17]#26595L, MS[18]#26596L, MS[19]#26597L, MS[20]#26598L, MS[21]#26599L, MS[22]#26600L, MS[23]#26601L, MS[24]#26602L, MS[25]#26603L, MS[26]#26604L, MS[27]#26605L, MS[28]#26606L, MS[29]#26607L, MS[30]#26608L, MS[31]#26609L, MS[32]#26610L, MS[33]#26611L, MS[34]#26612L, MS[35]#26613L, MS[36]#26614L, MS[37]#26615L, MS[38]#26616L, MS[39]#26617L, MS[40]#26618L, MS[41]#26619L, MS[42]#26620L, MS[43]#26621L, MS[44]#26622L, MS[45]#26623L, MS[46]#26624L, MS[47]#26625L, MS[48]#26626L, MS[49]#26627L, MS[50]#26628L, MS[51]#26629L, sum#26791L, sum#26792, sum#26793, count#26794L]
Results [59]: [segment#26563, processing_day#26565, count#26795L, MS[0]#26630L, MS[1]#26631L, MS[2]#26632L, MS[3]#26633L, MS[4]#26634L, MS[5]#26635L, MS[6]#26636L, MS[7]#26637L, MS[8]#26638L, MS[9]#26639L, MS[10]#26640L, MS[11]#26641L, MS[12]#26642L, MS[13]#26643L, MS[14]#26644L, MS[15]#26645L, MS[16]#26646L, MS[17]#26647L, MS[18]#26648L, MS[19]#26649L, MS[20]#26650L, MS[21]#26651L, MS[22]#26652L, MS[23]#26653L, MS[24]#26654L, MS[25]#26655L, MS[26]#26656L, MS[27]#26657L, MS[28]#26658L, MS[29]#26659L, MS[30]#26660L, MS[31]#26661L, MS[32]#26662L, MS[33]#26663L, MS[34]#26664L, MS[35]#26665L, MS[36]#26666L, MS[37]#26667L, MS[38]#26668L, MS[39]#26669L, MS[40]#26670L, MS[41]#26671L, MS[42]#26672L, MS[43]#26673L, MS[44]#26674L, MS[45]#26675L, MS[46]#26676L, MS[47]#26677L, MS[48]#26678L, MS[49]#26679L, MS[50]#26680L, MS[51]#26681L, sum#26796L, sum#26797, sum#26798, count#26799L]
(15) Exchange
Input [59]: [segment#26563, processing_day#26565, count#26795L, MS[0]#26630L, MS[1]#26631L, MS[2]#26632L, MS[3]#26633L, MS[4]#26634L, MS[5]#26635L, MS[6]#26636L, MS[7]#26637L, MS[8]#26638L, MS[9]#26639L, MS[10]#26640L, MS[11]#26641L, MS[12]#26642L, MS[13]#26643L, MS[14]#26644L, MS[15]#26645L, MS[16]#26646L, MS[17]#26647L, MS[18]#26648L, MS[19]#26649L, MS[20]#26650L, MS[21]#26651L, MS[22]#26652L, MS[23]#26653L, MS[24]#26654L, MS[25]#26655L, MS[26]#26656L, MS[27]#26657L, MS[28]#26658L, MS[29]#26659L, MS[30]#26660L, MS[31]#26661L, MS[32]#26662L, MS[33]#26663L, MS[34]#26664L, MS[35]#26665L, MS[36]#26666L, MS[37]#26667L, MS[38]#26668L, MS[39]#26669L, MS[40]#26670L, MS[41]#26671L, MS[42]#26672L, MS[43]#26673L, MS[44]#26674L, MS[45]#26675L, MS[46]#26676L, MS[47]#26677L, MS[48]#26678L, MS[49]#26679L, MS[50]#26680L, MS[51]#26681L, sum#26796L, sum#26797, sum#26798, count#26799L]
Arguments: hashpartitioning(segment#26563, processing_day#26565, 200), ENSURE_REQUIREMENTS, [plan_id=2519]
(16) HashAggregate
Input [59]: [segment#26563, processing_day#26565, count#26795L, MS[0]#26630L, MS[1]#26631L, MS[2]#26632L, MS[3]#26633L, MS[4]#26634L, MS[5]#26635L, MS[6]#26636L, MS[7]#26637L, MS[8]#26638L, MS[9]#26639L, MS[10]#26640L, MS[11]#26641L, MS[12]#26642L, MS[13]#26643L, MS[14]#26644L, MS[15]#26645L, MS[16]#26646L, MS[17]#26647L, MS[18]#26648L, MS[19]#26649L, MS[20]#26650L, MS[21]#26651L, MS[22]#26652L, MS[23]#26653L, MS[24]#26654L, MS[25]#26655L, MS[26]#26656L, MS[27]#26657L, MS[28]#26658L, MS[29]#26659L, MS[30]#26660L, MS[31]#26661L, MS[32]#26662L, MS[33]#26663L, MS[34]#26664L, MS[35]#26665L, MS[36]#26666L, MS[37]#26667L, MS[38]#26668L, MS[39]#26669L, MS[40]#26670L, MS[41]#26671L, MS[42]#26672L, MS[43]#26673L, MS[44]#26674L, MS[45]#26675L, MS[46]#26676L, MS[47]#26677L, MS[48]#26678L, MS[49]#26679L, MS[50]#26680L, MS[51]#26681L, sum#26796L, sum#26797, sum#26798, count#26799L]
Keys [2]: [segment#26563, processing_day#26565]
Functions [5]: [count(1), approx_count_distinct(customer_id#26559L, 0.05, 0, 0), sum(events#26569), sum(weighted_amount#26571), avg(amount#26567)]
Aggregate Attributes [5]: [count(1)#26577L, approx_count_distinct(customer_id#26559L, 0.05, 0, 0)#26682L, sum(events#26569)#26683L, sum(weighted_amount#26571)#26684, avg(amount#26567)#26685]
Results [7]: [segment#26563, processing_day#26565, count(1)#26577L AS row_count#26572L, approx_count_distinct(customer_id#26559L, 0.05, 0, 0)#26682L AS unique_customers#26573L, sum(events#26569)#26683L AS event_sum#26574L, sum(weighted_amount#26571)#26684 AS weighted_amount_sum#26575, avg(amount#26567)#26685 AS avg_amount#26576]
(17) Exchange
Input [7]: [segment#26563, processing_day#26565, row_count#26572L, unique_customers#26573L, event_sum#26574L, weighted_amount_sum#26575, avg_amount#26576]
Arguments: rangepartitioning(segment#26563 ASC NULLS FIRST, processing_day#26565 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=2522]
(18) Sort
Input [7]: [segment#26563, processing_day#26565, row_count#26572L, unique_customers#26573L, event_sum#26574L, weighted_amount_sum#26575, avg_amount#26576]
Arguments: [segment#26563 ASC NULLS FIRST, processing_day#26565 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#26563, processing_day#26565, row_count#26572L, unique_customers#26573L, event_sum#26574L, weighted_amount_sum#26575, avg_amount#26576]
Arguments: isFinalPlan=true