== 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#100915L]
Arguments: Range (18000000, 19000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#100915L % 250000) AS customer_id#100917L, concat(segment-, cast(cast((id#100915L % 12) as int) as string)) AS segment#100921, cast((id#100915L % 14) as int) AS processing_day#100923, ((cast(((id#100915L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#100925, cast((((id#100915L * 29) % 7) + 1) as int) AS events#100927]
Input [1]: [id#100915L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#100917L, segment#100921, processing_day#100923, amount#100925, events#100927, (amount#100925 * cast(events#100927 as double)) AS weighted_amount#100929]
Input [5]: [customer_id#100917L, segment#100921, processing_day#100923, amount#100925, events#100927]
(4) HashAggregate
Input [6]: [customer_id#100917L, segment#100921, processing_day#100923, amount#100925, events#100927, weighted_amount#100929]
Keys [2]: [segment#100921, processing_day#100923]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#100917L, 0.05, 0, 0), partial_sum(events#100927), partial_sum(weighted_amount#100929), partial_avg(amount#100925)]
Aggregate Attributes [57]: [count#101148L, MS[0]#100936L, MS[1]#100937L, MS[2]#100938L, MS[3]#100939L, MS[4]#100940L, MS[5]#100941L, MS[6]#100942L, MS[7]#100943L, MS[8]#100944L, MS[9]#100945L, MS[10]#100946L, MS[11]#100947L, MS[12]#100948L, MS[13]#100949L, MS[14]#100950L, MS[15]#100951L, MS[16]#100952L, MS[17]#100953L, MS[18]#100954L, MS[19]#100955L, MS[20]#100956L, MS[21]#100957L, MS[22]#100958L, MS[23]#100959L, MS[24]#100960L, MS[25]#100961L, MS[26]#100962L, MS[27]#100963L, MS[28]#100964L, MS[29]#100965L, MS[30]#100966L, MS[31]#100967L, MS[32]#100968L, MS[33]#100969L, MS[34]#100970L, MS[35]#100971L, MS[36]#100972L, MS[37]#100973L, MS[38]#100974L, MS[39]#100975L, MS[40]#100976L, MS[41]#100977L, MS[42]#100978L, MS[43]#100979L, MS[44]#100980L, MS[45]#100981L, MS[46]#100982L, MS[47]#100983L, MS[48]#100984L, MS[49]#100985L, MS[50]#100986L, MS[51]#100987L, sum#101149L, sum#101150, sum#101151, count#101152L]
Results [59]: [segment#100921, processing_day#100923, count#101153L, MS[0]#100988L, MS[1]#100989L, MS[2]#100990L, MS[3]#100991L, MS[4]#100992L, MS[5]#100993L, MS[6]#100994L, MS[7]#100995L, MS[8]#100996L, MS[9]#100997L, MS[10]#100998L, MS[11]#100999L, MS[12]#101000L, MS[13]#101001L, MS[14]#101002L, MS[15]#101003L, MS[16]#101004L, MS[17]#101005L, MS[18]#101006L, MS[19]#101007L, MS[20]#101008L, MS[21]#101009L, MS[22]#101010L, MS[23]#101011L, MS[24]#101012L, MS[25]#101013L, MS[26]#101014L, MS[27]#101015L, MS[28]#101016L, MS[29]#101017L, MS[30]#101018L, MS[31]#101019L, MS[32]#101020L, MS[33]#101021L, MS[34]#101022L, MS[35]#101023L, MS[36]#101024L, MS[37]#101025L, MS[38]#101026L, MS[39]#101027L, MS[40]#101028L, MS[41]#101029L, MS[42]#101030L, MS[43]#101031L, MS[44]#101032L, MS[45]#101033L, MS[46]#101034L, MS[47]#101035L, MS[48]#101036L, MS[49]#101037L, MS[50]#101038L, MS[51]#101039L, sum#101154L, sum#101155, sum#101156, count#101157L]
(5) Exchange
Input [59]: [segment#100921, processing_day#100923, count#101153L, MS[0]#100988L, MS[1]#100989L, MS[2]#100990L, MS[3]#100991L, MS[4]#100992L, MS[5]#100993L, MS[6]#100994L, MS[7]#100995L, MS[8]#100996L, MS[9]#100997L, MS[10]#100998L, MS[11]#100999L, MS[12]#101000L, MS[13]#101001L, MS[14]#101002L, MS[15]#101003L, MS[16]#101004L, MS[17]#101005L, MS[18]#101006L, MS[19]#101007L, MS[20]#101008L, MS[21]#101009L, MS[22]#101010L, MS[23]#101011L, MS[24]#101012L, MS[25]#101013L, MS[26]#101014L, MS[27]#101015L, MS[28]#101016L, MS[29]#101017L, MS[30]#101018L, MS[31]#101019L, MS[32]#101020L, MS[33]#101021L, MS[34]#101022L, MS[35]#101023L, MS[36]#101024L, MS[37]#101025L, MS[38]#101026L, MS[39]#101027L, MS[40]#101028L, MS[41]#101029L, MS[42]#101030L, MS[43]#101031L, MS[44]#101032L, MS[45]#101033L, MS[46]#101034L, MS[47]#101035L, MS[48]#101036L, MS[49]#101037L, MS[50]#101038L, MS[51]#101039L, sum#101154L, sum#101155, sum#101156, count#101157L]
Arguments: hashpartitioning(segment#100921, processing_day#100923, 200), ENSURE_REQUIREMENTS, [plan_id=9529]
(6) ShuffleQueryStage
Output [59]: [segment#100921, processing_day#100923, count#101153L, MS[0]#100988L, MS[1]#100989L, MS[2]#100990L, MS[3]#100991L, MS[4]#100992L, MS[5]#100993L, MS[6]#100994L, MS[7]#100995L, MS[8]#100996L, MS[9]#100997L, MS[10]#100998L, MS[11]#100999L, MS[12]#101000L, MS[13]#101001L, MS[14]#101002L, MS[15]#101003L, MS[16]#101004L, MS[17]#101005L, MS[18]#101006L, MS[19]#101007L, MS[20]#101008L, MS[21]#101009L, MS[22]#101010L, MS[23]#101011L, MS[24]#101012L, MS[25]#101013L, MS[26]#101014L, MS[27]#101015L, MS[28]#101016L, MS[29]#101017L, MS[30]#101018L, MS[31]#101019L, MS[32]#101020L, MS[33]#101021L, MS[34]#101022L, MS[35]#101023L, MS[36]#101024L, MS[37]#101025L, MS[38]#101026L, MS[39]#101027L, MS[40]#101028L, MS[41]#101029L, MS[42]#101030L, MS[43]#101031L, MS[44]#101032L, MS[45]#101033L, MS[46]#101034L, MS[47]#101035L, MS[48]#101036L, MS[49]#101037L, MS[50]#101038L, MS[51]#101039L, sum#101154L, sum#101155, sum#101156, count#101157L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#100921, processing_day#100923, count#101153L, MS[0]#100988L, MS[1]#100989L, MS[2]#100990L, MS[3]#100991L, MS[4]#100992L, MS[5]#100993L, MS[6]#100994L, MS[7]#100995L, MS[8]#100996L, MS[9]#100997L, MS[10]#100998L, MS[11]#100999L, MS[12]#101000L, MS[13]#101001L, MS[14]#101002L, MS[15]#101003L, MS[16]#101004L, MS[17]#101005L, MS[18]#101006L, MS[19]#101007L, MS[20]#101008L, MS[21]#101009L, MS[22]#101010L, MS[23]#101011L, MS[24]#101012L, MS[25]#101013L, MS[26]#101014L, MS[27]#101015L, MS[28]#101016L, MS[29]#101017L, MS[30]#101018L, MS[31]#101019L, MS[32]#101020L, MS[33]#101021L, MS[34]#101022L, MS[35]#101023L, MS[36]#101024L, MS[37]#101025L, MS[38]#101026L, MS[39]#101027L, MS[40]#101028L, MS[41]#101029L, MS[42]#101030L, MS[43]#101031L, MS[44]#101032L, MS[45]#101033L, MS[46]#101034L, MS[47]#101035L, MS[48]#101036L, MS[49]#101037L, MS[50]#101038L, MS[51]#101039L, sum#101154L, sum#101155, sum#101156, count#101157L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#100921, processing_day#100923, count#101153L, MS[0]#100988L, MS[1]#100989L, MS[2]#100990L, MS[3]#100991L, MS[4]#100992L, MS[5]#100993L, MS[6]#100994L, MS[7]#100995L, MS[8]#100996L, MS[9]#100997L, MS[10]#100998L, MS[11]#100999L, MS[12]#101000L, MS[13]#101001L, MS[14]#101002L, MS[15]#101003L, MS[16]#101004L, MS[17]#101005L, MS[18]#101006L, MS[19]#101007L, MS[20]#101008L, MS[21]#101009L, MS[22]#101010L, MS[23]#101011L, MS[24]#101012L, MS[25]#101013L, MS[26]#101014L, MS[27]#101015L, MS[28]#101016L, MS[29]#101017L, MS[30]#101018L, MS[31]#101019L, MS[32]#101020L, MS[33]#101021L, MS[34]#101022L, MS[35]#101023L, MS[36]#101024L, MS[37]#101025L, MS[38]#101026L, MS[39]#101027L, MS[40]#101028L, MS[41]#101029L, MS[42]#101030L, MS[43]#101031L, MS[44]#101032L, MS[45]#101033L, MS[46]#101034L, MS[47]#101035L, MS[48]#101036L, MS[49]#101037L, MS[50]#101038L, MS[51]#101039L, sum#101154L, sum#101155, sum#101156, count#101157L]
Keys [2]: [segment#100921, processing_day#100923]
Functions [5]: [count(1), approx_count_distinct(customer_id#100917L, 0.05, 0, 0), sum(events#100927), sum(weighted_amount#100929), avg(amount#100925)]
Aggregate Attributes [5]: [count(1)#100935L, approx_count_distinct(customer_id#100917L, 0.05, 0, 0)#101040L, sum(events#100927)#101041L, sum(weighted_amount#100929)#101042, avg(amount#100925)#101043]
Results [7]: [segment#100921, processing_day#100923, count(1)#100935L AS row_count#100930L, approx_count_distinct(customer_id#100917L, 0.05, 0, 0)#101040L AS unique_customers#100931L, sum(events#100927)#101041L AS event_sum#100932L, sum(weighted_amount#100929)#101042 AS weighted_amount_sum#100933, avg(amount#100925)#101043 AS avg_amount#100934]
(9) Exchange
Input [7]: [segment#100921, processing_day#100923, row_count#100930L, unique_customers#100931L, event_sum#100932L, weighted_amount_sum#100933, avg_amount#100934]
Arguments: rangepartitioning(segment#100921 ASC NULLS FIRST, processing_day#100923 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9551]
(10) ShuffleQueryStage
Output [7]: [segment#100921, processing_day#100923, row_count#100930L, unique_customers#100931L, event_sum#100932L, weighted_amount_sum#100933, avg_amount#100934]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#100921, processing_day#100923, row_count#100930L, unique_customers#100931L, event_sum#100932L, weighted_amount_sum#100933, avg_amount#100934]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#100921, processing_day#100923, row_count#100930L, unique_customers#100931L, event_sum#100932L, weighted_amount_sum#100933, avg_amount#100934]
Arguments: [segment#100921 ASC NULLS FIRST, processing_day#100923 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#100921, processing_day#100923, row_count#100930L, unique_customers#100931L, event_sum#100932L, weighted_amount_sum#100933, avg_amount#100934]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#100917L, segment#100921, processing_day#100923, amount#100925, events#100927, weighted_amount#100929]
Keys [2]: [segment#100921, processing_day#100923]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#100917L, 0.05, 0, 0), partial_sum(events#100927), partial_sum(weighted_amount#100929), partial_avg(amount#100925)]
Aggregate Attributes [57]: [count#101148L, MS[0]#100936L, MS[1]#100937L, MS[2]#100938L, MS[3]#100939L, MS[4]#100940L, MS[5]#100941L, MS[6]#100942L, MS[7]#100943L, MS[8]#100944L, MS[9]#100945L, MS[10]#100946L, MS[11]#100947L, MS[12]#100948L, MS[13]#100949L, MS[14]#100950L, MS[15]#100951L, MS[16]#100952L, MS[17]#100953L, MS[18]#100954L, MS[19]#100955L, MS[20]#100956L, MS[21]#100957L, MS[22]#100958L, MS[23]#100959L, MS[24]#100960L, MS[25]#100961L, MS[26]#100962L, MS[27]#100963L, MS[28]#100964L, MS[29]#100965L, MS[30]#100966L, MS[31]#100967L, MS[32]#100968L, MS[33]#100969L, MS[34]#100970L, MS[35]#100971L, MS[36]#100972L, MS[37]#100973L, MS[38]#100974L, MS[39]#100975L, MS[40]#100976L, MS[41]#100977L, MS[42]#100978L, MS[43]#100979L, MS[44]#100980L, MS[45]#100981L, MS[46]#100982L, MS[47]#100983L, MS[48]#100984L, MS[49]#100985L, MS[50]#100986L, MS[51]#100987L, sum#101149L, sum#101150, sum#101151, count#101152L]
Results [59]: [segment#100921, processing_day#100923, count#101153L, MS[0]#100988L, MS[1]#100989L, MS[2]#100990L, MS[3]#100991L, MS[4]#100992L, MS[5]#100993L, MS[6]#100994L, MS[7]#100995L, MS[8]#100996L, MS[9]#100997L, MS[10]#100998L, MS[11]#100999L, MS[12]#101000L, MS[13]#101001L, MS[14]#101002L, MS[15]#101003L, MS[16]#101004L, MS[17]#101005L, MS[18]#101006L, MS[19]#101007L, MS[20]#101008L, MS[21]#101009L, MS[22]#101010L, MS[23]#101011L, MS[24]#101012L, MS[25]#101013L, MS[26]#101014L, MS[27]#101015L, MS[28]#101016L, MS[29]#101017L, MS[30]#101018L, MS[31]#101019L, MS[32]#101020L, MS[33]#101021L, MS[34]#101022L, MS[35]#101023L, MS[36]#101024L, MS[37]#101025L, MS[38]#101026L, MS[39]#101027L, MS[40]#101028L, MS[41]#101029L, MS[42]#101030L, MS[43]#101031L, MS[44]#101032L, MS[45]#101033L, MS[46]#101034L, MS[47]#101035L, MS[48]#101036L, MS[49]#101037L, MS[50]#101038L, MS[51]#101039L, sum#101154L, sum#101155, sum#101156, count#101157L]
(15) Exchange
Input [59]: [segment#100921, processing_day#100923, count#101153L, MS[0]#100988L, MS[1]#100989L, MS[2]#100990L, MS[3]#100991L, MS[4]#100992L, MS[5]#100993L, MS[6]#100994L, MS[7]#100995L, MS[8]#100996L, MS[9]#100997L, MS[10]#100998L, MS[11]#100999L, MS[12]#101000L, MS[13]#101001L, MS[14]#101002L, MS[15]#101003L, MS[16]#101004L, MS[17]#101005L, MS[18]#101006L, MS[19]#101007L, MS[20]#101008L, MS[21]#101009L, MS[22]#101010L, MS[23]#101011L, MS[24]#101012L, MS[25]#101013L, MS[26]#101014L, MS[27]#101015L, MS[28]#101016L, MS[29]#101017L, MS[30]#101018L, MS[31]#101019L, MS[32]#101020L, MS[33]#101021L, MS[34]#101022L, MS[35]#101023L, MS[36]#101024L, MS[37]#101025L, MS[38]#101026L, MS[39]#101027L, MS[40]#101028L, MS[41]#101029L, MS[42]#101030L, MS[43]#101031L, MS[44]#101032L, MS[45]#101033L, MS[46]#101034L, MS[47]#101035L, MS[48]#101036L, MS[49]#101037L, MS[50]#101038L, MS[51]#101039L, sum#101154L, sum#101155, sum#101156, count#101157L]
Arguments: hashpartitioning(segment#100921, processing_day#100923, 200), ENSURE_REQUIREMENTS, [plan_id=9509]
(16) HashAggregate
Input [59]: [segment#100921, processing_day#100923, count#101153L, MS[0]#100988L, MS[1]#100989L, MS[2]#100990L, MS[3]#100991L, MS[4]#100992L, MS[5]#100993L, MS[6]#100994L, MS[7]#100995L, MS[8]#100996L, MS[9]#100997L, MS[10]#100998L, MS[11]#100999L, MS[12]#101000L, MS[13]#101001L, MS[14]#101002L, MS[15]#101003L, MS[16]#101004L, MS[17]#101005L, MS[18]#101006L, MS[19]#101007L, MS[20]#101008L, MS[21]#101009L, MS[22]#101010L, MS[23]#101011L, MS[24]#101012L, MS[25]#101013L, MS[26]#101014L, MS[27]#101015L, MS[28]#101016L, MS[29]#101017L, MS[30]#101018L, MS[31]#101019L, MS[32]#101020L, MS[33]#101021L, MS[34]#101022L, MS[35]#101023L, MS[36]#101024L, MS[37]#101025L, MS[38]#101026L, MS[39]#101027L, MS[40]#101028L, MS[41]#101029L, MS[42]#101030L, MS[43]#101031L, MS[44]#101032L, MS[45]#101033L, MS[46]#101034L, MS[47]#101035L, MS[48]#101036L, MS[49]#101037L, MS[50]#101038L, MS[51]#101039L, sum#101154L, sum#101155, sum#101156, count#101157L]
Keys [2]: [segment#100921, processing_day#100923]
Functions [5]: [count(1), approx_count_distinct(customer_id#100917L, 0.05, 0, 0), sum(events#100927), sum(weighted_amount#100929), avg(amount#100925)]
Aggregate Attributes [5]: [count(1)#100935L, approx_count_distinct(customer_id#100917L, 0.05, 0, 0)#101040L, sum(events#100927)#101041L, sum(weighted_amount#100929)#101042, avg(amount#100925)#101043]
Results [7]: [segment#100921, processing_day#100923, count(1)#100935L AS row_count#100930L, approx_count_distinct(customer_id#100917L, 0.05, 0, 0)#101040L AS unique_customers#100931L, sum(events#100927)#101041L AS event_sum#100932L, sum(weighted_amount#100929)#101042 AS weighted_amount_sum#100933, avg(amount#100925)#101043 AS avg_amount#100934]
(17) Exchange
Input [7]: [segment#100921, processing_day#100923, row_count#100930L, unique_customers#100931L, event_sum#100932L, weighted_amount_sum#100933, avg_amount#100934]
Arguments: rangepartitioning(segment#100921 ASC NULLS FIRST, processing_day#100923 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9512]
(18) Sort
Input [7]: [segment#100921, processing_day#100923, row_count#100930L, unique_customers#100931L, event_sum#100932L, weighted_amount_sum#100933, avg_amount#100934]
Arguments: [segment#100921 ASC NULLS FIRST, processing_day#100923 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#100921, processing_day#100923, row_count#100930L, unique_customers#100931L, event_sum#100932L, weighted_amount_sum#100933, avg_amount#100934]
Arguments: isFinalPlan=true