== 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#17681L]
Arguments: Range (20000000, 21000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#17681L % 250000) AS customer_id#17683L, concat(segment-, cast(cast((id#17681L % 12) as int) as string)) AS segment#17687, cast((id#17681L % 14) as int) AS processing_day#17689, ((cast(((id#17681L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#17691, cast((((id#17681L * 29) % 7) + 1) as int) AS events#17693]
Input [1]: [id#17681L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#17683L, segment#17687, processing_day#17689, amount#17691, events#17693, (amount#17691 * cast(events#17693 as double)) AS weighted_amount#17695]
Input [5]: [customer_id#17683L, segment#17687, processing_day#17689, amount#17691, events#17693]
(4) HashAggregate
Input [6]: [customer_id#17683L, segment#17687, processing_day#17689, amount#17691, events#17693, weighted_amount#17695]
Keys [2]: [segment#17687, processing_day#17689]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#17683L, 0.05, 0, 0), partial_sum(events#17693), partial_sum(weighted_amount#17695), partial_avg(amount#17691)]
Aggregate Attributes [57]: [count#17914L, MS[0]#17702L, MS[1]#17703L, MS[2]#17704L, MS[3]#17705L, MS[4]#17706L, MS[5]#17707L, MS[6]#17708L, MS[7]#17709L, MS[8]#17710L, MS[9]#17711L, MS[10]#17712L, MS[11]#17713L, MS[12]#17714L, MS[13]#17715L, MS[14]#17716L, MS[15]#17717L, MS[16]#17718L, MS[17]#17719L, MS[18]#17720L, MS[19]#17721L, MS[20]#17722L, MS[21]#17723L, MS[22]#17724L, MS[23]#17725L, MS[24]#17726L, MS[25]#17727L, MS[26]#17728L, MS[27]#17729L, MS[28]#17730L, MS[29]#17731L, MS[30]#17732L, MS[31]#17733L, MS[32]#17734L, MS[33]#17735L, MS[34]#17736L, MS[35]#17737L, MS[36]#17738L, MS[37]#17739L, MS[38]#17740L, MS[39]#17741L, MS[40]#17742L, MS[41]#17743L, MS[42]#17744L, MS[43]#17745L, MS[44]#17746L, MS[45]#17747L, MS[46]#17748L, MS[47]#17749L, MS[48]#17750L, MS[49]#17751L, MS[50]#17752L, MS[51]#17753L, sum#17915L, sum#17916, sum#17917, count#17918L]
Results [59]: [segment#17687, processing_day#17689, count#17919L, MS[0]#17754L, MS[1]#17755L, MS[2]#17756L, MS[3]#17757L, MS[4]#17758L, MS[5]#17759L, MS[6]#17760L, MS[7]#17761L, MS[8]#17762L, MS[9]#17763L, MS[10]#17764L, MS[11]#17765L, MS[12]#17766L, MS[13]#17767L, MS[14]#17768L, MS[15]#17769L, MS[16]#17770L, MS[17]#17771L, MS[18]#17772L, MS[19]#17773L, MS[20]#17774L, MS[21]#17775L, MS[22]#17776L, MS[23]#17777L, MS[24]#17778L, MS[25]#17779L, MS[26]#17780L, MS[27]#17781L, MS[28]#17782L, MS[29]#17783L, MS[30]#17784L, MS[31]#17785L, MS[32]#17786L, MS[33]#17787L, MS[34]#17788L, MS[35]#17789L, MS[36]#17790L, MS[37]#17791L, MS[38]#17792L, MS[39]#17793L, MS[40]#17794L, MS[41]#17795L, MS[42]#17796L, MS[43]#17797L, MS[44]#17798L, MS[45]#17799L, MS[46]#17800L, MS[47]#17801L, MS[48]#17802L, MS[49]#17803L, MS[50]#17804L, MS[51]#17805L, sum#17920L, sum#17921, sum#17922, count#17923L]
(5) Exchange
Input [59]: [segment#17687, processing_day#17689, count#17919L, MS[0]#17754L, MS[1]#17755L, MS[2]#17756L, MS[3]#17757L, MS[4]#17758L, MS[5]#17759L, MS[6]#17760L, MS[7]#17761L, MS[8]#17762L, MS[9]#17763L, MS[10]#17764L, MS[11]#17765L, MS[12]#17766L, MS[13]#17767L, MS[14]#17768L, MS[15]#17769L, MS[16]#17770L, MS[17]#17771L, MS[18]#17772L, MS[19]#17773L, MS[20]#17774L, MS[21]#17775L, MS[22]#17776L, MS[23]#17777L, MS[24]#17778L, MS[25]#17779L, MS[26]#17780L, MS[27]#17781L, MS[28]#17782L, MS[29]#17783L, MS[30]#17784L, MS[31]#17785L, MS[32]#17786L, MS[33]#17787L, MS[34]#17788L, MS[35]#17789L, MS[36]#17790L, MS[37]#17791L, MS[38]#17792L, MS[39]#17793L, MS[40]#17794L, MS[41]#17795L, MS[42]#17796L, MS[43]#17797L, MS[44]#17798L, MS[45]#17799L, MS[46]#17800L, MS[47]#17801L, MS[48]#17802L, MS[49]#17803L, MS[50]#17804L, MS[51]#17805L, sum#17920L, sum#17921, sum#17922, count#17923L]
Arguments: hashpartitioning(segment#17687, processing_day#17689, 200), ENSURE_REQUIREMENTS, [plan_id=1703]
(6) ShuffleQueryStage
Output [59]: [segment#17687, processing_day#17689, count#17919L, MS[0]#17754L, MS[1]#17755L, MS[2]#17756L, MS[3]#17757L, MS[4]#17758L, MS[5]#17759L, MS[6]#17760L, MS[7]#17761L, MS[8]#17762L, MS[9]#17763L, MS[10]#17764L, MS[11]#17765L, MS[12]#17766L, MS[13]#17767L, MS[14]#17768L, MS[15]#17769L, MS[16]#17770L, MS[17]#17771L, MS[18]#17772L, MS[19]#17773L, MS[20]#17774L, MS[21]#17775L, MS[22]#17776L, MS[23]#17777L, MS[24]#17778L, MS[25]#17779L, MS[26]#17780L, MS[27]#17781L, MS[28]#17782L, MS[29]#17783L, MS[30]#17784L, MS[31]#17785L, MS[32]#17786L, MS[33]#17787L, MS[34]#17788L, MS[35]#17789L, MS[36]#17790L, MS[37]#17791L, MS[38]#17792L, MS[39]#17793L, MS[40]#17794L, MS[41]#17795L, MS[42]#17796L, MS[43]#17797L, MS[44]#17798L, MS[45]#17799L, MS[46]#17800L, MS[47]#17801L, MS[48]#17802L, MS[49]#17803L, MS[50]#17804L, MS[51]#17805L, sum#17920L, sum#17921, sum#17922, count#17923L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#17687, processing_day#17689, count#17919L, MS[0]#17754L, MS[1]#17755L, MS[2]#17756L, MS[3]#17757L, MS[4]#17758L, MS[5]#17759L, MS[6]#17760L, MS[7]#17761L, MS[8]#17762L, MS[9]#17763L, MS[10]#17764L, MS[11]#17765L, MS[12]#17766L, MS[13]#17767L, MS[14]#17768L, MS[15]#17769L, MS[16]#17770L, MS[17]#17771L, MS[18]#17772L, MS[19]#17773L, MS[20]#17774L, MS[21]#17775L, MS[22]#17776L, MS[23]#17777L, MS[24]#17778L, MS[25]#17779L, MS[26]#17780L, MS[27]#17781L, MS[28]#17782L, MS[29]#17783L, MS[30]#17784L, MS[31]#17785L, MS[32]#17786L, MS[33]#17787L, MS[34]#17788L, MS[35]#17789L, MS[36]#17790L, MS[37]#17791L, MS[38]#17792L, MS[39]#17793L, MS[40]#17794L, MS[41]#17795L, MS[42]#17796L, MS[43]#17797L, MS[44]#17798L, MS[45]#17799L, MS[46]#17800L, MS[47]#17801L, MS[48]#17802L, MS[49]#17803L, MS[50]#17804L, MS[51]#17805L, sum#17920L, sum#17921, sum#17922, count#17923L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#17687, processing_day#17689, count#17919L, MS[0]#17754L, MS[1]#17755L, MS[2]#17756L, MS[3]#17757L, MS[4]#17758L, MS[5]#17759L, MS[6]#17760L, MS[7]#17761L, MS[8]#17762L, MS[9]#17763L, MS[10]#17764L, MS[11]#17765L, MS[12]#17766L, MS[13]#17767L, MS[14]#17768L, MS[15]#17769L, MS[16]#17770L, MS[17]#17771L, MS[18]#17772L, MS[19]#17773L, MS[20]#17774L, MS[21]#17775L, MS[22]#17776L, MS[23]#17777L, MS[24]#17778L, MS[25]#17779L, MS[26]#17780L, MS[27]#17781L, MS[28]#17782L, MS[29]#17783L, MS[30]#17784L, MS[31]#17785L, MS[32]#17786L, MS[33]#17787L, MS[34]#17788L, MS[35]#17789L, MS[36]#17790L, MS[37]#17791L, MS[38]#17792L, MS[39]#17793L, MS[40]#17794L, MS[41]#17795L, MS[42]#17796L, MS[43]#17797L, MS[44]#17798L, MS[45]#17799L, MS[46]#17800L, MS[47]#17801L, MS[48]#17802L, MS[49]#17803L, MS[50]#17804L, MS[51]#17805L, sum#17920L, sum#17921, sum#17922, count#17923L]
Keys [2]: [segment#17687, processing_day#17689]
Functions [5]: [count(1), approx_count_distinct(customer_id#17683L, 0.05, 0, 0), sum(events#17693), sum(weighted_amount#17695), avg(amount#17691)]
Aggregate Attributes [5]: [count(1)#17701L, approx_count_distinct(customer_id#17683L, 0.05, 0, 0)#17806L, sum(events#17693)#17807L, sum(weighted_amount#17695)#17808, avg(amount#17691)#17809]
Results [7]: [segment#17687, processing_day#17689, count(1)#17701L AS row_count#17696L, approx_count_distinct(customer_id#17683L, 0.05, 0, 0)#17806L AS unique_customers#17697L, sum(events#17693)#17807L AS event_sum#17698L, sum(weighted_amount#17695)#17808 AS weighted_amount_sum#17699, avg(amount#17691)#17809 AS avg_amount#17700]
(9) Exchange
Input [7]: [segment#17687, processing_day#17689, row_count#17696L, unique_customers#17697L, event_sum#17698L, weighted_amount_sum#17699, avg_amount#17700]
Arguments: rangepartitioning(segment#17687 ASC NULLS FIRST, processing_day#17689 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1725]
(10) ShuffleQueryStage
Output [7]: [segment#17687, processing_day#17689, row_count#17696L, unique_customers#17697L, event_sum#17698L, weighted_amount_sum#17699, avg_amount#17700]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#17687, processing_day#17689, row_count#17696L, unique_customers#17697L, event_sum#17698L, weighted_amount_sum#17699, avg_amount#17700]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#17687, processing_day#17689, row_count#17696L, unique_customers#17697L, event_sum#17698L, weighted_amount_sum#17699, avg_amount#17700]
Arguments: [segment#17687 ASC NULLS FIRST, processing_day#17689 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#17687, processing_day#17689, row_count#17696L, unique_customers#17697L, event_sum#17698L, weighted_amount_sum#17699, avg_amount#17700]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#17683L, segment#17687, processing_day#17689, amount#17691, events#17693, weighted_amount#17695]
Keys [2]: [segment#17687, processing_day#17689]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#17683L, 0.05, 0, 0), partial_sum(events#17693), partial_sum(weighted_amount#17695), partial_avg(amount#17691)]
Aggregate Attributes [57]: [count#17914L, MS[0]#17702L, MS[1]#17703L, MS[2]#17704L, MS[3]#17705L, MS[4]#17706L, MS[5]#17707L, MS[6]#17708L, MS[7]#17709L, MS[8]#17710L, MS[9]#17711L, MS[10]#17712L, MS[11]#17713L, MS[12]#17714L, MS[13]#17715L, MS[14]#17716L, MS[15]#17717L, MS[16]#17718L, MS[17]#17719L, MS[18]#17720L, MS[19]#17721L, MS[20]#17722L, MS[21]#17723L, MS[22]#17724L, MS[23]#17725L, MS[24]#17726L, MS[25]#17727L, MS[26]#17728L, MS[27]#17729L, MS[28]#17730L, MS[29]#17731L, MS[30]#17732L, MS[31]#17733L, MS[32]#17734L, MS[33]#17735L, MS[34]#17736L, MS[35]#17737L, MS[36]#17738L, MS[37]#17739L, MS[38]#17740L, MS[39]#17741L, MS[40]#17742L, MS[41]#17743L, MS[42]#17744L, MS[43]#17745L, MS[44]#17746L, MS[45]#17747L, MS[46]#17748L, MS[47]#17749L, MS[48]#17750L, MS[49]#17751L, MS[50]#17752L, MS[51]#17753L, sum#17915L, sum#17916, sum#17917, count#17918L]
Results [59]: [segment#17687, processing_day#17689, count#17919L, MS[0]#17754L, MS[1]#17755L, MS[2]#17756L, MS[3]#17757L, MS[4]#17758L, MS[5]#17759L, MS[6]#17760L, MS[7]#17761L, MS[8]#17762L, MS[9]#17763L, MS[10]#17764L, MS[11]#17765L, MS[12]#17766L, MS[13]#17767L, MS[14]#17768L, MS[15]#17769L, MS[16]#17770L, MS[17]#17771L, MS[18]#17772L, MS[19]#17773L, MS[20]#17774L, MS[21]#17775L, MS[22]#17776L, MS[23]#17777L, MS[24]#17778L, MS[25]#17779L, MS[26]#17780L, MS[27]#17781L, MS[28]#17782L, MS[29]#17783L, MS[30]#17784L, MS[31]#17785L, MS[32]#17786L, MS[33]#17787L, MS[34]#17788L, MS[35]#17789L, MS[36]#17790L, MS[37]#17791L, MS[38]#17792L, MS[39]#17793L, MS[40]#17794L, MS[41]#17795L, MS[42]#17796L, MS[43]#17797L, MS[44]#17798L, MS[45]#17799L, MS[46]#17800L, MS[47]#17801L, MS[48]#17802L, MS[49]#17803L, MS[50]#17804L, MS[51]#17805L, sum#17920L, sum#17921, sum#17922, count#17923L]
(15) Exchange
Input [59]: [segment#17687, processing_day#17689, count#17919L, MS[0]#17754L, MS[1]#17755L, MS[2]#17756L, MS[3]#17757L, MS[4]#17758L, MS[5]#17759L, MS[6]#17760L, MS[7]#17761L, MS[8]#17762L, MS[9]#17763L, MS[10]#17764L, MS[11]#17765L, MS[12]#17766L, MS[13]#17767L, MS[14]#17768L, MS[15]#17769L, MS[16]#17770L, MS[17]#17771L, MS[18]#17772L, MS[19]#17773L, MS[20]#17774L, MS[21]#17775L, MS[22]#17776L, MS[23]#17777L, MS[24]#17778L, MS[25]#17779L, MS[26]#17780L, MS[27]#17781L, MS[28]#17782L, MS[29]#17783L, MS[30]#17784L, MS[31]#17785L, MS[32]#17786L, MS[33]#17787L, MS[34]#17788L, MS[35]#17789L, MS[36]#17790L, MS[37]#17791L, MS[38]#17792L, MS[39]#17793L, MS[40]#17794L, MS[41]#17795L, MS[42]#17796L, MS[43]#17797L, MS[44]#17798L, MS[45]#17799L, MS[46]#17800L, MS[47]#17801L, MS[48]#17802L, MS[49]#17803L, MS[50]#17804L, MS[51]#17805L, sum#17920L, sum#17921, sum#17922, count#17923L]
Arguments: hashpartitioning(segment#17687, processing_day#17689, 200), ENSURE_REQUIREMENTS, [plan_id=1683]
(16) HashAggregate
Input [59]: [segment#17687, processing_day#17689, count#17919L, MS[0]#17754L, MS[1]#17755L, MS[2]#17756L, MS[3]#17757L, MS[4]#17758L, MS[5]#17759L, MS[6]#17760L, MS[7]#17761L, MS[8]#17762L, MS[9]#17763L, MS[10]#17764L, MS[11]#17765L, MS[12]#17766L, MS[13]#17767L, MS[14]#17768L, MS[15]#17769L, MS[16]#17770L, MS[17]#17771L, MS[18]#17772L, MS[19]#17773L, MS[20]#17774L, MS[21]#17775L, MS[22]#17776L, MS[23]#17777L, MS[24]#17778L, MS[25]#17779L, MS[26]#17780L, MS[27]#17781L, MS[28]#17782L, MS[29]#17783L, MS[30]#17784L, MS[31]#17785L, MS[32]#17786L, MS[33]#17787L, MS[34]#17788L, MS[35]#17789L, MS[36]#17790L, MS[37]#17791L, MS[38]#17792L, MS[39]#17793L, MS[40]#17794L, MS[41]#17795L, MS[42]#17796L, MS[43]#17797L, MS[44]#17798L, MS[45]#17799L, MS[46]#17800L, MS[47]#17801L, MS[48]#17802L, MS[49]#17803L, MS[50]#17804L, MS[51]#17805L, sum#17920L, sum#17921, sum#17922, count#17923L]
Keys [2]: [segment#17687, processing_day#17689]
Functions [5]: [count(1), approx_count_distinct(customer_id#17683L, 0.05, 0, 0), sum(events#17693), sum(weighted_amount#17695), avg(amount#17691)]
Aggregate Attributes [5]: [count(1)#17701L, approx_count_distinct(customer_id#17683L, 0.05, 0, 0)#17806L, sum(events#17693)#17807L, sum(weighted_amount#17695)#17808, avg(amount#17691)#17809]
Results [7]: [segment#17687, processing_day#17689, count(1)#17701L AS row_count#17696L, approx_count_distinct(customer_id#17683L, 0.05, 0, 0)#17806L AS unique_customers#17697L, sum(events#17693)#17807L AS event_sum#17698L, sum(weighted_amount#17695)#17808 AS weighted_amount_sum#17699, avg(amount#17691)#17809 AS avg_amount#17700]
(17) Exchange
Input [7]: [segment#17687, processing_day#17689, row_count#17696L, unique_customers#17697L, event_sum#17698L, weighted_amount_sum#17699, avg_amount#17700]
Arguments: rangepartitioning(segment#17687 ASC NULLS FIRST, processing_day#17689 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1686]
(18) Sort
Input [7]: [segment#17687, processing_day#17689, row_count#17696L, unique_customers#17697L, event_sum#17698L, weighted_amount_sum#17699, avg_amount#17700]
Arguments: [segment#17687 ASC NULLS FIRST, processing_day#17689 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#17687, processing_day#17689, row_count#17696L, unique_customers#17697L, event_sum#17698L, weighted_amount_sum#17699, avg_amount#17700]
Arguments: isFinalPlan=true