== 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#81433L]
Arguments: Range (20000000, 21000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#81433L % 250000) AS customer_id#81435L, concat(segment-, cast(cast((id#81433L % 12) as int) as string)) AS segment#81439, cast((id#81433L % 14) as int) AS processing_day#81441, ((cast(((id#81433L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#81443, cast((((id#81433L * 29) % 7) + 1) as int) AS events#81445]
Input [1]: [id#81433L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#81435L, segment#81439, processing_day#81441, amount#81443, events#81445, (amount#81443 * cast(events#81445 as double)) AS weighted_amount#81447]
Input [5]: [customer_id#81435L, segment#81439, processing_day#81441, amount#81443, events#81445]
(4) HashAggregate
Input [6]: [customer_id#81435L, segment#81439, processing_day#81441, amount#81443, events#81445, weighted_amount#81447]
Keys [2]: [segment#81439, processing_day#81441]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#81435L, 0.05, 0, 0), partial_sum(events#81445), partial_sum(weighted_amount#81447), partial_avg(amount#81443)]
Aggregate Attributes [57]: [count#81666L, MS[0]#81454L, MS[1]#81455L, MS[2]#81456L, MS[3]#81457L, MS[4]#81458L, MS[5]#81459L, MS[6]#81460L, MS[7]#81461L, MS[8]#81462L, MS[9]#81463L, MS[10]#81464L, MS[11]#81465L, MS[12]#81466L, MS[13]#81467L, MS[14]#81468L, MS[15]#81469L, MS[16]#81470L, MS[17]#81471L, MS[18]#81472L, MS[19]#81473L, MS[20]#81474L, MS[21]#81475L, MS[22]#81476L, MS[23]#81477L, MS[24]#81478L, MS[25]#81479L, MS[26]#81480L, MS[27]#81481L, MS[28]#81482L, MS[29]#81483L, MS[30]#81484L, MS[31]#81485L, MS[32]#81486L, MS[33]#81487L, MS[34]#81488L, MS[35]#81489L, MS[36]#81490L, MS[37]#81491L, MS[38]#81492L, MS[39]#81493L, MS[40]#81494L, MS[41]#81495L, MS[42]#81496L, MS[43]#81497L, MS[44]#81498L, MS[45]#81499L, MS[46]#81500L, MS[47]#81501L, MS[48]#81502L, MS[49]#81503L, MS[50]#81504L, MS[51]#81505L, sum#81667L, sum#81668, sum#81669, count#81670L]
Results [59]: [segment#81439, processing_day#81441, count#81671L, MS[0]#81506L, MS[1]#81507L, MS[2]#81508L, MS[3]#81509L, MS[4]#81510L, MS[5]#81511L, MS[6]#81512L, MS[7]#81513L, MS[8]#81514L, MS[9]#81515L, MS[10]#81516L, MS[11]#81517L, MS[12]#81518L, MS[13]#81519L, MS[14]#81520L, MS[15]#81521L, MS[16]#81522L, MS[17]#81523L, MS[18]#81524L, MS[19]#81525L, MS[20]#81526L, MS[21]#81527L, MS[22]#81528L, MS[23]#81529L, MS[24]#81530L, MS[25]#81531L, MS[26]#81532L, MS[27]#81533L, MS[28]#81534L, MS[29]#81535L, MS[30]#81536L, MS[31]#81537L, MS[32]#81538L, MS[33]#81539L, MS[34]#81540L, MS[35]#81541L, MS[36]#81542L, MS[37]#81543L, MS[38]#81544L, MS[39]#81545L, MS[40]#81546L, MS[41]#81547L, MS[42]#81548L, MS[43]#81549L, MS[44]#81550L, MS[45]#81551L, MS[46]#81552L, MS[47]#81553L, MS[48]#81554L, MS[49]#81555L, MS[50]#81556L, MS[51]#81557L, sum#81672L, sum#81673, sum#81674, count#81675L]
(5) Exchange
Input [59]: [segment#81439, processing_day#81441, count#81671L, MS[0]#81506L, MS[1]#81507L, MS[2]#81508L, MS[3]#81509L, MS[4]#81510L, MS[5]#81511L, MS[6]#81512L, MS[7]#81513L, MS[8]#81514L, MS[9]#81515L, MS[10]#81516L, MS[11]#81517L, MS[12]#81518L, MS[13]#81519L, MS[14]#81520L, MS[15]#81521L, MS[16]#81522L, MS[17]#81523L, MS[18]#81524L, MS[19]#81525L, MS[20]#81526L, MS[21]#81527L, MS[22]#81528L, MS[23]#81529L, MS[24]#81530L, MS[25]#81531L, MS[26]#81532L, MS[27]#81533L, MS[28]#81534L, MS[29]#81535L, MS[30]#81536L, MS[31]#81537L, MS[32]#81538L, MS[33]#81539L, MS[34]#81540L, MS[35]#81541L, MS[36]#81542L, MS[37]#81543L, MS[38]#81544L, MS[39]#81545L, MS[40]#81546L, MS[41]#81547L, MS[42]#81548L, MS[43]#81549L, MS[44]#81550L, MS[45]#81551L, MS[46]#81552L, MS[47]#81553L, MS[48]#81554L, MS[49]#81555L, MS[50]#81556L, MS[51]#81557L, sum#81672L, sum#81673, sum#81674, count#81675L]
Arguments: hashpartitioning(segment#81439, processing_day#81441, 200), ENSURE_REQUIREMENTS, [plan_id=7697]
(6) ShuffleQueryStage
Output [59]: [segment#81439, processing_day#81441, count#81671L, MS[0]#81506L, MS[1]#81507L, MS[2]#81508L, MS[3]#81509L, MS[4]#81510L, MS[5]#81511L, MS[6]#81512L, MS[7]#81513L, MS[8]#81514L, MS[9]#81515L, MS[10]#81516L, MS[11]#81517L, MS[12]#81518L, MS[13]#81519L, MS[14]#81520L, MS[15]#81521L, MS[16]#81522L, MS[17]#81523L, MS[18]#81524L, MS[19]#81525L, MS[20]#81526L, MS[21]#81527L, MS[22]#81528L, MS[23]#81529L, MS[24]#81530L, MS[25]#81531L, MS[26]#81532L, MS[27]#81533L, MS[28]#81534L, MS[29]#81535L, MS[30]#81536L, MS[31]#81537L, MS[32]#81538L, MS[33]#81539L, MS[34]#81540L, MS[35]#81541L, MS[36]#81542L, MS[37]#81543L, MS[38]#81544L, MS[39]#81545L, MS[40]#81546L, MS[41]#81547L, MS[42]#81548L, MS[43]#81549L, MS[44]#81550L, MS[45]#81551L, MS[46]#81552L, MS[47]#81553L, MS[48]#81554L, MS[49]#81555L, MS[50]#81556L, MS[51]#81557L, sum#81672L, sum#81673, sum#81674, count#81675L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#81439, processing_day#81441, count#81671L, MS[0]#81506L, MS[1]#81507L, MS[2]#81508L, MS[3]#81509L, MS[4]#81510L, MS[5]#81511L, MS[6]#81512L, MS[7]#81513L, MS[8]#81514L, MS[9]#81515L, MS[10]#81516L, MS[11]#81517L, MS[12]#81518L, MS[13]#81519L, MS[14]#81520L, MS[15]#81521L, MS[16]#81522L, MS[17]#81523L, MS[18]#81524L, MS[19]#81525L, MS[20]#81526L, MS[21]#81527L, MS[22]#81528L, MS[23]#81529L, MS[24]#81530L, MS[25]#81531L, MS[26]#81532L, MS[27]#81533L, MS[28]#81534L, MS[29]#81535L, MS[30]#81536L, MS[31]#81537L, MS[32]#81538L, MS[33]#81539L, MS[34]#81540L, MS[35]#81541L, MS[36]#81542L, MS[37]#81543L, MS[38]#81544L, MS[39]#81545L, MS[40]#81546L, MS[41]#81547L, MS[42]#81548L, MS[43]#81549L, MS[44]#81550L, MS[45]#81551L, MS[46]#81552L, MS[47]#81553L, MS[48]#81554L, MS[49]#81555L, MS[50]#81556L, MS[51]#81557L, sum#81672L, sum#81673, sum#81674, count#81675L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#81439, processing_day#81441, count#81671L, MS[0]#81506L, MS[1]#81507L, MS[2]#81508L, MS[3]#81509L, MS[4]#81510L, MS[5]#81511L, MS[6]#81512L, MS[7]#81513L, MS[8]#81514L, MS[9]#81515L, MS[10]#81516L, MS[11]#81517L, MS[12]#81518L, MS[13]#81519L, MS[14]#81520L, MS[15]#81521L, MS[16]#81522L, MS[17]#81523L, MS[18]#81524L, MS[19]#81525L, MS[20]#81526L, MS[21]#81527L, MS[22]#81528L, MS[23]#81529L, MS[24]#81530L, MS[25]#81531L, MS[26]#81532L, MS[27]#81533L, MS[28]#81534L, MS[29]#81535L, MS[30]#81536L, MS[31]#81537L, MS[32]#81538L, MS[33]#81539L, MS[34]#81540L, MS[35]#81541L, MS[36]#81542L, MS[37]#81543L, MS[38]#81544L, MS[39]#81545L, MS[40]#81546L, MS[41]#81547L, MS[42]#81548L, MS[43]#81549L, MS[44]#81550L, MS[45]#81551L, MS[46]#81552L, MS[47]#81553L, MS[48]#81554L, MS[49]#81555L, MS[50]#81556L, MS[51]#81557L, sum#81672L, sum#81673, sum#81674, count#81675L]
Keys [2]: [segment#81439, processing_day#81441]
Functions [5]: [count(1), approx_count_distinct(customer_id#81435L, 0.05, 0, 0), sum(events#81445), sum(weighted_amount#81447), avg(amount#81443)]
Aggregate Attributes [5]: [count(1)#81453L, approx_count_distinct(customer_id#81435L, 0.05, 0, 0)#81558L, sum(events#81445)#81559L, sum(weighted_amount#81447)#81560, avg(amount#81443)#81561]
Results [7]: [segment#81439, processing_day#81441, count(1)#81453L AS row_count#81448L, approx_count_distinct(customer_id#81435L, 0.05, 0, 0)#81558L AS unique_customers#81449L, sum(events#81445)#81559L AS event_sum#81450L, sum(weighted_amount#81447)#81560 AS weighted_amount_sum#81451, avg(amount#81443)#81561 AS avg_amount#81452]
(9) Exchange
Input [7]: [segment#81439, processing_day#81441, row_count#81448L, unique_customers#81449L, event_sum#81450L, weighted_amount_sum#81451, avg_amount#81452]
Arguments: rangepartitioning(segment#81439 ASC NULLS FIRST, processing_day#81441 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=7719]
(10) ShuffleQueryStage
Output [7]: [segment#81439, processing_day#81441, row_count#81448L, unique_customers#81449L, event_sum#81450L, weighted_amount_sum#81451, avg_amount#81452]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#81439, processing_day#81441, row_count#81448L, unique_customers#81449L, event_sum#81450L, weighted_amount_sum#81451, avg_amount#81452]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#81439, processing_day#81441, row_count#81448L, unique_customers#81449L, event_sum#81450L, weighted_amount_sum#81451, avg_amount#81452]
Arguments: [segment#81439 ASC NULLS FIRST, processing_day#81441 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#81439, processing_day#81441, row_count#81448L, unique_customers#81449L, event_sum#81450L, weighted_amount_sum#81451, avg_amount#81452]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#81435L, segment#81439, processing_day#81441, amount#81443, events#81445, weighted_amount#81447]
Keys [2]: [segment#81439, processing_day#81441]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#81435L, 0.05, 0, 0), partial_sum(events#81445), partial_sum(weighted_amount#81447), partial_avg(amount#81443)]
Aggregate Attributes [57]: [count#81666L, MS[0]#81454L, MS[1]#81455L, MS[2]#81456L, MS[3]#81457L, MS[4]#81458L, MS[5]#81459L, MS[6]#81460L, MS[7]#81461L, MS[8]#81462L, MS[9]#81463L, MS[10]#81464L, MS[11]#81465L, MS[12]#81466L, MS[13]#81467L, MS[14]#81468L, MS[15]#81469L, MS[16]#81470L, MS[17]#81471L, MS[18]#81472L, MS[19]#81473L, MS[20]#81474L, MS[21]#81475L, MS[22]#81476L, MS[23]#81477L, MS[24]#81478L, MS[25]#81479L, MS[26]#81480L, MS[27]#81481L, MS[28]#81482L, MS[29]#81483L, MS[30]#81484L, MS[31]#81485L, MS[32]#81486L, MS[33]#81487L, MS[34]#81488L, MS[35]#81489L, MS[36]#81490L, MS[37]#81491L, MS[38]#81492L, MS[39]#81493L, MS[40]#81494L, MS[41]#81495L, MS[42]#81496L, MS[43]#81497L, MS[44]#81498L, MS[45]#81499L, MS[46]#81500L, MS[47]#81501L, MS[48]#81502L, MS[49]#81503L, MS[50]#81504L, MS[51]#81505L, sum#81667L, sum#81668, sum#81669, count#81670L]
Results [59]: [segment#81439, processing_day#81441, count#81671L, MS[0]#81506L, MS[1]#81507L, MS[2]#81508L, MS[3]#81509L, MS[4]#81510L, MS[5]#81511L, MS[6]#81512L, MS[7]#81513L, MS[8]#81514L, MS[9]#81515L, MS[10]#81516L, MS[11]#81517L, MS[12]#81518L, MS[13]#81519L, MS[14]#81520L, MS[15]#81521L, MS[16]#81522L, MS[17]#81523L, MS[18]#81524L, MS[19]#81525L, MS[20]#81526L, MS[21]#81527L, MS[22]#81528L, MS[23]#81529L, MS[24]#81530L, MS[25]#81531L, MS[26]#81532L, MS[27]#81533L, MS[28]#81534L, MS[29]#81535L, MS[30]#81536L, MS[31]#81537L, MS[32]#81538L, MS[33]#81539L, MS[34]#81540L, MS[35]#81541L, MS[36]#81542L, MS[37]#81543L, MS[38]#81544L, MS[39]#81545L, MS[40]#81546L, MS[41]#81547L, MS[42]#81548L, MS[43]#81549L, MS[44]#81550L, MS[45]#81551L, MS[46]#81552L, MS[47]#81553L, MS[48]#81554L, MS[49]#81555L, MS[50]#81556L, MS[51]#81557L, sum#81672L, sum#81673, sum#81674, count#81675L]
(15) Exchange
Input [59]: [segment#81439, processing_day#81441, count#81671L, MS[0]#81506L, MS[1]#81507L, MS[2]#81508L, MS[3]#81509L, MS[4]#81510L, MS[5]#81511L, MS[6]#81512L, MS[7]#81513L, MS[8]#81514L, MS[9]#81515L, MS[10]#81516L, MS[11]#81517L, MS[12]#81518L, MS[13]#81519L, MS[14]#81520L, MS[15]#81521L, MS[16]#81522L, MS[17]#81523L, MS[18]#81524L, MS[19]#81525L, MS[20]#81526L, MS[21]#81527L, MS[22]#81528L, MS[23]#81529L, MS[24]#81530L, MS[25]#81531L, MS[26]#81532L, MS[27]#81533L, MS[28]#81534L, MS[29]#81535L, MS[30]#81536L, MS[31]#81537L, MS[32]#81538L, MS[33]#81539L, MS[34]#81540L, MS[35]#81541L, MS[36]#81542L, MS[37]#81543L, MS[38]#81544L, MS[39]#81545L, MS[40]#81546L, MS[41]#81547L, MS[42]#81548L, MS[43]#81549L, MS[44]#81550L, MS[45]#81551L, MS[46]#81552L, MS[47]#81553L, MS[48]#81554L, MS[49]#81555L, MS[50]#81556L, MS[51]#81557L, sum#81672L, sum#81673, sum#81674, count#81675L]
Arguments: hashpartitioning(segment#81439, processing_day#81441, 200), ENSURE_REQUIREMENTS, [plan_id=7677]
(16) HashAggregate
Input [59]: [segment#81439, processing_day#81441, count#81671L, MS[0]#81506L, MS[1]#81507L, MS[2]#81508L, MS[3]#81509L, MS[4]#81510L, MS[5]#81511L, MS[6]#81512L, MS[7]#81513L, MS[8]#81514L, MS[9]#81515L, MS[10]#81516L, MS[11]#81517L, MS[12]#81518L, MS[13]#81519L, MS[14]#81520L, MS[15]#81521L, MS[16]#81522L, MS[17]#81523L, MS[18]#81524L, MS[19]#81525L, MS[20]#81526L, MS[21]#81527L, MS[22]#81528L, MS[23]#81529L, MS[24]#81530L, MS[25]#81531L, MS[26]#81532L, MS[27]#81533L, MS[28]#81534L, MS[29]#81535L, MS[30]#81536L, MS[31]#81537L, MS[32]#81538L, MS[33]#81539L, MS[34]#81540L, MS[35]#81541L, MS[36]#81542L, MS[37]#81543L, MS[38]#81544L, MS[39]#81545L, MS[40]#81546L, MS[41]#81547L, MS[42]#81548L, MS[43]#81549L, MS[44]#81550L, MS[45]#81551L, MS[46]#81552L, MS[47]#81553L, MS[48]#81554L, MS[49]#81555L, MS[50]#81556L, MS[51]#81557L, sum#81672L, sum#81673, sum#81674, count#81675L]
Keys [2]: [segment#81439, processing_day#81441]
Functions [5]: [count(1), approx_count_distinct(customer_id#81435L, 0.05, 0, 0), sum(events#81445), sum(weighted_amount#81447), avg(amount#81443)]
Aggregate Attributes [5]: [count(1)#81453L, approx_count_distinct(customer_id#81435L, 0.05, 0, 0)#81558L, sum(events#81445)#81559L, sum(weighted_amount#81447)#81560, avg(amount#81443)#81561]
Results [7]: [segment#81439, processing_day#81441, count(1)#81453L AS row_count#81448L, approx_count_distinct(customer_id#81435L, 0.05, 0, 0)#81558L AS unique_customers#81449L, sum(events#81445)#81559L AS event_sum#81450L, sum(weighted_amount#81447)#81560 AS weighted_amount_sum#81451, avg(amount#81443)#81561 AS avg_amount#81452]
(17) Exchange
Input [7]: [segment#81439, processing_day#81441, row_count#81448L, unique_customers#81449L, event_sum#81450L, weighted_amount_sum#81451, avg_amount#81452]
Arguments: rangepartitioning(segment#81439 ASC NULLS FIRST, processing_day#81441 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=7680]
(18) Sort
Input [7]: [segment#81439, processing_day#81441, row_count#81448L, unique_customers#81449L, event_sum#81450L, weighted_amount_sum#81451, avg_amount#81452]
Arguments: [segment#81439 ASC NULLS FIRST, processing_day#81441 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#81439, processing_day#81441, row_count#81448L, unique_customers#81449L, event_sum#81450L, weighted_amount_sum#81451, avg_amount#81452]
Arguments: isFinalPlan=true