== 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#15029L]
Arguments: Range (17000000, 18000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#15029L % 250000) AS customer_id#15031L, concat(segment-, cast(cast((id#15029L % 12) as int) as string)) AS segment#15035, cast((id#15029L % 14) as int) AS processing_day#15037, ((cast(((id#15029L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#15039, cast((((id#15029L * 29) % 7) + 1) as int) AS events#15041]
Input [1]: [id#15029L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#15031L, segment#15035, processing_day#15037, amount#15039, events#15041, (amount#15039 * cast(events#15041 as double)) AS weighted_amount#15043]
Input [5]: [customer_id#15031L, segment#15035, processing_day#15037, amount#15039, events#15041]
(4) HashAggregate
Input [6]: [customer_id#15031L, segment#15035, processing_day#15037, amount#15039, events#15041, weighted_amount#15043]
Keys [2]: [segment#15035, processing_day#15037]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#15031L, 0.05, 0, 0), partial_sum(events#15041), partial_sum(weighted_amount#15043), partial_avg(amount#15039)]
Aggregate Attributes [57]: [count#15262L, MS[0]#15050L, MS[1]#15051L, MS[2]#15052L, MS[3]#15053L, MS[4]#15054L, MS[5]#15055L, MS[6]#15056L, MS[7]#15057L, MS[8]#15058L, MS[9]#15059L, MS[10]#15060L, MS[11]#15061L, MS[12]#15062L, MS[13]#15063L, MS[14]#15064L, MS[15]#15065L, MS[16]#15066L, MS[17]#15067L, MS[18]#15068L, MS[19]#15069L, MS[20]#15070L, MS[21]#15071L, MS[22]#15072L, MS[23]#15073L, MS[24]#15074L, MS[25]#15075L, MS[26]#15076L, MS[27]#15077L, MS[28]#15078L, MS[29]#15079L, MS[30]#15080L, MS[31]#15081L, MS[32]#15082L, MS[33]#15083L, MS[34]#15084L, MS[35]#15085L, MS[36]#15086L, MS[37]#15087L, MS[38]#15088L, MS[39]#15089L, MS[40]#15090L, MS[41]#15091L, MS[42]#15092L, MS[43]#15093L, MS[44]#15094L, MS[45]#15095L, MS[46]#15096L, MS[47]#15097L, MS[48]#15098L, MS[49]#15099L, MS[50]#15100L, MS[51]#15101L, sum#15263L, sum#15264, sum#15265, count#15266L]
Results [59]: [segment#15035, processing_day#15037, count#15267L, MS[0]#15102L, MS[1]#15103L, MS[2]#15104L, MS[3]#15105L, MS[4]#15106L, MS[5]#15107L, MS[6]#15108L, MS[7]#15109L, MS[8]#15110L, MS[9]#15111L, MS[10]#15112L, MS[11]#15113L, MS[12]#15114L, MS[13]#15115L, MS[14]#15116L, MS[15]#15117L, MS[16]#15118L, MS[17]#15119L, MS[18]#15120L, MS[19]#15121L, MS[20]#15122L, MS[21]#15123L, MS[22]#15124L, MS[23]#15125L, MS[24]#15126L, MS[25]#15127L, MS[26]#15128L, MS[27]#15129L, MS[28]#15130L, MS[29]#15131L, MS[30]#15132L, MS[31]#15133L, MS[32]#15134L, MS[33]#15135L, MS[34]#15136L, MS[35]#15137L, MS[36]#15138L, MS[37]#15139L, MS[38]#15140L, MS[39]#15141L, MS[40]#15142L, MS[41]#15143L, MS[42]#15144L, MS[43]#15145L, MS[44]#15146L, MS[45]#15147L, MS[46]#15148L, MS[47]#15149L, MS[48]#15150L, MS[49]#15151L, MS[50]#15152L, MS[51]#15153L, sum#15268L, sum#15269, sum#15270, count#15271L]
(5) Exchange
Input [59]: [segment#15035, processing_day#15037, count#15267L, MS[0]#15102L, MS[1]#15103L, MS[2]#15104L, MS[3]#15105L, MS[4]#15106L, MS[5]#15107L, MS[6]#15108L, MS[7]#15109L, MS[8]#15110L, MS[9]#15111L, MS[10]#15112L, MS[11]#15113L, MS[12]#15114L, MS[13]#15115L, MS[14]#15116L, MS[15]#15117L, MS[16]#15118L, MS[17]#15119L, MS[18]#15120L, MS[19]#15121L, MS[20]#15122L, MS[21]#15123L, MS[22]#15124L, MS[23]#15125L, MS[24]#15126L, MS[25]#15127L, MS[26]#15128L, MS[27]#15129L, MS[28]#15130L, MS[29]#15131L, MS[30]#15132L, MS[31]#15133L, MS[32]#15134L, MS[33]#15135L, MS[34]#15136L, MS[35]#15137L, MS[36]#15138L, MS[37]#15139L, MS[38]#15140L, MS[39]#15141L, MS[40]#15142L, MS[41]#15143L, MS[42]#15144L, MS[43]#15145L, MS[44]#15146L, MS[45]#15147L, MS[46]#15148L, MS[47]#15149L, MS[48]#15150L, MS[49]#15151L, MS[50]#15152L, MS[51]#15153L, sum#15268L, sum#15269, sum#15270, count#15271L]
Arguments: hashpartitioning(segment#15035, processing_day#15037, 200), ENSURE_REQUIREMENTS, [plan_id=1454]
(6) ShuffleQueryStage
Output [59]: [segment#15035, processing_day#15037, count#15267L, MS[0]#15102L, MS[1]#15103L, MS[2]#15104L, MS[3]#15105L, MS[4]#15106L, MS[5]#15107L, MS[6]#15108L, MS[7]#15109L, MS[8]#15110L, MS[9]#15111L, MS[10]#15112L, MS[11]#15113L, MS[12]#15114L, MS[13]#15115L, MS[14]#15116L, MS[15]#15117L, MS[16]#15118L, MS[17]#15119L, MS[18]#15120L, MS[19]#15121L, MS[20]#15122L, MS[21]#15123L, MS[22]#15124L, MS[23]#15125L, MS[24]#15126L, MS[25]#15127L, MS[26]#15128L, MS[27]#15129L, MS[28]#15130L, MS[29]#15131L, MS[30]#15132L, MS[31]#15133L, MS[32]#15134L, MS[33]#15135L, MS[34]#15136L, MS[35]#15137L, MS[36]#15138L, MS[37]#15139L, MS[38]#15140L, MS[39]#15141L, MS[40]#15142L, MS[41]#15143L, MS[42]#15144L, MS[43]#15145L, MS[44]#15146L, MS[45]#15147L, MS[46]#15148L, MS[47]#15149L, MS[48]#15150L, MS[49]#15151L, MS[50]#15152L, MS[51]#15153L, sum#15268L, sum#15269, sum#15270, count#15271L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#15035, processing_day#15037, count#15267L, MS[0]#15102L, MS[1]#15103L, MS[2]#15104L, MS[3]#15105L, MS[4]#15106L, MS[5]#15107L, MS[6]#15108L, MS[7]#15109L, MS[8]#15110L, MS[9]#15111L, MS[10]#15112L, MS[11]#15113L, MS[12]#15114L, MS[13]#15115L, MS[14]#15116L, MS[15]#15117L, MS[16]#15118L, MS[17]#15119L, MS[18]#15120L, MS[19]#15121L, MS[20]#15122L, MS[21]#15123L, MS[22]#15124L, MS[23]#15125L, MS[24]#15126L, MS[25]#15127L, MS[26]#15128L, MS[27]#15129L, MS[28]#15130L, MS[29]#15131L, MS[30]#15132L, MS[31]#15133L, MS[32]#15134L, MS[33]#15135L, MS[34]#15136L, MS[35]#15137L, MS[36]#15138L, MS[37]#15139L, MS[38]#15140L, MS[39]#15141L, MS[40]#15142L, MS[41]#15143L, MS[42]#15144L, MS[43]#15145L, MS[44]#15146L, MS[45]#15147L, MS[46]#15148L, MS[47]#15149L, MS[48]#15150L, MS[49]#15151L, MS[50]#15152L, MS[51]#15153L, sum#15268L, sum#15269, sum#15270, count#15271L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#15035, processing_day#15037, count#15267L, MS[0]#15102L, MS[1]#15103L, MS[2]#15104L, MS[3]#15105L, MS[4]#15106L, MS[5]#15107L, MS[6]#15108L, MS[7]#15109L, MS[8]#15110L, MS[9]#15111L, MS[10]#15112L, MS[11]#15113L, MS[12]#15114L, MS[13]#15115L, MS[14]#15116L, MS[15]#15117L, MS[16]#15118L, MS[17]#15119L, MS[18]#15120L, MS[19]#15121L, MS[20]#15122L, MS[21]#15123L, MS[22]#15124L, MS[23]#15125L, MS[24]#15126L, MS[25]#15127L, MS[26]#15128L, MS[27]#15129L, MS[28]#15130L, MS[29]#15131L, MS[30]#15132L, MS[31]#15133L, MS[32]#15134L, MS[33]#15135L, MS[34]#15136L, MS[35]#15137L, MS[36]#15138L, MS[37]#15139L, MS[38]#15140L, MS[39]#15141L, MS[40]#15142L, MS[41]#15143L, MS[42]#15144L, MS[43]#15145L, MS[44]#15146L, MS[45]#15147L, MS[46]#15148L, MS[47]#15149L, MS[48]#15150L, MS[49]#15151L, MS[50]#15152L, MS[51]#15153L, sum#15268L, sum#15269, sum#15270, count#15271L]
Keys [2]: [segment#15035, processing_day#15037]
Functions [5]: [count(1), approx_count_distinct(customer_id#15031L, 0.05, 0, 0), sum(events#15041), sum(weighted_amount#15043), avg(amount#15039)]
Aggregate Attributes [5]: [count(1)#15049L, approx_count_distinct(customer_id#15031L, 0.05, 0, 0)#15154L, sum(events#15041)#15155L, sum(weighted_amount#15043)#15156, avg(amount#15039)#15157]
Results [7]: [segment#15035, processing_day#15037, count(1)#15049L AS row_count#15044L, approx_count_distinct(customer_id#15031L, 0.05, 0, 0)#15154L AS unique_customers#15045L, sum(events#15041)#15155L AS event_sum#15046L, sum(weighted_amount#15043)#15156 AS weighted_amount_sum#15047, avg(amount#15039)#15157 AS avg_amount#15048]
(9) Exchange
Input [7]: [segment#15035, processing_day#15037, row_count#15044L, unique_customers#15045L, event_sum#15046L, weighted_amount_sum#15047, avg_amount#15048]
Arguments: rangepartitioning(segment#15035 ASC NULLS FIRST, processing_day#15037 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1476]
(10) ShuffleQueryStage
Output [7]: [segment#15035, processing_day#15037, row_count#15044L, unique_customers#15045L, event_sum#15046L, weighted_amount_sum#15047, avg_amount#15048]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#15035, processing_day#15037, row_count#15044L, unique_customers#15045L, event_sum#15046L, weighted_amount_sum#15047, avg_amount#15048]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#15035, processing_day#15037, row_count#15044L, unique_customers#15045L, event_sum#15046L, weighted_amount_sum#15047, avg_amount#15048]
Arguments: [segment#15035 ASC NULLS FIRST, processing_day#15037 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#15035, processing_day#15037, row_count#15044L, unique_customers#15045L, event_sum#15046L, weighted_amount_sum#15047, avg_amount#15048]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#15031L, segment#15035, processing_day#15037, amount#15039, events#15041, weighted_amount#15043]
Keys [2]: [segment#15035, processing_day#15037]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#15031L, 0.05, 0, 0), partial_sum(events#15041), partial_sum(weighted_amount#15043), partial_avg(amount#15039)]
Aggregate Attributes [57]: [count#15262L, MS[0]#15050L, MS[1]#15051L, MS[2]#15052L, MS[3]#15053L, MS[4]#15054L, MS[5]#15055L, MS[6]#15056L, MS[7]#15057L, MS[8]#15058L, MS[9]#15059L, MS[10]#15060L, MS[11]#15061L, MS[12]#15062L, MS[13]#15063L, MS[14]#15064L, MS[15]#15065L, MS[16]#15066L, MS[17]#15067L, MS[18]#15068L, MS[19]#15069L, MS[20]#15070L, MS[21]#15071L, MS[22]#15072L, MS[23]#15073L, MS[24]#15074L, MS[25]#15075L, MS[26]#15076L, MS[27]#15077L, MS[28]#15078L, MS[29]#15079L, MS[30]#15080L, MS[31]#15081L, MS[32]#15082L, MS[33]#15083L, MS[34]#15084L, MS[35]#15085L, MS[36]#15086L, MS[37]#15087L, MS[38]#15088L, MS[39]#15089L, MS[40]#15090L, MS[41]#15091L, MS[42]#15092L, MS[43]#15093L, MS[44]#15094L, MS[45]#15095L, MS[46]#15096L, MS[47]#15097L, MS[48]#15098L, MS[49]#15099L, MS[50]#15100L, MS[51]#15101L, sum#15263L, sum#15264, sum#15265, count#15266L]
Results [59]: [segment#15035, processing_day#15037, count#15267L, MS[0]#15102L, MS[1]#15103L, MS[2]#15104L, MS[3]#15105L, MS[4]#15106L, MS[5]#15107L, MS[6]#15108L, MS[7]#15109L, MS[8]#15110L, MS[9]#15111L, MS[10]#15112L, MS[11]#15113L, MS[12]#15114L, MS[13]#15115L, MS[14]#15116L, MS[15]#15117L, MS[16]#15118L, MS[17]#15119L, MS[18]#15120L, MS[19]#15121L, MS[20]#15122L, MS[21]#15123L, MS[22]#15124L, MS[23]#15125L, MS[24]#15126L, MS[25]#15127L, MS[26]#15128L, MS[27]#15129L, MS[28]#15130L, MS[29]#15131L, MS[30]#15132L, MS[31]#15133L, MS[32]#15134L, MS[33]#15135L, MS[34]#15136L, MS[35]#15137L, MS[36]#15138L, MS[37]#15139L, MS[38]#15140L, MS[39]#15141L, MS[40]#15142L, MS[41]#15143L, MS[42]#15144L, MS[43]#15145L, MS[44]#15146L, MS[45]#15147L, MS[46]#15148L, MS[47]#15149L, MS[48]#15150L, MS[49]#15151L, MS[50]#15152L, MS[51]#15153L, sum#15268L, sum#15269, sum#15270, count#15271L]
(15) Exchange
Input [59]: [segment#15035, processing_day#15037, count#15267L, MS[0]#15102L, MS[1]#15103L, MS[2]#15104L, MS[3]#15105L, MS[4]#15106L, MS[5]#15107L, MS[6]#15108L, MS[7]#15109L, MS[8]#15110L, MS[9]#15111L, MS[10]#15112L, MS[11]#15113L, MS[12]#15114L, MS[13]#15115L, MS[14]#15116L, MS[15]#15117L, MS[16]#15118L, MS[17]#15119L, MS[18]#15120L, MS[19]#15121L, MS[20]#15122L, MS[21]#15123L, MS[22]#15124L, MS[23]#15125L, MS[24]#15126L, MS[25]#15127L, MS[26]#15128L, MS[27]#15129L, MS[28]#15130L, MS[29]#15131L, MS[30]#15132L, MS[31]#15133L, MS[32]#15134L, MS[33]#15135L, MS[34]#15136L, MS[35]#15137L, MS[36]#15138L, MS[37]#15139L, MS[38]#15140L, MS[39]#15141L, MS[40]#15142L, MS[41]#15143L, MS[42]#15144L, MS[43]#15145L, MS[44]#15146L, MS[45]#15147L, MS[46]#15148L, MS[47]#15149L, MS[48]#15150L, MS[49]#15151L, MS[50]#15152L, MS[51]#15153L, sum#15268L, sum#15269, sum#15270, count#15271L]
Arguments: hashpartitioning(segment#15035, processing_day#15037, 200), ENSURE_REQUIREMENTS, [plan_id=1434]
(16) HashAggregate
Input [59]: [segment#15035, processing_day#15037, count#15267L, MS[0]#15102L, MS[1]#15103L, MS[2]#15104L, MS[3]#15105L, MS[4]#15106L, MS[5]#15107L, MS[6]#15108L, MS[7]#15109L, MS[8]#15110L, MS[9]#15111L, MS[10]#15112L, MS[11]#15113L, MS[12]#15114L, MS[13]#15115L, MS[14]#15116L, MS[15]#15117L, MS[16]#15118L, MS[17]#15119L, MS[18]#15120L, MS[19]#15121L, MS[20]#15122L, MS[21]#15123L, MS[22]#15124L, MS[23]#15125L, MS[24]#15126L, MS[25]#15127L, MS[26]#15128L, MS[27]#15129L, MS[28]#15130L, MS[29]#15131L, MS[30]#15132L, MS[31]#15133L, MS[32]#15134L, MS[33]#15135L, MS[34]#15136L, MS[35]#15137L, MS[36]#15138L, MS[37]#15139L, MS[38]#15140L, MS[39]#15141L, MS[40]#15142L, MS[41]#15143L, MS[42]#15144L, MS[43]#15145L, MS[44]#15146L, MS[45]#15147L, MS[46]#15148L, MS[47]#15149L, MS[48]#15150L, MS[49]#15151L, MS[50]#15152L, MS[51]#15153L, sum#15268L, sum#15269, sum#15270, count#15271L]
Keys [2]: [segment#15035, processing_day#15037]
Functions [5]: [count(1), approx_count_distinct(customer_id#15031L, 0.05, 0, 0), sum(events#15041), sum(weighted_amount#15043), avg(amount#15039)]
Aggregate Attributes [5]: [count(1)#15049L, approx_count_distinct(customer_id#15031L, 0.05, 0, 0)#15154L, sum(events#15041)#15155L, sum(weighted_amount#15043)#15156, avg(amount#15039)#15157]
Results [7]: [segment#15035, processing_day#15037, count(1)#15049L AS row_count#15044L, approx_count_distinct(customer_id#15031L, 0.05, 0, 0)#15154L AS unique_customers#15045L, sum(events#15041)#15155L AS event_sum#15046L, sum(weighted_amount#15043)#15156 AS weighted_amount_sum#15047, avg(amount#15039)#15157 AS avg_amount#15048]
(17) Exchange
Input [7]: [segment#15035, processing_day#15037, row_count#15044L, unique_customers#15045L, event_sum#15046L, weighted_amount_sum#15047, avg_amount#15048]
Arguments: rangepartitioning(segment#15035 ASC NULLS FIRST, processing_day#15037 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=1437]
(18) Sort
Input [7]: [segment#15035, processing_day#15037, row_count#15044L, unique_customers#15045L, event_sum#15046L, weighted_amount_sum#15047, avg_amount#15048]
Arguments: [segment#15035 ASC NULLS FIRST, processing_day#15037 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#15035, processing_day#15037, row_count#15044L, unique_customers#15045L, event_sum#15046L, weighted_amount_sum#15047, avg_amount#15048]
Arguments: isFinalPlan=true