== 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#100031L]
Arguments: Range (17000000, 18000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#100031L % 250000) AS customer_id#100033L, concat(segment-, cast(cast((id#100031L % 12) as int) as string)) AS segment#100037, cast((id#100031L % 14) as int) AS processing_day#100039, ((cast(((id#100031L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#100041, cast((((id#100031L * 29) % 7) + 1) as int) AS events#100043]
Input [1]: [id#100031L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#100033L, segment#100037, processing_day#100039, amount#100041, events#100043, (amount#100041 * cast(events#100043 as double)) AS weighted_amount#100045]
Input [5]: [customer_id#100033L, segment#100037, processing_day#100039, amount#100041, events#100043]
(4) HashAggregate
Input [6]: [customer_id#100033L, segment#100037, processing_day#100039, amount#100041, events#100043, weighted_amount#100045]
Keys [2]: [segment#100037, processing_day#100039]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#100033L, 0.05, 0, 0), partial_sum(events#100043), partial_sum(weighted_amount#100045), partial_avg(amount#100041)]
Aggregate Attributes [57]: [count#100264L, MS[0]#100052L, MS[1]#100053L, MS[2]#100054L, MS[3]#100055L, MS[4]#100056L, MS[5]#100057L, MS[6]#100058L, MS[7]#100059L, MS[8]#100060L, MS[9]#100061L, MS[10]#100062L, MS[11]#100063L, MS[12]#100064L, MS[13]#100065L, MS[14]#100066L, MS[15]#100067L, MS[16]#100068L, MS[17]#100069L, MS[18]#100070L, MS[19]#100071L, MS[20]#100072L, MS[21]#100073L, MS[22]#100074L, MS[23]#100075L, MS[24]#100076L, MS[25]#100077L, MS[26]#100078L, MS[27]#100079L, MS[28]#100080L, MS[29]#100081L, MS[30]#100082L, MS[31]#100083L, MS[32]#100084L, MS[33]#100085L, MS[34]#100086L, MS[35]#100087L, MS[36]#100088L, MS[37]#100089L, MS[38]#100090L, MS[39]#100091L, MS[40]#100092L, MS[41]#100093L, MS[42]#100094L, MS[43]#100095L, MS[44]#100096L, MS[45]#100097L, MS[46]#100098L, MS[47]#100099L, MS[48]#100100L, MS[49]#100101L, MS[50]#100102L, MS[51]#100103L, sum#100265L, sum#100266, sum#100267, count#100268L]
Results [59]: [segment#100037, processing_day#100039, count#100269L, MS[0]#100104L, MS[1]#100105L, MS[2]#100106L, MS[3]#100107L, MS[4]#100108L, MS[5]#100109L, MS[6]#100110L, MS[7]#100111L, MS[8]#100112L, MS[9]#100113L, MS[10]#100114L, MS[11]#100115L, MS[12]#100116L, MS[13]#100117L, MS[14]#100118L, MS[15]#100119L, MS[16]#100120L, MS[17]#100121L, MS[18]#100122L, MS[19]#100123L, MS[20]#100124L, MS[21]#100125L, MS[22]#100126L, MS[23]#100127L, MS[24]#100128L, MS[25]#100129L, MS[26]#100130L, MS[27]#100131L, MS[28]#100132L, MS[29]#100133L, MS[30]#100134L, MS[31]#100135L, MS[32]#100136L, MS[33]#100137L, MS[34]#100138L, MS[35]#100139L, MS[36]#100140L, MS[37]#100141L, MS[38]#100142L, MS[39]#100143L, MS[40]#100144L, MS[41]#100145L, MS[42]#100146L, MS[43]#100147L, MS[44]#100148L, MS[45]#100149L, MS[46]#100150L, MS[47]#100151L, MS[48]#100152L, MS[49]#100153L, MS[50]#100154L, MS[51]#100155L, sum#100270L, sum#100271, sum#100272, count#100273L]
(5) Exchange
Input [59]: [segment#100037, processing_day#100039, count#100269L, MS[0]#100104L, MS[1]#100105L, MS[2]#100106L, MS[3]#100107L, MS[4]#100108L, MS[5]#100109L, MS[6]#100110L, MS[7]#100111L, MS[8]#100112L, MS[9]#100113L, MS[10]#100114L, MS[11]#100115L, MS[12]#100116L, MS[13]#100117L, MS[14]#100118L, MS[15]#100119L, MS[16]#100120L, MS[17]#100121L, MS[18]#100122L, MS[19]#100123L, MS[20]#100124L, MS[21]#100125L, MS[22]#100126L, MS[23]#100127L, MS[24]#100128L, MS[25]#100129L, MS[26]#100130L, MS[27]#100131L, MS[28]#100132L, MS[29]#100133L, MS[30]#100134L, MS[31]#100135L, MS[32]#100136L, MS[33]#100137L, MS[34]#100138L, MS[35]#100139L, MS[36]#100140L, MS[37]#100141L, MS[38]#100142L, MS[39]#100143L, MS[40]#100144L, MS[41]#100145L, MS[42]#100146L, MS[43]#100147L, MS[44]#100148L, MS[45]#100149L, MS[46]#100150L, MS[47]#100151L, MS[48]#100152L, MS[49]#100153L, MS[50]#100154L, MS[51]#100155L, sum#100270L, sum#100271, sum#100272, count#100273L]
Arguments: hashpartitioning(segment#100037, processing_day#100039, 200), ENSURE_REQUIREMENTS, [plan_id=9446]
(6) ShuffleQueryStage
Output [59]: [segment#100037, processing_day#100039, count#100269L, MS[0]#100104L, MS[1]#100105L, MS[2]#100106L, MS[3]#100107L, MS[4]#100108L, MS[5]#100109L, MS[6]#100110L, MS[7]#100111L, MS[8]#100112L, MS[9]#100113L, MS[10]#100114L, MS[11]#100115L, MS[12]#100116L, MS[13]#100117L, MS[14]#100118L, MS[15]#100119L, MS[16]#100120L, MS[17]#100121L, MS[18]#100122L, MS[19]#100123L, MS[20]#100124L, MS[21]#100125L, MS[22]#100126L, MS[23]#100127L, MS[24]#100128L, MS[25]#100129L, MS[26]#100130L, MS[27]#100131L, MS[28]#100132L, MS[29]#100133L, MS[30]#100134L, MS[31]#100135L, MS[32]#100136L, MS[33]#100137L, MS[34]#100138L, MS[35]#100139L, MS[36]#100140L, MS[37]#100141L, MS[38]#100142L, MS[39]#100143L, MS[40]#100144L, MS[41]#100145L, MS[42]#100146L, MS[43]#100147L, MS[44]#100148L, MS[45]#100149L, MS[46]#100150L, MS[47]#100151L, MS[48]#100152L, MS[49]#100153L, MS[50]#100154L, MS[51]#100155L, sum#100270L, sum#100271, sum#100272, count#100273L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#100037, processing_day#100039, count#100269L, MS[0]#100104L, MS[1]#100105L, MS[2]#100106L, MS[3]#100107L, MS[4]#100108L, MS[5]#100109L, MS[6]#100110L, MS[7]#100111L, MS[8]#100112L, MS[9]#100113L, MS[10]#100114L, MS[11]#100115L, MS[12]#100116L, MS[13]#100117L, MS[14]#100118L, MS[15]#100119L, MS[16]#100120L, MS[17]#100121L, MS[18]#100122L, MS[19]#100123L, MS[20]#100124L, MS[21]#100125L, MS[22]#100126L, MS[23]#100127L, MS[24]#100128L, MS[25]#100129L, MS[26]#100130L, MS[27]#100131L, MS[28]#100132L, MS[29]#100133L, MS[30]#100134L, MS[31]#100135L, MS[32]#100136L, MS[33]#100137L, MS[34]#100138L, MS[35]#100139L, MS[36]#100140L, MS[37]#100141L, MS[38]#100142L, MS[39]#100143L, MS[40]#100144L, MS[41]#100145L, MS[42]#100146L, MS[43]#100147L, MS[44]#100148L, MS[45]#100149L, MS[46]#100150L, MS[47]#100151L, MS[48]#100152L, MS[49]#100153L, MS[50]#100154L, MS[51]#100155L, sum#100270L, sum#100271, sum#100272, count#100273L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#100037, processing_day#100039, count#100269L, MS[0]#100104L, MS[1]#100105L, MS[2]#100106L, MS[3]#100107L, MS[4]#100108L, MS[5]#100109L, MS[6]#100110L, MS[7]#100111L, MS[8]#100112L, MS[9]#100113L, MS[10]#100114L, MS[11]#100115L, MS[12]#100116L, MS[13]#100117L, MS[14]#100118L, MS[15]#100119L, MS[16]#100120L, MS[17]#100121L, MS[18]#100122L, MS[19]#100123L, MS[20]#100124L, MS[21]#100125L, MS[22]#100126L, MS[23]#100127L, MS[24]#100128L, MS[25]#100129L, MS[26]#100130L, MS[27]#100131L, MS[28]#100132L, MS[29]#100133L, MS[30]#100134L, MS[31]#100135L, MS[32]#100136L, MS[33]#100137L, MS[34]#100138L, MS[35]#100139L, MS[36]#100140L, MS[37]#100141L, MS[38]#100142L, MS[39]#100143L, MS[40]#100144L, MS[41]#100145L, MS[42]#100146L, MS[43]#100147L, MS[44]#100148L, MS[45]#100149L, MS[46]#100150L, MS[47]#100151L, MS[48]#100152L, MS[49]#100153L, MS[50]#100154L, MS[51]#100155L, sum#100270L, sum#100271, sum#100272, count#100273L]
Keys [2]: [segment#100037, processing_day#100039]
Functions [5]: [count(1), approx_count_distinct(customer_id#100033L, 0.05, 0, 0), sum(events#100043), sum(weighted_amount#100045), avg(amount#100041)]
Aggregate Attributes [5]: [count(1)#100051L, approx_count_distinct(customer_id#100033L, 0.05, 0, 0)#100156L, sum(events#100043)#100157L, sum(weighted_amount#100045)#100158, avg(amount#100041)#100159]
Results [7]: [segment#100037, processing_day#100039, count(1)#100051L AS row_count#100046L, approx_count_distinct(customer_id#100033L, 0.05, 0, 0)#100156L AS unique_customers#100047L, sum(events#100043)#100157L AS event_sum#100048L, sum(weighted_amount#100045)#100158 AS weighted_amount_sum#100049, avg(amount#100041)#100159 AS avg_amount#100050]
(9) Exchange
Input [7]: [segment#100037, processing_day#100039, row_count#100046L, unique_customers#100047L, event_sum#100048L, weighted_amount_sum#100049, avg_amount#100050]
Arguments: rangepartitioning(segment#100037 ASC NULLS FIRST, processing_day#100039 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9468]
(10) ShuffleQueryStage
Output [7]: [segment#100037, processing_day#100039, row_count#100046L, unique_customers#100047L, event_sum#100048L, weighted_amount_sum#100049, avg_amount#100050]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#100037, processing_day#100039, row_count#100046L, unique_customers#100047L, event_sum#100048L, weighted_amount_sum#100049, avg_amount#100050]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#100037, processing_day#100039, row_count#100046L, unique_customers#100047L, event_sum#100048L, weighted_amount_sum#100049, avg_amount#100050]
Arguments: [segment#100037 ASC NULLS FIRST, processing_day#100039 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#100037, processing_day#100039, row_count#100046L, unique_customers#100047L, event_sum#100048L, weighted_amount_sum#100049, avg_amount#100050]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#100033L, segment#100037, processing_day#100039, amount#100041, events#100043, weighted_amount#100045]
Keys [2]: [segment#100037, processing_day#100039]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#100033L, 0.05, 0, 0), partial_sum(events#100043), partial_sum(weighted_amount#100045), partial_avg(amount#100041)]
Aggregate Attributes [57]: [count#100264L, MS[0]#100052L, MS[1]#100053L, MS[2]#100054L, MS[3]#100055L, MS[4]#100056L, MS[5]#100057L, MS[6]#100058L, MS[7]#100059L, MS[8]#100060L, MS[9]#100061L, MS[10]#100062L, MS[11]#100063L, MS[12]#100064L, MS[13]#100065L, MS[14]#100066L, MS[15]#100067L, MS[16]#100068L, MS[17]#100069L, MS[18]#100070L, MS[19]#100071L, MS[20]#100072L, MS[21]#100073L, MS[22]#100074L, MS[23]#100075L, MS[24]#100076L, MS[25]#100077L, MS[26]#100078L, MS[27]#100079L, MS[28]#100080L, MS[29]#100081L, MS[30]#100082L, MS[31]#100083L, MS[32]#100084L, MS[33]#100085L, MS[34]#100086L, MS[35]#100087L, MS[36]#100088L, MS[37]#100089L, MS[38]#100090L, MS[39]#100091L, MS[40]#100092L, MS[41]#100093L, MS[42]#100094L, MS[43]#100095L, MS[44]#100096L, MS[45]#100097L, MS[46]#100098L, MS[47]#100099L, MS[48]#100100L, MS[49]#100101L, MS[50]#100102L, MS[51]#100103L, sum#100265L, sum#100266, sum#100267, count#100268L]
Results [59]: [segment#100037, processing_day#100039, count#100269L, MS[0]#100104L, MS[1]#100105L, MS[2]#100106L, MS[3]#100107L, MS[4]#100108L, MS[5]#100109L, MS[6]#100110L, MS[7]#100111L, MS[8]#100112L, MS[9]#100113L, MS[10]#100114L, MS[11]#100115L, MS[12]#100116L, MS[13]#100117L, MS[14]#100118L, MS[15]#100119L, MS[16]#100120L, MS[17]#100121L, MS[18]#100122L, MS[19]#100123L, MS[20]#100124L, MS[21]#100125L, MS[22]#100126L, MS[23]#100127L, MS[24]#100128L, MS[25]#100129L, MS[26]#100130L, MS[27]#100131L, MS[28]#100132L, MS[29]#100133L, MS[30]#100134L, MS[31]#100135L, MS[32]#100136L, MS[33]#100137L, MS[34]#100138L, MS[35]#100139L, MS[36]#100140L, MS[37]#100141L, MS[38]#100142L, MS[39]#100143L, MS[40]#100144L, MS[41]#100145L, MS[42]#100146L, MS[43]#100147L, MS[44]#100148L, MS[45]#100149L, MS[46]#100150L, MS[47]#100151L, MS[48]#100152L, MS[49]#100153L, MS[50]#100154L, MS[51]#100155L, sum#100270L, sum#100271, sum#100272, count#100273L]
(15) Exchange
Input [59]: [segment#100037, processing_day#100039, count#100269L, MS[0]#100104L, MS[1]#100105L, MS[2]#100106L, MS[3]#100107L, MS[4]#100108L, MS[5]#100109L, MS[6]#100110L, MS[7]#100111L, MS[8]#100112L, MS[9]#100113L, MS[10]#100114L, MS[11]#100115L, MS[12]#100116L, MS[13]#100117L, MS[14]#100118L, MS[15]#100119L, MS[16]#100120L, MS[17]#100121L, MS[18]#100122L, MS[19]#100123L, MS[20]#100124L, MS[21]#100125L, MS[22]#100126L, MS[23]#100127L, MS[24]#100128L, MS[25]#100129L, MS[26]#100130L, MS[27]#100131L, MS[28]#100132L, MS[29]#100133L, MS[30]#100134L, MS[31]#100135L, MS[32]#100136L, MS[33]#100137L, MS[34]#100138L, MS[35]#100139L, MS[36]#100140L, MS[37]#100141L, MS[38]#100142L, MS[39]#100143L, MS[40]#100144L, MS[41]#100145L, MS[42]#100146L, MS[43]#100147L, MS[44]#100148L, MS[45]#100149L, MS[46]#100150L, MS[47]#100151L, MS[48]#100152L, MS[49]#100153L, MS[50]#100154L, MS[51]#100155L, sum#100270L, sum#100271, sum#100272, count#100273L]
Arguments: hashpartitioning(segment#100037, processing_day#100039, 200), ENSURE_REQUIREMENTS, [plan_id=9426]
(16) HashAggregate
Input [59]: [segment#100037, processing_day#100039, count#100269L, MS[0]#100104L, MS[1]#100105L, MS[2]#100106L, MS[3]#100107L, MS[4]#100108L, MS[5]#100109L, MS[6]#100110L, MS[7]#100111L, MS[8]#100112L, MS[9]#100113L, MS[10]#100114L, MS[11]#100115L, MS[12]#100116L, MS[13]#100117L, MS[14]#100118L, MS[15]#100119L, MS[16]#100120L, MS[17]#100121L, MS[18]#100122L, MS[19]#100123L, MS[20]#100124L, MS[21]#100125L, MS[22]#100126L, MS[23]#100127L, MS[24]#100128L, MS[25]#100129L, MS[26]#100130L, MS[27]#100131L, MS[28]#100132L, MS[29]#100133L, MS[30]#100134L, MS[31]#100135L, MS[32]#100136L, MS[33]#100137L, MS[34]#100138L, MS[35]#100139L, MS[36]#100140L, MS[37]#100141L, MS[38]#100142L, MS[39]#100143L, MS[40]#100144L, MS[41]#100145L, MS[42]#100146L, MS[43]#100147L, MS[44]#100148L, MS[45]#100149L, MS[46]#100150L, MS[47]#100151L, MS[48]#100152L, MS[49]#100153L, MS[50]#100154L, MS[51]#100155L, sum#100270L, sum#100271, sum#100272, count#100273L]
Keys [2]: [segment#100037, processing_day#100039]
Functions [5]: [count(1), approx_count_distinct(customer_id#100033L, 0.05, 0, 0), sum(events#100043), sum(weighted_amount#100045), avg(amount#100041)]
Aggregate Attributes [5]: [count(1)#100051L, approx_count_distinct(customer_id#100033L, 0.05, 0, 0)#100156L, sum(events#100043)#100157L, sum(weighted_amount#100045)#100158, avg(amount#100041)#100159]
Results [7]: [segment#100037, processing_day#100039, count(1)#100051L AS row_count#100046L, approx_count_distinct(customer_id#100033L, 0.05, 0, 0)#100156L AS unique_customers#100047L, sum(events#100043)#100157L AS event_sum#100048L, sum(weighted_amount#100045)#100158 AS weighted_amount_sum#100049, avg(amount#100041)#100159 AS avg_amount#100050]
(17) Exchange
Input [7]: [segment#100037, processing_day#100039, row_count#100046L, unique_customers#100047L, event_sum#100048L, weighted_amount_sum#100049, avg_amount#100050]
Arguments: rangepartitioning(segment#100037 ASC NULLS FIRST, processing_day#100039 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9429]
(18) Sort
Input [7]: [segment#100037, processing_day#100039, row_count#100046L, unique_customers#100047L, event_sum#100048L, weighted_amount_sum#100049, avg_amount#100050]
Arguments: [segment#100037 ASC NULLS FIRST, processing_day#100039 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#100037, processing_day#100039, row_count#100046L, unique_customers#100047L, event_sum#100048L, weighted_amount_sum#100049, avg_amount#100050]
Arguments: isFinalPlan=true