== 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#43387L]
Arguments: Range (1000000, 2000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#43387L % 250000) AS customer_id#43389L, concat(segment-, cast(cast((id#43387L % 12) as int) as string)) AS segment#43393, cast((id#43387L % 14) as int) AS processing_day#43395, ((cast(((id#43387L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#43397, cast((((id#43387L * 29) % 7) + 1) as int) AS events#43399]
Input [1]: [id#43387L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#43389L, segment#43393, processing_day#43395, amount#43397, events#43399, (amount#43397 * cast(events#43399 as double)) AS weighted_amount#43401]
Input [5]: [customer_id#43389L, segment#43393, processing_day#43395, amount#43397, events#43399]
(4) HashAggregate
Input [6]: [customer_id#43389L, segment#43393, processing_day#43395, amount#43397, events#43399, weighted_amount#43401]
Keys [2]: [segment#43393, processing_day#43395]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#43389L, 0.05, 0, 0), partial_sum(events#43399), partial_sum(weighted_amount#43401), partial_avg(amount#43397)]
Aggregate Attributes [57]: [count#43620L, MS[0]#43408L, MS[1]#43409L, MS[2]#43410L, MS[3]#43411L, MS[4]#43412L, MS[5]#43413L, MS[6]#43414L, MS[7]#43415L, MS[8]#43416L, MS[9]#43417L, MS[10]#43418L, MS[11]#43419L, MS[12]#43420L, MS[13]#43421L, MS[14]#43422L, MS[15]#43423L, MS[16]#43424L, MS[17]#43425L, MS[18]#43426L, MS[19]#43427L, MS[20]#43428L, MS[21]#43429L, MS[22]#43430L, MS[23]#43431L, MS[24]#43432L, MS[25]#43433L, MS[26]#43434L, MS[27]#43435L, MS[28]#43436L, MS[29]#43437L, MS[30]#43438L, MS[31]#43439L, MS[32]#43440L, MS[33]#43441L, MS[34]#43442L, MS[35]#43443L, MS[36]#43444L, MS[37]#43445L, MS[38]#43446L, MS[39]#43447L, MS[40]#43448L, MS[41]#43449L, MS[42]#43450L, MS[43]#43451L, MS[44]#43452L, MS[45]#43453L, MS[46]#43454L, MS[47]#43455L, MS[48]#43456L, MS[49]#43457L, MS[50]#43458L, MS[51]#43459L, sum#43621L, sum#43622, sum#43623, count#43624L]
Results [59]: [segment#43393, processing_day#43395, count#43625L, MS[0]#43460L, MS[1]#43461L, MS[2]#43462L, MS[3]#43463L, MS[4]#43464L, MS[5]#43465L, MS[6]#43466L, MS[7]#43467L, MS[8]#43468L, MS[9]#43469L, MS[10]#43470L, MS[11]#43471L, MS[12]#43472L, MS[13]#43473L, MS[14]#43474L, MS[15]#43475L, MS[16]#43476L, MS[17]#43477L, MS[18]#43478L, MS[19]#43479L, MS[20]#43480L, MS[21]#43481L, MS[22]#43482L, MS[23]#43483L, MS[24]#43484L, MS[25]#43485L, MS[26]#43486L, MS[27]#43487L, MS[28]#43488L, MS[29]#43489L, MS[30]#43490L, MS[31]#43491L, MS[32]#43492L, MS[33]#43493L, MS[34]#43494L, MS[35]#43495L, MS[36]#43496L, MS[37]#43497L, MS[38]#43498L, MS[39]#43499L, MS[40]#43500L, MS[41]#43501L, MS[42]#43502L, MS[43]#43503L, MS[44]#43504L, MS[45]#43505L, MS[46]#43506L, MS[47]#43507L, MS[48]#43508L, MS[49]#43509L, MS[50]#43510L, MS[51]#43511L, sum#43626L, sum#43627, sum#43628, count#43629L]
(5) Exchange
Input [59]: [segment#43393, processing_day#43395, count#43625L, MS[0]#43460L, MS[1]#43461L, MS[2]#43462L, MS[3]#43463L, MS[4]#43464L, MS[5]#43465L, MS[6]#43466L, MS[7]#43467L, MS[8]#43468L, MS[9]#43469L, MS[10]#43470L, MS[11]#43471L, MS[12]#43472L, MS[13]#43473L, MS[14]#43474L, MS[15]#43475L, MS[16]#43476L, MS[17]#43477L, MS[18]#43478L, MS[19]#43479L, MS[20]#43480L, MS[21]#43481L, MS[22]#43482L, MS[23]#43483L, MS[24]#43484L, MS[25]#43485L, MS[26]#43486L, MS[27]#43487L, MS[28]#43488L, MS[29]#43489L, MS[30]#43490L, MS[31]#43491L, MS[32]#43492L, MS[33]#43493L, MS[34]#43494L, MS[35]#43495L, MS[36]#43496L, MS[37]#43497L, MS[38]#43498L, MS[39]#43499L, MS[40]#43500L, MS[41]#43501L, MS[42]#43502L, MS[43]#43503L, MS[44]#43504L, MS[45]#43505L, MS[46]#43506L, MS[47]#43507L, MS[48]#43508L, MS[49]#43509L, MS[50]#43510L, MS[51]#43511L, sum#43626L, sum#43627, sum#43628, count#43629L]
Arguments: hashpartitioning(segment#43393, processing_day#43395, 200), ENSURE_REQUIREMENTS, [plan_id=4122]
(6) ShuffleQueryStage
Output [59]: [segment#43393, processing_day#43395, count#43625L, MS[0]#43460L, MS[1]#43461L, MS[2]#43462L, MS[3]#43463L, MS[4]#43464L, MS[5]#43465L, MS[6]#43466L, MS[7]#43467L, MS[8]#43468L, MS[9]#43469L, MS[10]#43470L, MS[11]#43471L, MS[12]#43472L, MS[13]#43473L, MS[14]#43474L, MS[15]#43475L, MS[16]#43476L, MS[17]#43477L, MS[18]#43478L, MS[19]#43479L, MS[20]#43480L, MS[21]#43481L, MS[22]#43482L, MS[23]#43483L, MS[24]#43484L, MS[25]#43485L, MS[26]#43486L, MS[27]#43487L, MS[28]#43488L, MS[29]#43489L, MS[30]#43490L, MS[31]#43491L, MS[32]#43492L, MS[33]#43493L, MS[34]#43494L, MS[35]#43495L, MS[36]#43496L, MS[37]#43497L, MS[38]#43498L, MS[39]#43499L, MS[40]#43500L, MS[41]#43501L, MS[42]#43502L, MS[43]#43503L, MS[44]#43504L, MS[45]#43505L, MS[46]#43506L, MS[47]#43507L, MS[48]#43508L, MS[49]#43509L, MS[50]#43510L, MS[51]#43511L, sum#43626L, sum#43627, sum#43628, count#43629L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#43393, processing_day#43395, count#43625L, MS[0]#43460L, MS[1]#43461L, MS[2]#43462L, MS[3]#43463L, MS[4]#43464L, MS[5]#43465L, MS[6]#43466L, MS[7]#43467L, MS[8]#43468L, MS[9]#43469L, MS[10]#43470L, MS[11]#43471L, MS[12]#43472L, MS[13]#43473L, MS[14]#43474L, MS[15]#43475L, MS[16]#43476L, MS[17]#43477L, MS[18]#43478L, MS[19]#43479L, MS[20]#43480L, MS[21]#43481L, MS[22]#43482L, MS[23]#43483L, MS[24]#43484L, MS[25]#43485L, MS[26]#43486L, MS[27]#43487L, MS[28]#43488L, MS[29]#43489L, MS[30]#43490L, MS[31]#43491L, MS[32]#43492L, MS[33]#43493L, MS[34]#43494L, MS[35]#43495L, MS[36]#43496L, MS[37]#43497L, MS[38]#43498L, MS[39]#43499L, MS[40]#43500L, MS[41]#43501L, MS[42]#43502L, MS[43]#43503L, MS[44]#43504L, MS[45]#43505L, MS[46]#43506L, MS[47]#43507L, MS[48]#43508L, MS[49]#43509L, MS[50]#43510L, MS[51]#43511L, sum#43626L, sum#43627, sum#43628, count#43629L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#43393, processing_day#43395, count#43625L, MS[0]#43460L, MS[1]#43461L, MS[2]#43462L, MS[3]#43463L, MS[4]#43464L, MS[5]#43465L, MS[6]#43466L, MS[7]#43467L, MS[8]#43468L, MS[9]#43469L, MS[10]#43470L, MS[11]#43471L, MS[12]#43472L, MS[13]#43473L, MS[14]#43474L, MS[15]#43475L, MS[16]#43476L, MS[17]#43477L, MS[18]#43478L, MS[19]#43479L, MS[20]#43480L, MS[21]#43481L, MS[22]#43482L, MS[23]#43483L, MS[24]#43484L, MS[25]#43485L, MS[26]#43486L, MS[27]#43487L, MS[28]#43488L, MS[29]#43489L, MS[30]#43490L, MS[31]#43491L, MS[32]#43492L, MS[33]#43493L, MS[34]#43494L, MS[35]#43495L, MS[36]#43496L, MS[37]#43497L, MS[38]#43498L, MS[39]#43499L, MS[40]#43500L, MS[41]#43501L, MS[42]#43502L, MS[43]#43503L, MS[44]#43504L, MS[45]#43505L, MS[46]#43506L, MS[47]#43507L, MS[48]#43508L, MS[49]#43509L, MS[50]#43510L, MS[51]#43511L, sum#43626L, sum#43627, sum#43628, count#43629L]
Keys [2]: [segment#43393, processing_day#43395]
Functions [5]: [count(1), approx_count_distinct(customer_id#43389L, 0.05, 0, 0), sum(events#43399), sum(weighted_amount#43401), avg(amount#43397)]
Aggregate Attributes [5]: [count(1)#43407L, approx_count_distinct(customer_id#43389L, 0.05, 0, 0)#43512L, sum(events#43399)#43513L, sum(weighted_amount#43401)#43514, avg(amount#43397)#43515]
Results [7]: [segment#43393, processing_day#43395, count(1)#43407L AS row_count#43402L, approx_count_distinct(customer_id#43389L, 0.05, 0, 0)#43512L AS unique_customers#43403L, sum(events#43399)#43513L AS event_sum#43404L, sum(weighted_amount#43401)#43514 AS weighted_amount_sum#43405, avg(amount#43397)#43515 AS avg_amount#43406]
(9) Exchange
Input [7]: [segment#43393, processing_day#43395, row_count#43402L, unique_customers#43403L, event_sum#43404L, weighted_amount_sum#43405, avg_amount#43406]
Arguments: rangepartitioning(segment#43393 ASC NULLS FIRST, processing_day#43395 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4144]
(10) ShuffleQueryStage
Output [7]: [segment#43393, processing_day#43395, row_count#43402L, unique_customers#43403L, event_sum#43404L, weighted_amount_sum#43405, avg_amount#43406]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#43393, processing_day#43395, row_count#43402L, unique_customers#43403L, event_sum#43404L, weighted_amount_sum#43405, avg_amount#43406]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#43393, processing_day#43395, row_count#43402L, unique_customers#43403L, event_sum#43404L, weighted_amount_sum#43405, avg_amount#43406]
Arguments: [segment#43393 ASC NULLS FIRST, processing_day#43395 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#43393, processing_day#43395, row_count#43402L, unique_customers#43403L, event_sum#43404L, weighted_amount_sum#43405, avg_amount#43406]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#43389L, segment#43393, processing_day#43395, amount#43397, events#43399, weighted_amount#43401]
Keys [2]: [segment#43393, processing_day#43395]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#43389L, 0.05, 0, 0), partial_sum(events#43399), partial_sum(weighted_amount#43401), partial_avg(amount#43397)]
Aggregate Attributes [57]: [count#43620L, MS[0]#43408L, MS[1]#43409L, MS[2]#43410L, MS[3]#43411L, MS[4]#43412L, MS[5]#43413L, MS[6]#43414L, MS[7]#43415L, MS[8]#43416L, MS[9]#43417L, MS[10]#43418L, MS[11]#43419L, MS[12]#43420L, MS[13]#43421L, MS[14]#43422L, MS[15]#43423L, MS[16]#43424L, MS[17]#43425L, MS[18]#43426L, MS[19]#43427L, MS[20]#43428L, MS[21]#43429L, MS[22]#43430L, MS[23]#43431L, MS[24]#43432L, MS[25]#43433L, MS[26]#43434L, MS[27]#43435L, MS[28]#43436L, MS[29]#43437L, MS[30]#43438L, MS[31]#43439L, MS[32]#43440L, MS[33]#43441L, MS[34]#43442L, MS[35]#43443L, MS[36]#43444L, MS[37]#43445L, MS[38]#43446L, MS[39]#43447L, MS[40]#43448L, MS[41]#43449L, MS[42]#43450L, MS[43]#43451L, MS[44]#43452L, MS[45]#43453L, MS[46]#43454L, MS[47]#43455L, MS[48]#43456L, MS[49]#43457L, MS[50]#43458L, MS[51]#43459L, sum#43621L, sum#43622, sum#43623, count#43624L]
Results [59]: [segment#43393, processing_day#43395, count#43625L, MS[0]#43460L, MS[1]#43461L, MS[2]#43462L, MS[3]#43463L, MS[4]#43464L, MS[5]#43465L, MS[6]#43466L, MS[7]#43467L, MS[8]#43468L, MS[9]#43469L, MS[10]#43470L, MS[11]#43471L, MS[12]#43472L, MS[13]#43473L, MS[14]#43474L, MS[15]#43475L, MS[16]#43476L, MS[17]#43477L, MS[18]#43478L, MS[19]#43479L, MS[20]#43480L, MS[21]#43481L, MS[22]#43482L, MS[23]#43483L, MS[24]#43484L, MS[25]#43485L, MS[26]#43486L, MS[27]#43487L, MS[28]#43488L, MS[29]#43489L, MS[30]#43490L, MS[31]#43491L, MS[32]#43492L, MS[33]#43493L, MS[34]#43494L, MS[35]#43495L, MS[36]#43496L, MS[37]#43497L, MS[38]#43498L, MS[39]#43499L, MS[40]#43500L, MS[41]#43501L, MS[42]#43502L, MS[43]#43503L, MS[44]#43504L, MS[45]#43505L, MS[46]#43506L, MS[47]#43507L, MS[48]#43508L, MS[49]#43509L, MS[50]#43510L, MS[51]#43511L, sum#43626L, sum#43627, sum#43628, count#43629L]
(15) Exchange
Input [59]: [segment#43393, processing_day#43395, count#43625L, MS[0]#43460L, MS[1]#43461L, MS[2]#43462L, MS[3]#43463L, MS[4]#43464L, MS[5]#43465L, MS[6]#43466L, MS[7]#43467L, MS[8]#43468L, MS[9]#43469L, MS[10]#43470L, MS[11]#43471L, MS[12]#43472L, MS[13]#43473L, MS[14]#43474L, MS[15]#43475L, MS[16]#43476L, MS[17]#43477L, MS[18]#43478L, MS[19]#43479L, MS[20]#43480L, MS[21]#43481L, MS[22]#43482L, MS[23]#43483L, MS[24]#43484L, MS[25]#43485L, MS[26]#43486L, MS[27]#43487L, MS[28]#43488L, MS[29]#43489L, MS[30]#43490L, MS[31]#43491L, MS[32]#43492L, MS[33]#43493L, MS[34]#43494L, MS[35]#43495L, MS[36]#43496L, MS[37]#43497L, MS[38]#43498L, MS[39]#43499L, MS[40]#43500L, MS[41]#43501L, MS[42]#43502L, MS[43]#43503L, MS[44]#43504L, MS[45]#43505L, MS[46]#43506L, MS[47]#43507L, MS[48]#43508L, MS[49]#43509L, MS[50]#43510L, MS[51]#43511L, sum#43626L, sum#43627, sum#43628, count#43629L]
Arguments: hashpartitioning(segment#43393, processing_day#43395, 200), ENSURE_REQUIREMENTS, [plan_id=4102]
(16) HashAggregate
Input [59]: [segment#43393, processing_day#43395, count#43625L, MS[0]#43460L, MS[1]#43461L, MS[2]#43462L, MS[3]#43463L, MS[4]#43464L, MS[5]#43465L, MS[6]#43466L, MS[7]#43467L, MS[8]#43468L, MS[9]#43469L, MS[10]#43470L, MS[11]#43471L, MS[12]#43472L, MS[13]#43473L, MS[14]#43474L, MS[15]#43475L, MS[16]#43476L, MS[17]#43477L, MS[18]#43478L, MS[19]#43479L, MS[20]#43480L, MS[21]#43481L, MS[22]#43482L, MS[23]#43483L, MS[24]#43484L, MS[25]#43485L, MS[26]#43486L, MS[27]#43487L, MS[28]#43488L, MS[29]#43489L, MS[30]#43490L, MS[31]#43491L, MS[32]#43492L, MS[33]#43493L, MS[34]#43494L, MS[35]#43495L, MS[36]#43496L, MS[37]#43497L, MS[38]#43498L, MS[39]#43499L, MS[40]#43500L, MS[41]#43501L, MS[42]#43502L, MS[43]#43503L, MS[44]#43504L, MS[45]#43505L, MS[46]#43506L, MS[47]#43507L, MS[48]#43508L, MS[49]#43509L, MS[50]#43510L, MS[51]#43511L, sum#43626L, sum#43627, sum#43628, count#43629L]
Keys [2]: [segment#43393, processing_day#43395]
Functions [5]: [count(1), approx_count_distinct(customer_id#43389L, 0.05, 0, 0), sum(events#43399), sum(weighted_amount#43401), avg(amount#43397)]
Aggregate Attributes [5]: [count(1)#43407L, approx_count_distinct(customer_id#43389L, 0.05, 0, 0)#43512L, sum(events#43399)#43513L, sum(weighted_amount#43401)#43514, avg(amount#43397)#43515]
Results [7]: [segment#43393, processing_day#43395, count(1)#43407L AS row_count#43402L, approx_count_distinct(customer_id#43389L, 0.05, 0, 0)#43512L AS unique_customers#43403L, sum(events#43399)#43513L AS event_sum#43404L, sum(weighted_amount#43401)#43514 AS weighted_amount_sum#43405, avg(amount#43397)#43515 AS avg_amount#43406]
(17) Exchange
Input [7]: [segment#43393, processing_day#43395, row_count#43402L, unique_customers#43403L, event_sum#43404L, weighted_amount_sum#43405, avg_amount#43406]
Arguments: rangepartitioning(segment#43393 ASC NULLS FIRST, processing_day#43395 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4105]
(18) Sort
Input [7]: [segment#43393, processing_day#43395, row_count#43402L, unique_customers#43403L, event_sum#43404L, weighted_amount_sum#43405, avg_amount#43406]
Arguments: [segment#43393 ASC NULLS FIRST, processing_day#43395 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#43393, processing_day#43395, row_count#43402L, unique_customers#43403L, event_sum#43404L, weighted_amount_sum#43405, avg_amount#43406]
Arguments: isFinalPlan=true