== 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#39817L]
Arguments: Range (21000000, 22000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#39817L % 250000) AS customer_id#39819L, concat(segment-, cast(cast((id#39817L % 12) as int) as string)) AS segment#39823, cast((id#39817L % 14) as int) AS processing_day#39825, ((cast(((id#39817L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#39827, cast((((id#39817L * 29) % 7) + 1) as int) AS events#39829]
Input [1]: [id#39817L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#39819L, segment#39823, processing_day#39825, amount#39827, events#39829, (amount#39827 * cast(events#39829 as double)) AS weighted_amount#39831]
Input [5]: [customer_id#39819L, segment#39823, processing_day#39825, amount#39827, events#39829]
(4) HashAggregate
Input [6]: [customer_id#39819L, segment#39823, processing_day#39825, amount#39827, events#39829, weighted_amount#39831]
Keys [2]: [segment#39823, processing_day#39825]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#39819L, 0.05, 0, 0), partial_sum(events#39829), partial_sum(weighted_amount#39831), partial_avg(amount#39827)]
Aggregate Attributes [57]: [count#40050L, MS[0]#39838L, MS[1]#39839L, MS[2]#39840L, MS[3]#39841L, MS[4]#39842L, MS[5]#39843L, MS[6]#39844L, MS[7]#39845L, MS[8]#39846L, MS[9]#39847L, MS[10]#39848L, MS[11]#39849L, MS[12]#39850L, MS[13]#39851L, MS[14]#39852L, MS[15]#39853L, MS[16]#39854L, MS[17]#39855L, MS[18]#39856L, MS[19]#39857L, MS[20]#39858L, MS[21]#39859L, MS[22]#39860L, MS[23]#39861L, MS[24]#39862L, MS[25]#39863L, MS[26]#39864L, MS[27]#39865L, MS[28]#39866L, MS[29]#39867L, MS[30]#39868L, MS[31]#39869L, MS[32]#39870L, MS[33]#39871L, MS[34]#39872L, MS[35]#39873L, MS[36]#39874L, MS[37]#39875L, MS[38]#39876L, MS[39]#39877L, MS[40]#39878L, MS[41]#39879L, MS[42]#39880L, MS[43]#39881L, MS[44]#39882L, MS[45]#39883L, MS[46]#39884L, MS[47]#39885L, MS[48]#39886L, MS[49]#39887L, MS[50]#39888L, MS[51]#39889L, sum#40051L, sum#40052, sum#40053, count#40054L]
Results [59]: [segment#39823, processing_day#39825, count#40055L, MS[0]#39890L, MS[1]#39891L, MS[2]#39892L, MS[3]#39893L, MS[4]#39894L, MS[5]#39895L, MS[6]#39896L, MS[7]#39897L, MS[8]#39898L, MS[9]#39899L, MS[10]#39900L, MS[11]#39901L, MS[12]#39902L, MS[13]#39903L, MS[14]#39904L, MS[15]#39905L, MS[16]#39906L, MS[17]#39907L, MS[18]#39908L, MS[19]#39909L, MS[20]#39910L, MS[21]#39911L, MS[22]#39912L, MS[23]#39913L, MS[24]#39914L, MS[25]#39915L, MS[26]#39916L, MS[27]#39917L, MS[28]#39918L, MS[29]#39919L, MS[30]#39920L, MS[31]#39921L, MS[32]#39922L, MS[33]#39923L, MS[34]#39924L, MS[35]#39925L, MS[36]#39926L, MS[37]#39927L, MS[38]#39928L, MS[39]#39929L, MS[40]#39930L, MS[41]#39931L, MS[42]#39932L, MS[43]#39933L, MS[44]#39934L, MS[45]#39935L, MS[46]#39936L, MS[47]#39937L, MS[48]#39938L, MS[49]#39939L, MS[50]#39940L, MS[51]#39941L, sum#40056L, sum#40057, sum#40058, count#40059L]
(5) Exchange
Input [59]: [segment#39823, processing_day#39825, count#40055L, MS[0]#39890L, MS[1]#39891L, MS[2]#39892L, MS[3]#39893L, MS[4]#39894L, MS[5]#39895L, MS[6]#39896L, MS[7]#39897L, MS[8]#39898L, MS[9]#39899L, MS[10]#39900L, MS[11]#39901L, MS[12]#39902L, MS[13]#39903L, MS[14]#39904L, MS[15]#39905L, MS[16]#39906L, MS[17]#39907L, MS[18]#39908L, MS[19]#39909L, MS[20]#39910L, MS[21]#39911L, MS[22]#39912L, MS[23]#39913L, MS[24]#39914L, MS[25]#39915L, MS[26]#39916L, MS[27]#39917L, MS[28]#39918L, MS[29]#39919L, MS[30]#39920L, MS[31]#39921L, MS[32]#39922L, MS[33]#39923L, MS[34]#39924L, MS[35]#39925L, MS[36]#39926L, MS[37]#39927L, MS[38]#39928L, MS[39]#39929L, MS[40]#39930L, MS[41]#39931L, MS[42]#39932L, MS[43]#39933L, MS[44]#39934L, MS[45]#39935L, MS[46]#39936L, MS[47]#39937L, MS[48]#39938L, MS[49]#39939L, MS[50]#39940L, MS[51]#39941L, sum#40056L, sum#40057, sum#40058, count#40059L]
Arguments: hashpartitioning(segment#39823, processing_day#39825, 200), ENSURE_REQUIREMENTS, [plan_id=3784]
(6) ShuffleQueryStage
Output [59]: [segment#39823, processing_day#39825, count#40055L, MS[0]#39890L, MS[1]#39891L, MS[2]#39892L, MS[3]#39893L, MS[4]#39894L, MS[5]#39895L, MS[6]#39896L, MS[7]#39897L, MS[8]#39898L, MS[9]#39899L, MS[10]#39900L, MS[11]#39901L, MS[12]#39902L, MS[13]#39903L, MS[14]#39904L, MS[15]#39905L, MS[16]#39906L, MS[17]#39907L, MS[18]#39908L, MS[19]#39909L, MS[20]#39910L, MS[21]#39911L, MS[22]#39912L, MS[23]#39913L, MS[24]#39914L, MS[25]#39915L, MS[26]#39916L, MS[27]#39917L, MS[28]#39918L, MS[29]#39919L, MS[30]#39920L, MS[31]#39921L, MS[32]#39922L, MS[33]#39923L, MS[34]#39924L, MS[35]#39925L, MS[36]#39926L, MS[37]#39927L, MS[38]#39928L, MS[39]#39929L, MS[40]#39930L, MS[41]#39931L, MS[42]#39932L, MS[43]#39933L, MS[44]#39934L, MS[45]#39935L, MS[46]#39936L, MS[47]#39937L, MS[48]#39938L, MS[49]#39939L, MS[50]#39940L, MS[51]#39941L, sum#40056L, sum#40057, sum#40058, count#40059L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#39823, processing_day#39825, count#40055L, MS[0]#39890L, MS[1]#39891L, MS[2]#39892L, MS[3]#39893L, MS[4]#39894L, MS[5]#39895L, MS[6]#39896L, MS[7]#39897L, MS[8]#39898L, MS[9]#39899L, MS[10]#39900L, MS[11]#39901L, MS[12]#39902L, MS[13]#39903L, MS[14]#39904L, MS[15]#39905L, MS[16]#39906L, MS[17]#39907L, MS[18]#39908L, MS[19]#39909L, MS[20]#39910L, MS[21]#39911L, MS[22]#39912L, MS[23]#39913L, MS[24]#39914L, MS[25]#39915L, MS[26]#39916L, MS[27]#39917L, MS[28]#39918L, MS[29]#39919L, MS[30]#39920L, MS[31]#39921L, MS[32]#39922L, MS[33]#39923L, MS[34]#39924L, MS[35]#39925L, MS[36]#39926L, MS[37]#39927L, MS[38]#39928L, MS[39]#39929L, MS[40]#39930L, MS[41]#39931L, MS[42]#39932L, MS[43]#39933L, MS[44]#39934L, MS[45]#39935L, MS[46]#39936L, MS[47]#39937L, MS[48]#39938L, MS[49]#39939L, MS[50]#39940L, MS[51]#39941L, sum#40056L, sum#40057, sum#40058, count#40059L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#39823, processing_day#39825, count#40055L, MS[0]#39890L, MS[1]#39891L, MS[2]#39892L, MS[3]#39893L, MS[4]#39894L, MS[5]#39895L, MS[6]#39896L, MS[7]#39897L, MS[8]#39898L, MS[9]#39899L, MS[10]#39900L, MS[11]#39901L, MS[12]#39902L, MS[13]#39903L, MS[14]#39904L, MS[15]#39905L, MS[16]#39906L, MS[17]#39907L, MS[18]#39908L, MS[19]#39909L, MS[20]#39910L, MS[21]#39911L, MS[22]#39912L, MS[23]#39913L, MS[24]#39914L, MS[25]#39915L, MS[26]#39916L, MS[27]#39917L, MS[28]#39918L, MS[29]#39919L, MS[30]#39920L, MS[31]#39921L, MS[32]#39922L, MS[33]#39923L, MS[34]#39924L, MS[35]#39925L, MS[36]#39926L, MS[37]#39927L, MS[38]#39928L, MS[39]#39929L, MS[40]#39930L, MS[41]#39931L, MS[42]#39932L, MS[43]#39933L, MS[44]#39934L, MS[45]#39935L, MS[46]#39936L, MS[47]#39937L, MS[48]#39938L, MS[49]#39939L, MS[50]#39940L, MS[51]#39941L, sum#40056L, sum#40057, sum#40058, count#40059L]
Keys [2]: [segment#39823, processing_day#39825]
Functions [5]: [count(1), approx_count_distinct(customer_id#39819L, 0.05, 0, 0), sum(events#39829), sum(weighted_amount#39831), avg(amount#39827)]
Aggregate Attributes [5]: [count(1)#39837L, approx_count_distinct(customer_id#39819L, 0.05, 0, 0)#39942L, sum(events#39829)#39943L, sum(weighted_amount#39831)#39944, avg(amount#39827)#39945]
Results [7]: [segment#39823, processing_day#39825, count(1)#39837L AS row_count#39832L, approx_count_distinct(customer_id#39819L, 0.05, 0, 0)#39942L AS unique_customers#39833L, sum(events#39829)#39943L AS event_sum#39834L, sum(weighted_amount#39831)#39944 AS weighted_amount_sum#39835, avg(amount#39827)#39945 AS avg_amount#39836]
(9) Exchange
Input [7]: [segment#39823, processing_day#39825, row_count#39832L, unique_customers#39833L, event_sum#39834L, weighted_amount_sum#39835, avg_amount#39836]
Arguments: rangepartitioning(segment#39823 ASC NULLS FIRST, processing_day#39825 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3806]
(10) ShuffleQueryStage
Output [7]: [segment#39823, processing_day#39825, row_count#39832L, unique_customers#39833L, event_sum#39834L, weighted_amount_sum#39835, avg_amount#39836]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#39823, processing_day#39825, row_count#39832L, unique_customers#39833L, event_sum#39834L, weighted_amount_sum#39835, avg_amount#39836]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#39823, processing_day#39825, row_count#39832L, unique_customers#39833L, event_sum#39834L, weighted_amount_sum#39835, avg_amount#39836]
Arguments: [segment#39823 ASC NULLS FIRST, processing_day#39825 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#39823, processing_day#39825, row_count#39832L, unique_customers#39833L, event_sum#39834L, weighted_amount_sum#39835, avg_amount#39836]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#39819L, segment#39823, processing_day#39825, amount#39827, events#39829, weighted_amount#39831]
Keys [2]: [segment#39823, processing_day#39825]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#39819L, 0.05, 0, 0), partial_sum(events#39829), partial_sum(weighted_amount#39831), partial_avg(amount#39827)]
Aggregate Attributes [57]: [count#40050L, MS[0]#39838L, MS[1]#39839L, MS[2]#39840L, MS[3]#39841L, MS[4]#39842L, MS[5]#39843L, MS[6]#39844L, MS[7]#39845L, MS[8]#39846L, MS[9]#39847L, MS[10]#39848L, MS[11]#39849L, MS[12]#39850L, MS[13]#39851L, MS[14]#39852L, MS[15]#39853L, MS[16]#39854L, MS[17]#39855L, MS[18]#39856L, MS[19]#39857L, MS[20]#39858L, MS[21]#39859L, MS[22]#39860L, MS[23]#39861L, MS[24]#39862L, MS[25]#39863L, MS[26]#39864L, MS[27]#39865L, MS[28]#39866L, MS[29]#39867L, MS[30]#39868L, MS[31]#39869L, MS[32]#39870L, MS[33]#39871L, MS[34]#39872L, MS[35]#39873L, MS[36]#39874L, MS[37]#39875L, MS[38]#39876L, MS[39]#39877L, MS[40]#39878L, MS[41]#39879L, MS[42]#39880L, MS[43]#39881L, MS[44]#39882L, MS[45]#39883L, MS[46]#39884L, MS[47]#39885L, MS[48]#39886L, MS[49]#39887L, MS[50]#39888L, MS[51]#39889L, sum#40051L, sum#40052, sum#40053, count#40054L]
Results [59]: [segment#39823, processing_day#39825, count#40055L, MS[0]#39890L, MS[1]#39891L, MS[2]#39892L, MS[3]#39893L, MS[4]#39894L, MS[5]#39895L, MS[6]#39896L, MS[7]#39897L, MS[8]#39898L, MS[9]#39899L, MS[10]#39900L, MS[11]#39901L, MS[12]#39902L, MS[13]#39903L, MS[14]#39904L, MS[15]#39905L, MS[16]#39906L, MS[17]#39907L, MS[18]#39908L, MS[19]#39909L, MS[20]#39910L, MS[21]#39911L, MS[22]#39912L, MS[23]#39913L, MS[24]#39914L, MS[25]#39915L, MS[26]#39916L, MS[27]#39917L, MS[28]#39918L, MS[29]#39919L, MS[30]#39920L, MS[31]#39921L, MS[32]#39922L, MS[33]#39923L, MS[34]#39924L, MS[35]#39925L, MS[36]#39926L, MS[37]#39927L, MS[38]#39928L, MS[39]#39929L, MS[40]#39930L, MS[41]#39931L, MS[42]#39932L, MS[43]#39933L, MS[44]#39934L, MS[45]#39935L, MS[46]#39936L, MS[47]#39937L, MS[48]#39938L, MS[49]#39939L, MS[50]#39940L, MS[51]#39941L, sum#40056L, sum#40057, sum#40058, count#40059L]
(15) Exchange
Input [59]: [segment#39823, processing_day#39825, count#40055L, MS[0]#39890L, MS[1]#39891L, MS[2]#39892L, MS[3]#39893L, MS[4]#39894L, MS[5]#39895L, MS[6]#39896L, MS[7]#39897L, MS[8]#39898L, MS[9]#39899L, MS[10]#39900L, MS[11]#39901L, MS[12]#39902L, MS[13]#39903L, MS[14]#39904L, MS[15]#39905L, MS[16]#39906L, MS[17]#39907L, MS[18]#39908L, MS[19]#39909L, MS[20]#39910L, MS[21]#39911L, MS[22]#39912L, MS[23]#39913L, MS[24]#39914L, MS[25]#39915L, MS[26]#39916L, MS[27]#39917L, MS[28]#39918L, MS[29]#39919L, MS[30]#39920L, MS[31]#39921L, MS[32]#39922L, MS[33]#39923L, MS[34]#39924L, MS[35]#39925L, MS[36]#39926L, MS[37]#39927L, MS[38]#39928L, MS[39]#39929L, MS[40]#39930L, MS[41]#39931L, MS[42]#39932L, MS[43]#39933L, MS[44]#39934L, MS[45]#39935L, MS[46]#39936L, MS[47]#39937L, MS[48]#39938L, MS[49]#39939L, MS[50]#39940L, MS[51]#39941L, sum#40056L, sum#40057, sum#40058, count#40059L]
Arguments: hashpartitioning(segment#39823, processing_day#39825, 200), ENSURE_REQUIREMENTS, [plan_id=3764]
(16) HashAggregate
Input [59]: [segment#39823, processing_day#39825, count#40055L, MS[0]#39890L, MS[1]#39891L, MS[2]#39892L, MS[3]#39893L, MS[4]#39894L, MS[5]#39895L, MS[6]#39896L, MS[7]#39897L, MS[8]#39898L, MS[9]#39899L, MS[10]#39900L, MS[11]#39901L, MS[12]#39902L, MS[13]#39903L, MS[14]#39904L, MS[15]#39905L, MS[16]#39906L, MS[17]#39907L, MS[18]#39908L, MS[19]#39909L, MS[20]#39910L, MS[21]#39911L, MS[22]#39912L, MS[23]#39913L, MS[24]#39914L, MS[25]#39915L, MS[26]#39916L, MS[27]#39917L, MS[28]#39918L, MS[29]#39919L, MS[30]#39920L, MS[31]#39921L, MS[32]#39922L, MS[33]#39923L, MS[34]#39924L, MS[35]#39925L, MS[36]#39926L, MS[37]#39927L, MS[38]#39928L, MS[39]#39929L, MS[40]#39930L, MS[41]#39931L, MS[42]#39932L, MS[43]#39933L, MS[44]#39934L, MS[45]#39935L, MS[46]#39936L, MS[47]#39937L, MS[48]#39938L, MS[49]#39939L, MS[50]#39940L, MS[51]#39941L, sum#40056L, sum#40057, sum#40058, count#40059L]
Keys [2]: [segment#39823, processing_day#39825]
Functions [5]: [count(1), approx_count_distinct(customer_id#39819L, 0.05, 0, 0), sum(events#39829), sum(weighted_amount#39831), avg(amount#39827)]
Aggregate Attributes [5]: [count(1)#39837L, approx_count_distinct(customer_id#39819L, 0.05, 0, 0)#39942L, sum(events#39829)#39943L, sum(weighted_amount#39831)#39944, avg(amount#39827)#39945]
Results [7]: [segment#39823, processing_day#39825, count(1)#39837L AS row_count#39832L, approx_count_distinct(customer_id#39819L, 0.05, 0, 0)#39942L AS unique_customers#39833L, sum(events#39829)#39943L AS event_sum#39834L, sum(weighted_amount#39831)#39944 AS weighted_amount_sum#39835, avg(amount#39827)#39945 AS avg_amount#39836]
(17) Exchange
Input [7]: [segment#39823, processing_day#39825, row_count#39832L, unique_customers#39833L, event_sum#39834L, weighted_amount_sum#39835, avg_amount#39836]
Arguments: rangepartitioning(segment#39823 ASC NULLS FIRST, processing_day#39825 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3767]
(18) Sort
Input [7]: [segment#39823, processing_day#39825, row_count#39832L, unique_customers#39833L, event_sum#39834L, weighted_amount_sum#39835, avg_amount#39836]
Arguments: [segment#39823 ASC NULLS FIRST, processing_day#39825 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#39823, processing_day#39825, row_count#39832L, unique_customers#39833L, event_sum#39834L, weighted_amount_sum#39835, avg_amount#39836]
Arguments: isFinalPlan=true