== 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#42503L]
Arguments: Range (0, 1000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#42503L % 250000) AS customer_id#42505L, concat(segment-, cast(cast((id#42503L % 12) as int) as string)) AS segment#42509, cast((id#42503L % 14) as int) AS processing_day#42511, ((cast(((id#42503L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#42513, cast((((id#42503L * 29) % 7) + 1) as int) AS events#42515]
Input [1]: [id#42503L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#42505L, segment#42509, processing_day#42511, amount#42513, events#42515, (amount#42513 * cast(events#42515 as double)) AS weighted_amount#42517]
Input [5]: [customer_id#42505L, segment#42509, processing_day#42511, amount#42513, events#42515]
(4) HashAggregate
Input [6]: [customer_id#42505L, segment#42509, processing_day#42511, amount#42513, events#42515, weighted_amount#42517]
Keys [2]: [segment#42509, processing_day#42511]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#42505L, 0.05, 0, 0), partial_sum(events#42515), partial_sum(weighted_amount#42517), partial_avg(amount#42513)]
Aggregate Attributes [57]: [count#42736L, MS[0]#42524L, MS[1]#42525L, MS[2]#42526L, MS[3]#42527L, MS[4]#42528L, MS[5]#42529L, MS[6]#42530L, MS[7]#42531L, MS[8]#42532L, MS[9]#42533L, MS[10]#42534L, MS[11]#42535L, MS[12]#42536L, MS[13]#42537L, MS[14]#42538L, MS[15]#42539L, MS[16]#42540L, MS[17]#42541L, MS[18]#42542L, MS[19]#42543L, MS[20]#42544L, MS[21]#42545L, MS[22]#42546L, MS[23]#42547L, MS[24]#42548L, MS[25]#42549L, MS[26]#42550L, MS[27]#42551L, MS[28]#42552L, MS[29]#42553L, MS[30]#42554L, MS[31]#42555L, MS[32]#42556L, MS[33]#42557L, MS[34]#42558L, MS[35]#42559L, MS[36]#42560L, MS[37]#42561L, MS[38]#42562L, MS[39]#42563L, MS[40]#42564L, MS[41]#42565L, MS[42]#42566L, MS[43]#42567L, MS[44]#42568L, MS[45]#42569L, MS[46]#42570L, MS[47]#42571L, MS[48]#42572L, MS[49]#42573L, MS[50]#42574L, MS[51]#42575L, sum#42737L, sum#42738, sum#42739, count#42740L]
Results [59]: [segment#42509, processing_day#42511, count#42741L, MS[0]#42576L, MS[1]#42577L, MS[2]#42578L, MS[3]#42579L, MS[4]#42580L, MS[5]#42581L, MS[6]#42582L, MS[7]#42583L, MS[8]#42584L, MS[9]#42585L, MS[10]#42586L, MS[11]#42587L, MS[12]#42588L, MS[13]#42589L, MS[14]#42590L, MS[15]#42591L, MS[16]#42592L, MS[17]#42593L, MS[18]#42594L, MS[19]#42595L, MS[20]#42596L, MS[21]#42597L, MS[22]#42598L, MS[23]#42599L, MS[24]#42600L, MS[25]#42601L, MS[26]#42602L, MS[27]#42603L, MS[28]#42604L, MS[29]#42605L, MS[30]#42606L, MS[31]#42607L, MS[32]#42608L, MS[33]#42609L, MS[34]#42610L, MS[35]#42611L, MS[36]#42612L, MS[37]#42613L, MS[38]#42614L, MS[39]#42615L, MS[40]#42616L, MS[41]#42617L, MS[42]#42618L, MS[43]#42619L, MS[44]#42620L, MS[45]#42621L, MS[46]#42622L, MS[47]#42623L, MS[48]#42624L, MS[49]#42625L, MS[50]#42626L, MS[51]#42627L, sum#42742L, sum#42743, sum#42744, count#42745L]
(5) Exchange
Input [59]: [segment#42509, processing_day#42511, count#42741L, MS[0]#42576L, MS[1]#42577L, MS[2]#42578L, MS[3]#42579L, MS[4]#42580L, MS[5]#42581L, MS[6]#42582L, MS[7]#42583L, MS[8]#42584L, MS[9]#42585L, MS[10]#42586L, MS[11]#42587L, MS[12]#42588L, MS[13]#42589L, MS[14]#42590L, MS[15]#42591L, MS[16]#42592L, MS[17]#42593L, MS[18]#42594L, MS[19]#42595L, MS[20]#42596L, MS[21]#42597L, MS[22]#42598L, MS[23]#42599L, MS[24]#42600L, MS[25]#42601L, MS[26]#42602L, MS[27]#42603L, MS[28]#42604L, MS[29]#42605L, MS[30]#42606L, MS[31]#42607L, MS[32]#42608L, MS[33]#42609L, MS[34]#42610L, MS[35]#42611L, MS[36]#42612L, MS[37]#42613L, MS[38]#42614L, MS[39]#42615L, MS[40]#42616L, MS[41]#42617L, MS[42]#42618L, MS[43]#42619L, MS[44]#42620L, MS[45]#42621L, MS[46]#42622L, MS[47]#42623L, MS[48]#42624L, MS[49]#42625L, MS[50]#42626L, MS[51]#42627L, sum#42742L, sum#42743, sum#42744, count#42745L]
Arguments: hashpartitioning(segment#42509, processing_day#42511, 200), ENSURE_REQUIREMENTS, [plan_id=4039]
(6) ShuffleQueryStage
Output [59]: [segment#42509, processing_day#42511, count#42741L, MS[0]#42576L, MS[1]#42577L, MS[2]#42578L, MS[3]#42579L, MS[4]#42580L, MS[5]#42581L, MS[6]#42582L, MS[7]#42583L, MS[8]#42584L, MS[9]#42585L, MS[10]#42586L, MS[11]#42587L, MS[12]#42588L, MS[13]#42589L, MS[14]#42590L, MS[15]#42591L, MS[16]#42592L, MS[17]#42593L, MS[18]#42594L, MS[19]#42595L, MS[20]#42596L, MS[21]#42597L, MS[22]#42598L, MS[23]#42599L, MS[24]#42600L, MS[25]#42601L, MS[26]#42602L, MS[27]#42603L, MS[28]#42604L, MS[29]#42605L, MS[30]#42606L, MS[31]#42607L, MS[32]#42608L, MS[33]#42609L, MS[34]#42610L, MS[35]#42611L, MS[36]#42612L, MS[37]#42613L, MS[38]#42614L, MS[39]#42615L, MS[40]#42616L, MS[41]#42617L, MS[42]#42618L, MS[43]#42619L, MS[44]#42620L, MS[45]#42621L, MS[46]#42622L, MS[47]#42623L, MS[48]#42624L, MS[49]#42625L, MS[50]#42626L, MS[51]#42627L, sum#42742L, sum#42743, sum#42744, count#42745L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#42509, processing_day#42511, count#42741L, MS[0]#42576L, MS[1]#42577L, MS[2]#42578L, MS[3]#42579L, MS[4]#42580L, MS[5]#42581L, MS[6]#42582L, MS[7]#42583L, MS[8]#42584L, MS[9]#42585L, MS[10]#42586L, MS[11]#42587L, MS[12]#42588L, MS[13]#42589L, MS[14]#42590L, MS[15]#42591L, MS[16]#42592L, MS[17]#42593L, MS[18]#42594L, MS[19]#42595L, MS[20]#42596L, MS[21]#42597L, MS[22]#42598L, MS[23]#42599L, MS[24]#42600L, MS[25]#42601L, MS[26]#42602L, MS[27]#42603L, MS[28]#42604L, MS[29]#42605L, MS[30]#42606L, MS[31]#42607L, MS[32]#42608L, MS[33]#42609L, MS[34]#42610L, MS[35]#42611L, MS[36]#42612L, MS[37]#42613L, MS[38]#42614L, MS[39]#42615L, MS[40]#42616L, MS[41]#42617L, MS[42]#42618L, MS[43]#42619L, MS[44]#42620L, MS[45]#42621L, MS[46]#42622L, MS[47]#42623L, MS[48]#42624L, MS[49]#42625L, MS[50]#42626L, MS[51]#42627L, sum#42742L, sum#42743, sum#42744, count#42745L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#42509, processing_day#42511, count#42741L, MS[0]#42576L, MS[1]#42577L, MS[2]#42578L, MS[3]#42579L, MS[4]#42580L, MS[5]#42581L, MS[6]#42582L, MS[7]#42583L, MS[8]#42584L, MS[9]#42585L, MS[10]#42586L, MS[11]#42587L, MS[12]#42588L, MS[13]#42589L, MS[14]#42590L, MS[15]#42591L, MS[16]#42592L, MS[17]#42593L, MS[18]#42594L, MS[19]#42595L, MS[20]#42596L, MS[21]#42597L, MS[22]#42598L, MS[23]#42599L, MS[24]#42600L, MS[25]#42601L, MS[26]#42602L, MS[27]#42603L, MS[28]#42604L, MS[29]#42605L, MS[30]#42606L, MS[31]#42607L, MS[32]#42608L, MS[33]#42609L, MS[34]#42610L, MS[35]#42611L, MS[36]#42612L, MS[37]#42613L, MS[38]#42614L, MS[39]#42615L, MS[40]#42616L, MS[41]#42617L, MS[42]#42618L, MS[43]#42619L, MS[44]#42620L, MS[45]#42621L, MS[46]#42622L, MS[47]#42623L, MS[48]#42624L, MS[49]#42625L, MS[50]#42626L, MS[51]#42627L, sum#42742L, sum#42743, sum#42744, count#42745L]
Keys [2]: [segment#42509, processing_day#42511]
Functions [5]: [count(1), approx_count_distinct(customer_id#42505L, 0.05, 0, 0), sum(events#42515), sum(weighted_amount#42517), avg(amount#42513)]
Aggregate Attributes [5]: [count(1)#42523L, approx_count_distinct(customer_id#42505L, 0.05, 0, 0)#42628L, sum(events#42515)#42629L, sum(weighted_amount#42517)#42630, avg(amount#42513)#42631]
Results [7]: [segment#42509, processing_day#42511, count(1)#42523L AS row_count#42518L, approx_count_distinct(customer_id#42505L, 0.05, 0, 0)#42628L AS unique_customers#42519L, sum(events#42515)#42629L AS event_sum#42520L, sum(weighted_amount#42517)#42630 AS weighted_amount_sum#42521, avg(amount#42513)#42631 AS avg_amount#42522]
(9) Exchange
Input [7]: [segment#42509, processing_day#42511, row_count#42518L, unique_customers#42519L, event_sum#42520L, weighted_amount_sum#42521, avg_amount#42522]
Arguments: rangepartitioning(segment#42509 ASC NULLS FIRST, processing_day#42511 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4061]
(10) ShuffleQueryStage
Output [7]: [segment#42509, processing_day#42511, row_count#42518L, unique_customers#42519L, event_sum#42520L, weighted_amount_sum#42521, avg_amount#42522]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#42509, processing_day#42511, row_count#42518L, unique_customers#42519L, event_sum#42520L, weighted_amount_sum#42521, avg_amount#42522]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#42509, processing_day#42511, row_count#42518L, unique_customers#42519L, event_sum#42520L, weighted_amount_sum#42521, avg_amount#42522]
Arguments: [segment#42509 ASC NULLS FIRST, processing_day#42511 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#42509, processing_day#42511, row_count#42518L, unique_customers#42519L, event_sum#42520L, weighted_amount_sum#42521, avg_amount#42522]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#42505L, segment#42509, processing_day#42511, amount#42513, events#42515, weighted_amount#42517]
Keys [2]: [segment#42509, processing_day#42511]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#42505L, 0.05, 0, 0), partial_sum(events#42515), partial_sum(weighted_amount#42517), partial_avg(amount#42513)]
Aggregate Attributes [57]: [count#42736L, MS[0]#42524L, MS[1]#42525L, MS[2]#42526L, MS[3]#42527L, MS[4]#42528L, MS[5]#42529L, MS[6]#42530L, MS[7]#42531L, MS[8]#42532L, MS[9]#42533L, MS[10]#42534L, MS[11]#42535L, MS[12]#42536L, MS[13]#42537L, MS[14]#42538L, MS[15]#42539L, MS[16]#42540L, MS[17]#42541L, MS[18]#42542L, MS[19]#42543L, MS[20]#42544L, MS[21]#42545L, MS[22]#42546L, MS[23]#42547L, MS[24]#42548L, MS[25]#42549L, MS[26]#42550L, MS[27]#42551L, MS[28]#42552L, MS[29]#42553L, MS[30]#42554L, MS[31]#42555L, MS[32]#42556L, MS[33]#42557L, MS[34]#42558L, MS[35]#42559L, MS[36]#42560L, MS[37]#42561L, MS[38]#42562L, MS[39]#42563L, MS[40]#42564L, MS[41]#42565L, MS[42]#42566L, MS[43]#42567L, MS[44]#42568L, MS[45]#42569L, MS[46]#42570L, MS[47]#42571L, MS[48]#42572L, MS[49]#42573L, MS[50]#42574L, MS[51]#42575L, sum#42737L, sum#42738, sum#42739, count#42740L]
Results [59]: [segment#42509, processing_day#42511, count#42741L, MS[0]#42576L, MS[1]#42577L, MS[2]#42578L, MS[3]#42579L, MS[4]#42580L, MS[5]#42581L, MS[6]#42582L, MS[7]#42583L, MS[8]#42584L, MS[9]#42585L, MS[10]#42586L, MS[11]#42587L, MS[12]#42588L, MS[13]#42589L, MS[14]#42590L, MS[15]#42591L, MS[16]#42592L, MS[17]#42593L, MS[18]#42594L, MS[19]#42595L, MS[20]#42596L, MS[21]#42597L, MS[22]#42598L, MS[23]#42599L, MS[24]#42600L, MS[25]#42601L, MS[26]#42602L, MS[27]#42603L, MS[28]#42604L, MS[29]#42605L, MS[30]#42606L, MS[31]#42607L, MS[32]#42608L, MS[33]#42609L, MS[34]#42610L, MS[35]#42611L, MS[36]#42612L, MS[37]#42613L, MS[38]#42614L, MS[39]#42615L, MS[40]#42616L, MS[41]#42617L, MS[42]#42618L, MS[43]#42619L, MS[44]#42620L, MS[45]#42621L, MS[46]#42622L, MS[47]#42623L, MS[48]#42624L, MS[49]#42625L, MS[50]#42626L, MS[51]#42627L, sum#42742L, sum#42743, sum#42744, count#42745L]
(15) Exchange
Input [59]: [segment#42509, processing_day#42511, count#42741L, MS[0]#42576L, MS[1]#42577L, MS[2]#42578L, MS[3]#42579L, MS[4]#42580L, MS[5]#42581L, MS[6]#42582L, MS[7]#42583L, MS[8]#42584L, MS[9]#42585L, MS[10]#42586L, MS[11]#42587L, MS[12]#42588L, MS[13]#42589L, MS[14]#42590L, MS[15]#42591L, MS[16]#42592L, MS[17]#42593L, MS[18]#42594L, MS[19]#42595L, MS[20]#42596L, MS[21]#42597L, MS[22]#42598L, MS[23]#42599L, MS[24]#42600L, MS[25]#42601L, MS[26]#42602L, MS[27]#42603L, MS[28]#42604L, MS[29]#42605L, MS[30]#42606L, MS[31]#42607L, MS[32]#42608L, MS[33]#42609L, MS[34]#42610L, MS[35]#42611L, MS[36]#42612L, MS[37]#42613L, MS[38]#42614L, MS[39]#42615L, MS[40]#42616L, MS[41]#42617L, MS[42]#42618L, MS[43]#42619L, MS[44]#42620L, MS[45]#42621L, MS[46]#42622L, MS[47]#42623L, MS[48]#42624L, MS[49]#42625L, MS[50]#42626L, MS[51]#42627L, sum#42742L, sum#42743, sum#42744, count#42745L]
Arguments: hashpartitioning(segment#42509, processing_day#42511, 200), ENSURE_REQUIREMENTS, [plan_id=4019]
(16) HashAggregate
Input [59]: [segment#42509, processing_day#42511, count#42741L, MS[0]#42576L, MS[1]#42577L, MS[2]#42578L, MS[3]#42579L, MS[4]#42580L, MS[5]#42581L, MS[6]#42582L, MS[7]#42583L, MS[8]#42584L, MS[9]#42585L, MS[10]#42586L, MS[11]#42587L, MS[12]#42588L, MS[13]#42589L, MS[14]#42590L, MS[15]#42591L, MS[16]#42592L, MS[17]#42593L, MS[18]#42594L, MS[19]#42595L, MS[20]#42596L, MS[21]#42597L, MS[22]#42598L, MS[23]#42599L, MS[24]#42600L, MS[25]#42601L, MS[26]#42602L, MS[27]#42603L, MS[28]#42604L, MS[29]#42605L, MS[30]#42606L, MS[31]#42607L, MS[32]#42608L, MS[33]#42609L, MS[34]#42610L, MS[35]#42611L, MS[36]#42612L, MS[37]#42613L, MS[38]#42614L, MS[39]#42615L, MS[40]#42616L, MS[41]#42617L, MS[42]#42618L, MS[43]#42619L, MS[44]#42620L, MS[45]#42621L, MS[46]#42622L, MS[47]#42623L, MS[48]#42624L, MS[49]#42625L, MS[50]#42626L, MS[51]#42627L, sum#42742L, sum#42743, sum#42744, count#42745L]
Keys [2]: [segment#42509, processing_day#42511]
Functions [5]: [count(1), approx_count_distinct(customer_id#42505L, 0.05, 0, 0), sum(events#42515), sum(weighted_amount#42517), avg(amount#42513)]
Aggregate Attributes [5]: [count(1)#42523L, approx_count_distinct(customer_id#42505L, 0.05, 0, 0)#42628L, sum(events#42515)#42629L, sum(weighted_amount#42517)#42630, avg(amount#42513)#42631]
Results [7]: [segment#42509, processing_day#42511, count(1)#42523L AS row_count#42518L, approx_count_distinct(customer_id#42505L, 0.05, 0, 0)#42628L AS unique_customers#42519L, sum(events#42515)#42629L AS event_sum#42520L, sum(weighted_amount#42517)#42630 AS weighted_amount_sum#42521, avg(amount#42513)#42631 AS avg_amount#42522]
(17) Exchange
Input [7]: [segment#42509, processing_day#42511, row_count#42518L, unique_customers#42519L, event_sum#42520L, weighted_amount_sum#42521, avg_amount#42522]
Arguments: rangepartitioning(segment#42509 ASC NULLS FIRST, processing_day#42511 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=4022]
(18) Sort
Input [7]: [segment#42509, processing_day#42511, row_count#42518L, unique_customers#42519L, event_sum#42520L, weighted_amount_sum#42521, avg_amount#42522]
Arguments: [segment#42509 ASC NULLS FIRST, processing_day#42511 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#42509, processing_day#42511, row_count#42518L, unique_customers#42519L, event_sum#42520L, weighted_amount_sum#42521, avg_amount#42522]
Arguments: isFinalPlan=true