== 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#32745L]
Arguments: Range (13000000, 14000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#32745L % 250000) AS customer_id#32747L, concat(segment-, cast(cast((id#32745L % 12) as int) as string)) AS segment#32751, cast((id#32745L % 14) as int) AS processing_day#32753, ((cast(((id#32745L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#32755, cast((((id#32745L * 29) % 7) + 1) as int) AS events#32757]
Input [1]: [id#32745L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#32747L, segment#32751, processing_day#32753, amount#32755, events#32757, (amount#32755 * cast(events#32757 as double)) AS weighted_amount#32759]
Input [5]: [customer_id#32747L, segment#32751, processing_day#32753, amount#32755, events#32757]
(4) HashAggregate
Input [6]: [customer_id#32747L, segment#32751, processing_day#32753, amount#32755, events#32757, weighted_amount#32759]
Keys [2]: [segment#32751, processing_day#32753]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#32747L, 0.05, 0, 0), partial_sum(events#32757), partial_sum(weighted_amount#32759), partial_avg(amount#32755)]
Aggregate Attributes [57]: [count#32978L, MS[0]#32766L, MS[1]#32767L, MS[2]#32768L, MS[3]#32769L, MS[4]#32770L, MS[5]#32771L, MS[6]#32772L, MS[7]#32773L, MS[8]#32774L, MS[9]#32775L, MS[10]#32776L, MS[11]#32777L, MS[12]#32778L, MS[13]#32779L, MS[14]#32780L, MS[15]#32781L, MS[16]#32782L, MS[17]#32783L, MS[18]#32784L, MS[19]#32785L, MS[20]#32786L, MS[21]#32787L, MS[22]#32788L, MS[23]#32789L, MS[24]#32790L, MS[25]#32791L, MS[26]#32792L, MS[27]#32793L, MS[28]#32794L, MS[29]#32795L, MS[30]#32796L, MS[31]#32797L, MS[32]#32798L, MS[33]#32799L, MS[34]#32800L, MS[35]#32801L, MS[36]#32802L, MS[37]#32803L, MS[38]#32804L, MS[39]#32805L, MS[40]#32806L, MS[41]#32807L, MS[42]#32808L, MS[43]#32809L, MS[44]#32810L, MS[45]#32811L, MS[46]#32812L, MS[47]#32813L, MS[48]#32814L, MS[49]#32815L, MS[50]#32816L, MS[51]#32817L, sum#32979L, sum#32980, sum#32981, count#32982L]
Results [59]: [segment#32751, processing_day#32753, count#32983L, MS[0]#32818L, MS[1]#32819L, MS[2]#32820L, MS[3]#32821L, MS[4]#32822L, MS[5]#32823L, MS[6]#32824L, MS[7]#32825L, MS[8]#32826L, MS[9]#32827L, MS[10]#32828L, MS[11]#32829L, MS[12]#32830L, MS[13]#32831L, MS[14]#32832L, MS[15]#32833L, MS[16]#32834L, MS[17]#32835L, MS[18]#32836L, MS[19]#32837L, MS[20]#32838L, MS[21]#32839L, MS[22]#32840L, MS[23]#32841L, MS[24]#32842L, MS[25]#32843L, MS[26]#32844L, MS[27]#32845L, MS[28]#32846L, MS[29]#32847L, MS[30]#32848L, MS[31]#32849L, MS[32]#32850L, MS[33]#32851L, MS[34]#32852L, MS[35]#32853L, MS[36]#32854L, MS[37]#32855L, MS[38]#32856L, MS[39]#32857L, MS[40]#32858L, MS[41]#32859L, MS[42]#32860L, MS[43]#32861L, MS[44]#32862L, MS[45]#32863L, MS[46]#32864L, MS[47]#32865L, MS[48]#32866L, MS[49]#32867L, MS[50]#32868L, MS[51]#32869L, sum#32984L, sum#32985, sum#32986, count#32987L]
(5) Exchange
Input [59]: [segment#32751, processing_day#32753, count#32983L, MS[0]#32818L, MS[1]#32819L, MS[2]#32820L, MS[3]#32821L, MS[4]#32822L, MS[5]#32823L, MS[6]#32824L, MS[7]#32825L, MS[8]#32826L, MS[9]#32827L, MS[10]#32828L, MS[11]#32829L, MS[12]#32830L, MS[13]#32831L, MS[14]#32832L, MS[15]#32833L, MS[16]#32834L, MS[17]#32835L, MS[18]#32836L, MS[19]#32837L, MS[20]#32838L, MS[21]#32839L, MS[22]#32840L, MS[23]#32841L, MS[24]#32842L, MS[25]#32843L, MS[26]#32844L, MS[27]#32845L, MS[28]#32846L, MS[29]#32847L, MS[30]#32848L, MS[31]#32849L, MS[32]#32850L, MS[33]#32851L, MS[34]#32852L, MS[35]#32853L, MS[36]#32854L, MS[37]#32855L, MS[38]#32856L, MS[39]#32857L, MS[40]#32858L, MS[41]#32859L, MS[42]#32860L, MS[43]#32861L, MS[44]#32862L, MS[45]#32863L, MS[46]#32864L, MS[47]#32865L, MS[48]#32866L, MS[49]#32867L, MS[50]#32868L, MS[51]#32869L, sum#32984L, sum#32985, sum#32986, count#32987L]
Arguments: hashpartitioning(segment#32751, processing_day#32753, 200), ENSURE_REQUIREMENTS, [plan_id=3120]
(6) ShuffleQueryStage
Output [59]: [segment#32751, processing_day#32753, count#32983L, MS[0]#32818L, MS[1]#32819L, MS[2]#32820L, MS[3]#32821L, MS[4]#32822L, MS[5]#32823L, MS[6]#32824L, MS[7]#32825L, MS[8]#32826L, MS[9]#32827L, MS[10]#32828L, MS[11]#32829L, MS[12]#32830L, MS[13]#32831L, MS[14]#32832L, MS[15]#32833L, MS[16]#32834L, MS[17]#32835L, MS[18]#32836L, MS[19]#32837L, MS[20]#32838L, MS[21]#32839L, MS[22]#32840L, MS[23]#32841L, MS[24]#32842L, MS[25]#32843L, MS[26]#32844L, MS[27]#32845L, MS[28]#32846L, MS[29]#32847L, MS[30]#32848L, MS[31]#32849L, MS[32]#32850L, MS[33]#32851L, MS[34]#32852L, MS[35]#32853L, MS[36]#32854L, MS[37]#32855L, MS[38]#32856L, MS[39]#32857L, MS[40]#32858L, MS[41]#32859L, MS[42]#32860L, MS[43]#32861L, MS[44]#32862L, MS[45]#32863L, MS[46]#32864L, MS[47]#32865L, MS[48]#32866L, MS[49]#32867L, MS[50]#32868L, MS[51]#32869L, sum#32984L, sum#32985, sum#32986, count#32987L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#32751, processing_day#32753, count#32983L, MS[0]#32818L, MS[1]#32819L, MS[2]#32820L, MS[3]#32821L, MS[4]#32822L, MS[5]#32823L, MS[6]#32824L, MS[7]#32825L, MS[8]#32826L, MS[9]#32827L, MS[10]#32828L, MS[11]#32829L, MS[12]#32830L, MS[13]#32831L, MS[14]#32832L, MS[15]#32833L, MS[16]#32834L, MS[17]#32835L, MS[18]#32836L, MS[19]#32837L, MS[20]#32838L, MS[21]#32839L, MS[22]#32840L, MS[23]#32841L, MS[24]#32842L, MS[25]#32843L, MS[26]#32844L, MS[27]#32845L, MS[28]#32846L, MS[29]#32847L, MS[30]#32848L, MS[31]#32849L, MS[32]#32850L, MS[33]#32851L, MS[34]#32852L, MS[35]#32853L, MS[36]#32854L, MS[37]#32855L, MS[38]#32856L, MS[39]#32857L, MS[40]#32858L, MS[41]#32859L, MS[42]#32860L, MS[43]#32861L, MS[44]#32862L, MS[45]#32863L, MS[46]#32864L, MS[47]#32865L, MS[48]#32866L, MS[49]#32867L, MS[50]#32868L, MS[51]#32869L, sum#32984L, sum#32985, sum#32986, count#32987L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#32751, processing_day#32753, count#32983L, MS[0]#32818L, MS[1]#32819L, MS[2]#32820L, MS[3]#32821L, MS[4]#32822L, MS[5]#32823L, MS[6]#32824L, MS[7]#32825L, MS[8]#32826L, MS[9]#32827L, MS[10]#32828L, MS[11]#32829L, MS[12]#32830L, MS[13]#32831L, MS[14]#32832L, MS[15]#32833L, MS[16]#32834L, MS[17]#32835L, MS[18]#32836L, MS[19]#32837L, MS[20]#32838L, MS[21]#32839L, MS[22]#32840L, MS[23]#32841L, MS[24]#32842L, MS[25]#32843L, MS[26]#32844L, MS[27]#32845L, MS[28]#32846L, MS[29]#32847L, MS[30]#32848L, MS[31]#32849L, MS[32]#32850L, MS[33]#32851L, MS[34]#32852L, MS[35]#32853L, MS[36]#32854L, MS[37]#32855L, MS[38]#32856L, MS[39]#32857L, MS[40]#32858L, MS[41]#32859L, MS[42]#32860L, MS[43]#32861L, MS[44]#32862L, MS[45]#32863L, MS[46]#32864L, MS[47]#32865L, MS[48]#32866L, MS[49]#32867L, MS[50]#32868L, MS[51]#32869L, sum#32984L, sum#32985, sum#32986, count#32987L]
Keys [2]: [segment#32751, processing_day#32753]
Functions [5]: [count(1), approx_count_distinct(customer_id#32747L, 0.05, 0, 0), sum(events#32757), sum(weighted_amount#32759), avg(amount#32755)]
Aggregate Attributes [5]: [count(1)#32765L, approx_count_distinct(customer_id#32747L, 0.05, 0, 0)#32870L, sum(events#32757)#32871L, sum(weighted_amount#32759)#32872, avg(amount#32755)#32873]
Results [7]: [segment#32751, processing_day#32753, count(1)#32765L AS row_count#32760L, approx_count_distinct(customer_id#32747L, 0.05, 0, 0)#32870L AS unique_customers#32761L, sum(events#32757)#32871L AS event_sum#32762L, sum(weighted_amount#32759)#32872 AS weighted_amount_sum#32763, avg(amount#32755)#32873 AS avg_amount#32764]
(9) Exchange
Input [7]: [segment#32751, processing_day#32753, row_count#32760L, unique_customers#32761L, event_sum#32762L, weighted_amount_sum#32763, avg_amount#32764]
Arguments: rangepartitioning(segment#32751 ASC NULLS FIRST, processing_day#32753 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3142]
(10) ShuffleQueryStage
Output [7]: [segment#32751, processing_day#32753, row_count#32760L, unique_customers#32761L, event_sum#32762L, weighted_amount_sum#32763, avg_amount#32764]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#32751, processing_day#32753, row_count#32760L, unique_customers#32761L, event_sum#32762L, weighted_amount_sum#32763, avg_amount#32764]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#32751, processing_day#32753, row_count#32760L, unique_customers#32761L, event_sum#32762L, weighted_amount_sum#32763, avg_amount#32764]
Arguments: [segment#32751 ASC NULLS FIRST, processing_day#32753 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#32751, processing_day#32753, row_count#32760L, unique_customers#32761L, event_sum#32762L, weighted_amount_sum#32763, avg_amount#32764]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#32747L, segment#32751, processing_day#32753, amount#32755, events#32757, weighted_amount#32759]
Keys [2]: [segment#32751, processing_day#32753]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#32747L, 0.05, 0, 0), partial_sum(events#32757), partial_sum(weighted_amount#32759), partial_avg(amount#32755)]
Aggregate Attributes [57]: [count#32978L, MS[0]#32766L, MS[1]#32767L, MS[2]#32768L, MS[3]#32769L, MS[4]#32770L, MS[5]#32771L, MS[6]#32772L, MS[7]#32773L, MS[8]#32774L, MS[9]#32775L, MS[10]#32776L, MS[11]#32777L, MS[12]#32778L, MS[13]#32779L, MS[14]#32780L, MS[15]#32781L, MS[16]#32782L, MS[17]#32783L, MS[18]#32784L, MS[19]#32785L, MS[20]#32786L, MS[21]#32787L, MS[22]#32788L, MS[23]#32789L, MS[24]#32790L, MS[25]#32791L, MS[26]#32792L, MS[27]#32793L, MS[28]#32794L, MS[29]#32795L, MS[30]#32796L, MS[31]#32797L, MS[32]#32798L, MS[33]#32799L, MS[34]#32800L, MS[35]#32801L, MS[36]#32802L, MS[37]#32803L, MS[38]#32804L, MS[39]#32805L, MS[40]#32806L, MS[41]#32807L, MS[42]#32808L, MS[43]#32809L, MS[44]#32810L, MS[45]#32811L, MS[46]#32812L, MS[47]#32813L, MS[48]#32814L, MS[49]#32815L, MS[50]#32816L, MS[51]#32817L, sum#32979L, sum#32980, sum#32981, count#32982L]
Results [59]: [segment#32751, processing_day#32753, count#32983L, MS[0]#32818L, MS[1]#32819L, MS[2]#32820L, MS[3]#32821L, MS[4]#32822L, MS[5]#32823L, MS[6]#32824L, MS[7]#32825L, MS[8]#32826L, MS[9]#32827L, MS[10]#32828L, MS[11]#32829L, MS[12]#32830L, MS[13]#32831L, MS[14]#32832L, MS[15]#32833L, MS[16]#32834L, MS[17]#32835L, MS[18]#32836L, MS[19]#32837L, MS[20]#32838L, MS[21]#32839L, MS[22]#32840L, MS[23]#32841L, MS[24]#32842L, MS[25]#32843L, MS[26]#32844L, MS[27]#32845L, MS[28]#32846L, MS[29]#32847L, MS[30]#32848L, MS[31]#32849L, MS[32]#32850L, MS[33]#32851L, MS[34]#32852L, MS[35]#32853L, MS[36]#32854L, MS[37]#32855L, MS[38]#32856L, MS[39]#32857L, MS[40]#32858L, MS[41]#32859L, MS[42]#32860L, MS[43]#32861L, MS[44]#32862L, MS[45]#32863L, MS[46]#32864L, MS[47]#32865L, MS[48]#32866L, MS[49]#32867L, MS[50]#32868L, MS[51]#32869L, sum#32984L, sum#32985, sum#32986, count#32987L]
(15) Exchange
Input [59]: [segment#32751, processing_day#32753, count#32983L, MS[0]#32818L, MS[1]#32819L, MS[2]#32820L, MS[3]#32821L, MS[4]#32822L, MS[5]#32823L, MS[6]#32824L, MS[7]#32825L, MS[8]#32826L, MS[9]#32827L, MS[10]#32828L, MS[11]#32829L, MS[12]#32830L, MS[13]#32831L, MS[14]#32832L, MS[15]#32833L, MS[16]#32834L, MS[17]#32835L, MS[18]#32836L, MS[19]#32837L, MS[20]#32838L, MS[21]#32839L, MS[22]#32840L, MS[23]#32841L, MS[24]#32842L, MS[25]#32843L, MS[26]#32844L, MS[27]#32845L, MS[28]#32846L, MS[29]#32847L, MS[30]#32848L, MS[31]#32849L, MS[32]#32850L, MS[33]#32851L, MS[34]#32852L, MS[35]#32853L, MS[36]#32854L, MS[37]#32855L, MS[38]#32856L, MS[39]#32857L, MS[40]#32858L, MS[41]#32859L, MS[42]#32860L, MS[43]#32861L, MS[44]#32862L, MS[45]#32863L, MS[46]#32864L, MS[47]#32865L, MS[48]#32866L, MS[49]#32867L, MS[50]#32868L, MS[51]#32869L, sum#32984L, sum#32985, sum#32986, count#32987L]
Arguments: hashpartitioning(segment#32751, processing_day#32753, 200), ENSURE_REQUIREMENTS, [plan_id=3100]
(16) HashAggregate
Input [59]: [segment#32751, processing_day#32753, count#32983L, MS[0]#32818L, MS[1]#32819L, MS[2]#32820L, MS[3]#32821L, MS[4]#32822L, MS[5]#32823L, MS[6]#32824L, MS[7]#32825L, MS[8]#32826L, MS[9]#32827L, MS[10]#32828L, MS[11]#32829L, MS[12]#32830L, MS[13]#32831L, MS[14]#32832L, MS[15]#32833L, MS[16]#32834L, MS[17]#32835L, MS[18]#32836L, MS[19]#32837L, MS[20]#32838L, MS[21]#32839L, MS[22]#32840L, MS[23]#32841L, MS[24]#32842L, MS[25]#32843L, MS[26]#32844L, MS[27]#32845L, MS[28]#32846L, MS[29]#32847L, MS[30]#32848L, MS[31]#32849L, MS[32]#32850L, MS[33]#32851L, MS[34]#32852L, MS[35]#32853L, MS[36]#32854L, MS[37]#32855L, MS[38]#32856L, MS[39]#32857L, MS[40]#32858L, MS[41]#32859L, MS[42]#32860L, MS[43]#32861L, MS[44]#32862L, MS[45]#32863L, MS[46]#32864L, MS[47]#32865L, MS[48]#32866L, MS[49]#32867L, MS[50]#32868L, MS[51]#32869L, sum#32984L, sum#32985, sum#32986, count#32987L]
Keys [2]: [segment#32751, processing_day#32753]
Functions [5]: [count(1), approx_count_distinct(customer_id#32747L, 0.05, 0, 0), sum(events#32757), sum(weighted_amount#32759), avg(amount#32755)]
Aggregate Attributes [5]: [count(1)#32765L, approx_count_distinct(customer_id#32747L, 0.05, 0, 0)#32870L, sum(events#32757)#32871L, sum(weighted_amount#32759)#32872, avg(amount#32755)#32873]
Results [7]: [segment#32751, processing_day#32753, count(1)#32765L AS row_count#32760L, approx_count_distinct(customer_id#32747L, 0.05, 0, 0)#32870L AS unique_customers#32761L, sum(events#32757)#32871L AS event_sum#32762L, sum(weighted_amount#32759)#32872 AS weighted_amount_sum#32763, avg(amount#32755)#32873 AS avg_amount#32764]
(17) Exchange
Input [7]: [segment#32751, processing_day#32753, row_count#32760L, unique_customers#32761L, event_sum#32762L, weighted_amount_sum#32763, avg_amount#32764]
Arguments: rangepartitioning(segment#32751 ASC NULLS FIRST, processing_day#32753 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3103]
(18) Sort
Input [7]: [segment#32751, processing_day#32753, row_count#32760L, unique_customers#32761L, event_sum#32762L, weighted_amount_sum#32763, avg_amount#32764]
Arguments: [segment#32751 ASC NULLS FIRST, processing_day#32753 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#32751, processing_day#32753, row_count#32760L, unique_customers#32761L, event_sum#32762L, weighted_amount_sum#32763, avg_amount#32764]
Arguments: isFinalPlan=true