== 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#40701L]
Arguments: Range (22000000, 23000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#40701L % 250000) AS customer_id#40703L, concat(segment-, cast(cast((id#40701L % 12) as int) as string)) AS segment#40707, cast((id#40701L % 14) as int) AS processing_day#40709, ((cast(((id#40701L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#40711, cast((((id#40701L * 29) % 7) + 1) as int) AS events#40713]
Input [1]: [id#40701L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#40703L, segment#40707, processing_day#40709, amount#40711, events#40713, (amount#40711 * cast(events#40713 as double)) AS weighted_amount#40715]
Input [5]: [customer_id#40703L, segment#40707, processing_day#40709, amount#40711, events#40713]
(4) HashAggregate
Input [6]: [customer_id#40703L, segment#40707, processing_day#40709, amount#40711, events#40713, weighted_amount#40715]
Keys [2]: [segment#40707, processing_day#40709]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#40703L, 0.05, 0, 0), partial_sum(events#40713), partial_sum(weighted_amount#40715), partial_avg(amount#40711)]
Aggregate Attributes [57]: [count#40934L, MS[0]#40722L, MS[1]#40723L, MS[2]#40724L, MS[3]#40725L, MS[4]#40726L, MS[5]#40727L, MS[6]#40728L, MS[7]#40729L, MS[8]#40730L, MS[9]#40731L, MS[10]#40732L, MS[11]#40733L, MS[12]#40734L, MS[13]#40735L, MS[14]#40736L, MS[15]#40737L, MS[16]#40738L, MS[17]#40739L, MS[18]#40740L, MS[19]#40741L, MS[20]#40742L, MS[21]#40743L, MS[22]#40744L, MS[23]#40745L, MS[24]#40746L, MS[25]#40747L, MS[26]#40748L, MS[27]#40749L, MS[28]#40750L, MS[29]#40751L, MS[30]#40752L, MS[31]#40753L, MS[32]#40754L, MS[33]#40755L, MS[34]#40756L, MS[35]#40757L, MS[36]#40758L, MS[37]#40759L, MS[38]#40760L, MS[39]#40761L, MS[40]#40762L, MS[41]#40763L, MS[42]#40764L, MS[43]#40765L, MS[44]#40766L, MS[45]#40767L, MS[46]#40768L, MS[47]#40769L, MS[48]#40770L, MS[49]#40771L, MS[50]#40772L, MS[51]#40773L, sum#40935L, sum#40936, sum#40937, count#40938L]
Results [59]: [segment#40707, processing_day#40709, count#40939L, MS[0]#40774L, MS[1]#40775L, MS[2]#40776L, MS[3]#40777L, MS[4]#40778L, MS[5]#40779L, MS[6]#40780L, MS[7]#40781L, MS[8]#40782L, MS[9]#40783L, MS[10]#40784L, MS[11]#40785L, MS[12]#40786L, MS[13]#40787L, MS[14]#40788L, MS[15]#40789L, MS[16]#40790L, MS[17]#40791L, MS[18]#40792L, MS[19]#40793L, MS[20]#40794L, MS[21]#40795L, MS[22]#40796L, MS[23]#40797L, MS[24]#40798L, MS[25]#40799L, MS[26]#40800L, MS[27]#40801L, MS[28]#40802L, MS[29]#40803L, MS[30]#40804L, MS[31]#40805L, MS[32]#40806L, MS[33]#40807L, MS[34]#40808L, MS[35]#40809L, MS[36]#40810L, MS[37]#40811L, MS[38]#40812L, MS[39]#40813L, MS[40]#40814L, MS[41]#40815L, MS[42]#40816L, MS[43]#40817L, MS[44]#40818L, MS[45]#40819L, MS[46]#40820L, MS[47]#40821L, MS[48]#40822L, MS[49]#40823L, MS[50]#40824L, MS[51]#40825L, sum#40940L, sum#40941, sum#40942, count#40943L]
(5) Exchange
Input [59]: [segment#40707, processing_day#40709, count#40939L, MS[0]#40774L, MS[1]#40775L, MS[2]#40776L, MS[3]#40777L, MS[4]#40778L, MS[5]#40779L, MS[6]#40780L, MS[7]#40781L, MS[8]#40782L, MS[9]#40783L, MS[10]#40784L, MS[11]#40785L, MS[12]#40786L, MS[13]#40787L, MS[14]#40788L, MS[15]#40789L, MS[16]#40790L, MS[17]#40791L, MS[18]#40792L, MS[19]#40793L, MS[20]#40794L, MS[21]#40795L, MS[22]#40796L, MS[23]#40797L, MS[24]#40798L, MS[25]#40799L, MS[26]#40800L, MS[27]#40801L, MS[28]#40802L, MS[29]#40803L, MS[30]#40804L, MS[31]#40805L, MS[32]#40806L, MS[33]#40807L, MS[34]#40808L, MS[35]#40809L, MS[36]#40810L, MS[37]#40811L, MS[38]#40812L, MS[39]#40813L, MS[40]#40814L, MS[41]#40815L, MS[42]#40816L, MS[43]#40817L, MS[44]#40818L, MS[45]#40819L, MS[46]#40820L, MS[47]#40821L, MS[48]#40822L, MS[49]#40823L, MS[50]#40824L, MS[51]#40825L, sum#40940L, sum#40941, sum#40942, count#40943L]
Arguments: hashpartitioning(segment#40707, processing_day#40709, 200), ENSURE_REQUIREMENTS, [plan_id=3867]
(6) ShuffleQueryStage
Output [59]: [segment#40707, processing_day#40709, count#40939L, MS[0]#40774L, MS[1]#40775L, MS[2]#40776L, MS[3]#40777L, MS[4]#40778L, MS[5]#40779L, MS[6]#40780L, MS[7]#40781L, MS[8]#40782L, MS[9]#40783L, MS[10]#40784L, MS[11]#40785L, MS[12]#40786L, MS[13]#40787L, MS[14]#40788L, MS[15]#40789L, MS[16]#40790L, MS[17]#40791L, MS[18]#40792L, MS[19]#40793L, MS[20]#40794L, MS[21]#40795L, MS[22]#40796L, MS[23]#40797L, MS[24]#40798L, MS[25]#40799L, MS[26]#40800L, MS[27]#40801L, MS[28]#40802L, MS[29]#40803L, MS[30]#40804L, MS[31]#40805L, MS[32]#40806L, MS[33]#40807L, MS[34]#40808L, MS[35]#40809L, MS[36]#40810L, MS[37]#40811L, MS[38]#40812L, MS[39]#40813L, MS[40]#40814L, MS[41]#40815L, MS[42]#40816L, MS[43]#40817L, MS[44]#40818L, MS[45]#40819L, MS[46]#40820L, MS[47]#40821L, MS[48]#40822L, MS[49]#40823L, MS[50]#40824L, MS[51]#40825L, sum#40940L, sum#40941, sum#40942, count#40943L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#40707, processing_day#40709, count#40939L, MS[0]#40774L, MS[1]#40775L, MS[2]#40776L, MS[3]#40777L, MS[4]#40778L, MS[5]#40779L, MS[6]#40780L, MS[7]#40781L, MS[8]#40782L, MS[9]#40783L, MS[10]#40784L, MS[11]#40785L, MS[12]#40786L, MS[13]#40787L, MS[14]#40788L, MS[15]#40789L, MS[16]#40790L, MS[17]#40791L, MS[18]#40792L, MS[19]#40793L, MS[20]#40794L, MS[21]#40795L, MS[22]#40796L, MS[23]#40797L, MS[24]#40798L, MS[25]#40799L, MS[26]#40800L, MS[27]#40801L, MS[28]#40802L, MS[29]#40803L, MS[30]#40804L, MS[31]#40805L, MS[32]#40806L, MS[33]#40807L, MS[34]#40808L, MS[35]#40809L, MS[36]#40810L, MS[37]#40811L, MS[38]#40812L, MS[39]#40813L, MS[40]#40814L, MS[41]#40815L, MS[42]#40816L, MS[43]#40817L, MS[44]#40818L, MS[45]#40819L, MS[46]#40820L, MS[47]#40821L, MS[48]#40822L, MS[49]#40823L, MS[50]#40824L, MS[51]#40825L, sum#40940L, sum#40941, sum#40942, count#40943L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#40707, processing_day#40709, count#40939L, MS[0]#40774L, MS[1]#40775L, MS[2]#40776L, MS[3]#40777L, MS[4]#40778L, MS[5]#40779L, MS[6]#40780L, MS[7]#40781L, MS[8]#40782L, MS[9]#40783L, MS[10]#40784L, MS[11]#40785L, MS[12]#40786L, MS[13]#40787L, MS[14]#40788L, MS[15]#40789L, MS[16]#40790L, MS[17]#40791L, MS[18]#40792L, MS[19]#40793L, MS[20]#40794L, MS[21]#40795L, MS[22]#40796L, MS[23]#40797L, MS[24]#40798L, MS[25]#40799L, MS[26]#40800L, MS[27]#40801L, MS[28]#40802L, MS[29]#40803L, MS[30]#40804L, MS[31]#40805L, MS[32]#40806L, MS[33]#40807L, MS[34]#40808L, MS[35]#40809L, MS[36]#40810L, MS[37]#40811L, MS[38]#40812L, MS[39]#40813L, MS[40]#40814L, MS[41]#40815L, MS[42]#40816L, MS[43]#40817L, MS[44]#40818L, MS[45]#40819L, MS[46]#40820L, MS[47]#40821L, MS[48]#40822L, MS[49]#40823L, MS[50]#40824L, MS[51]#40825L, sum#40940L, sum#40941, sum#40942, count#40943L]
Keys [2]: [segment#40707, processing_day#40709]
Functions [5]: [count(1), approx_count_distinct(customer_id#40703L, 0.05, 0, 0), sum(events#40713), sum(weighted_amount#40715), avg(amount#40711)]
Aggregate Attributes [5]: [count(1)#40721L, approx_count_distinct(customer_id#40703L, 0.05, 0, 0)#40826L, sum(events#40713)#40827L, sum(weighted_amount#40715)#40828, avg(amount#40711)#40829]
Results [7]: [segment#40707, processing_day#40709, count(1)#40721L AS row_count#40716L, approx_count_distinct(customer_id#40703L, 0.05, 0, 0)#40826L AS unique_customers#40717L, sum(events#40713)#40827L AS event_sum#40718L, sum(weighted_amount#40715)#40828 AS weighted_amount_sum#40719, avg(amount#40711)#40829 AS avg_amount#40720]
(9) Exchange
Input [7]: [segment#40707, processing_day#40709, row_count#40716L, unique_customers#40717L, event_sum#40718L, weighted_amount_sum#40719, avg_amount#40720]
Arguments: rangepartitioning(segment#40707 ASC NULLS FIRST, processing_day#40709 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3889]
(10) ShuffleQueryStage
Output [7]: [segment#40707, processing_day#40709, row_count#40716L, unique_customers#40717L, event_sum#40718L, weighted_amount_sum#40719, avg_amount#40720]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#40707, processing_day#40709, row_count#40716L, unique_customers#40717L, event_sum#40718L, weighted_amount_sum#40719, avg_amount#40720]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#40707, processing_day#40709, row_count#40716L, unique_customers#40717L, event_sum#40718L, weighted_amount_sum#40719, avg_amount#40720]
Arguments: [segment#40707 ASC NULLS FIRST, processing_day#40709 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#40707, processing_day#40709, row_count#40716L, unique_customers#40717L, event_sum#40718L, weighted_amount_sum#40719, avg_amount#40720]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#40703L, segment#40707, processing_day#40709, amount#40711, events#40713, weighted_amount#40715]
Keys [2]: [segment#40707, processing_day#40709]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#40703L, 0.05, 0, 0), partial_sum(events#40713), partial_sum(weighted_amount#40715), partial_avg(amount#40711)]
Aggregate Attributes [57]: [count#40934L, MS[0]#40722L, MS[1]#40723L, MS[2]#40724L, MS[3]#40725L, MS[4]#40726L, MS[5]#40727L, MS[6]#40728L, MS[7]#40729L, MS[8]#40730L, MS[9]#40731L, MS[10]#40732L, MS[11]#40733L, MS[12]#40734L, MS[13]#40735L, MS[14]#40736L, MS[15]#40737L, MS[16]#40738L, MS[17]#40739L, MS[18]#40740L, MS[19]#40741L, MS[20]#40742L, MS[21]#40743L, MS[22]#40744L, MS[23]#40745L, MS[24]#40746L, MS[25]#40747L, MS[26]#40748L, MS[27]#40749L, MS[28]#40750L, MS[29]#40751L, MS[30]#40752L, MS[31]#40753L, MS[32]#40754L, MS[33]#40755L, MS[34]#40756L, MS[35]#40757L, MS[36]#40758L, MS[37]#40759L, MS[38]#40760L, MS[39]#40761L, MS[40]#40762L, MS[41]#40763L, MS[42]#40764L, MS[43]#40765L, MS[44]#40766L, MS[45]#40767L, MS[46]#40768L, MS[47]#40769L, MS[48]#40770L, MS[49]#40771L, MS[50]#40772L, MS[51]#40773L, sum#40935L, sum#40936, sum#40937, count#40938L]
Results [59]: [segment#40707, processing_day#40709, count#40939L, MS[0]#40774L, MS[1]#40775L, MS[2]#40776L, MS[3]#40777L, MS[4]#40778L, MS[5]#40779L, MS[6]#40780L, MS[7]#40781L, MS[8]#40782L, MS[9]#40783L, MS[10]#40784L, MS[11]#40785L, MS[12]#40786L, MS[13]#40787L, MS[14]#40788L, MS[15]#40789L, MS[16]#40790L, MS[17]#40791L, MS[18]#40792L, MS[19]#40793L, MS[20]#40794L, MS[21]#40795L, MS[22]#40796L, MS[23]#40797L, MS[24]#40798L, MS[25]#40799L, MS[26]#40800L, MS[27]#40801L, MS[28]#40802L, MS[29]#40803L, MS[30]#40804L, MS[31]#40805L, MS[32]#40806L, MS[33]#40807L, MS[34]#40808L, MS[35]#40809L, MS[36]#40810L, MS[37]#40811L, MS[38]#40812L, MS[39]#40813L, MS[40]#40814L, MS[41]#40815L, MS[42]#40816L, MS[43]#40817L, MS[44]#40818L, MS[45]#40819L, MS[46]#40820L, MS[47]#40821L, MS[48]#40822L, MS[49]#40823L, MS[50]#40824L, MS[51]#40825L, sum#40940L, sum#40941, sum#40942, count#40943L]
(15) Exchange
Input [59]: [segment#40707, processing_day#40709, count#40939L, MS[0]#40774L, MS[1]#40775L, MS[2]#40776L, MS[3]#40777L, MS[4]#40778L, MS[5]#40779L, MS[6]#40780L, MS[7]#40781L, MS[8]#40782L, MS[9]#40783L, MS[10]#40784L, MS[11]#40785L, MS[12]#40786L, MS[13]#40787L, MS[14]#40788L, MS[15]#40789L, MS[16]#40790L, MS[17]#40791L, MS[18]#40792L, MS[19]#40793L, MS[20]#40794L, MS[21]#40795L, MS[22]#40796L, MS[23]#40797L, MS[24]#40798L, MS[25]#40799L, MS[26]#40800L, MS[27]#40801L, MS[28]#40802L, MS[29]#40803L, MS[30]#40804L, MS[31]#40805L, MS[32]#40806L, MS[33]#40807L, MS[34]#40808L, MS[35]#40809L, MS[36]#40810L, MS[37]#40811L, MS[38]#40812L, MS[39]#40813L, MS[40]#40814L, MS[41]#40815L, MS[42]#40816L, MS[43]#40817L, MS[44]#40818L, MS[45]#40819L, MS[46]#40820L, MS[47]#40821L, MS[48]#40822L, MS[49]#40823L, MS[50]#40824L, MS[51]#40825L, sum#40940L, sum#40941, sum#40942, count#40943L]
Arguments: hashpartitioning(segment#40707, processing_day#40709, 200), ENSURE_REQUIREMENTS, [plan_id=3847]
(16) HashAggregate
Input [59]: [segment#40707, processing_day#40709, count#40939L, MS[0]#40774L, MS[1]#40775L, MS[2]#40776L, MS[3]#40777L, MS[4]#40778L, MS[5]#40779L, MS[6]#40780L, MS[7]#40781L, MS[8]#40782L, MS[9]#40783L, MS[10]#40784L, MS[11]#40785L, MS[12]#40786L, MS[13]#40787L, MS[14]#40788L, MS[15]#40789L, MS[16]#40790L, MS[17]#40791L, MS[18]#40792L, MS[19]#40793L, MS[20]#40794L, MS[21]#40795L, MS[22]#40796L, MS[23]#40797L, MS[24]#40798L, MS[25]#40799L, MS[26]#40800L, MS[27]#40801L, MS[28]#40802L, MS[29]#40803L, MS[30]#40804L, MS[31]#40805L, MS[32]#40806L, MS[33]#40807L, MS[34]#40808L, MS[35]#40809L, MS[36]#40810L, MS[37]#40811L, MS[38]#40812L, MS[39]#40813L, MS[40]#40814L, MS[41]#40815L, MS[42]#40816L, MS[43]#40817L, MS[44]#40818L, MS[45]#40819L, MS[46]#40820L, MS[47]#40821L, MS[48]#40822L, MS[49]#40823L, MS[50]#40824L, MS[51]#40825L, sum#40940L, sum#40941, sum#40942, count#40943L]
Keys [2]: [segment#40707, processing_day#40709]
Functions [5]: [count(1), approx_count_distinct(customer_id#40703L, 0.05, 0, 0), sum(events#40713), sum(weighted_amount#40715), avg(amount#40711)]
Aggregate Attributes [5]: [count(1)#40721L, approx_count_distinct(customer_id#40703L, 0.05, 0, 0)#40826L, sum(events#40713)#40827L, sum(weighted_amount#40715)#40828, avg(amount#40711)#40829]
Results [7]: [segment#40707, processing_day#40709, count(1)#40721L AS row_count#40716L, approx_count_distinct(customer_id#40703L, 0.05, 0, 0)#40826L AS unique_customers#40717L, sum(events#40713)#40827L AS event_sum#40718L, sum(weighted_amount#40715)#40828 AS weighted_amount_sum#40719, avg(amount#40711)#40829 AS avg_amount#40720]
(17) Exchange
Input [7]: [segment#40707, processing_day#40709, row_count#40716L, unique_customers#40717L, event_sum#40718L, weighted_amount_sum#40719, avg_amount#40720]
Arguments: rangepartitioning(segment#40707 ASC NULLS FIRST, processing_day#40709 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3850]
(18) Sort
Input [7]: [segment#40707, processing_day#40709, row_count#40716L, unique_customers#40717L, event_sum#40718L, weighted_amount_sum#40719, avg_amount#40720]
Arguments: [segment#40707 ASC NULLS FIRST, processing_day#40709 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#40707, processing_day#40709, row_count#40716L, unique_customers#40717L, event_sum#40718L, weighted_amount_sum#40719, avg_amount#40720]
Arguments: isFinalPlan=true