== 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#41585L]
Arguments: Range (23000000, 24000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#41585L % 250000) AS customer_id#41587L, concat(segment-, cast(cast((id#41585L % 12) as int) as string)) AS segment#41591, cast((id#41585L % 14) as int) AS processing_day#41593, ((cast(((id#41585L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#41595, cast((((id#41585L * 29) % 7) + 1) as int) AS events#41597]
Input [1]: [id#41585L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#41587L, segment#41591, processing_day#41593, amount#41595, events#41597, (amount#41595 * cast(events#41597 as double)) AS weighted_amount#41599]
Input [5]: [customer_id#41587L, segment#41591, processing_day#41593, amount#41595, events#41597]
(4) HashAggregate
Input [6]: [customer_id#41587L, segment#41591, processing_day#41593, amount#41595, events#41597, weighted_amount#41599]
Keys [2]: [segment#41591, processing_day#41593]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#41587L, 0.05, 0, 0), partial_sum(events#41597), partial_sum(weighted_amount#41599), partial_avg(amount#41595)]
Aggregate Attributes [57]: [count#41818L, MS[0]#41606L, MS[1]#41607L, MS[2]#41608L, MS[3]#41609L, MS[4]#41610L, MS[5]#41611L, MS[6]#41612L, MS[7]#41613L, MS[8]#41614L, MS[9]#41615L, MS[10]#41616L, MS[11]#41617L, MS[12]#41618L, MS[13]#41619L, MS[14]#41620L, MS[15]#41621L, MS[16]#41622L, MS[17]#41623L, MS[18]#41624L, MS[19]#41625L, MS[20]#41626L, MS[21]#41627L, MS[22]#41628L, MS[23]#41629L, MS[24]#41630L, MS[25]#41631L, MS[26]#41632L, MS[27]#41633L, MS[28]#41634L, MS[29]#41635L, MS[30]#41636L, MS[31]#41637L, MS[32]#41638L, MS[33]#41639L, MS[34]#41640L, MS[35]#41641L, MS[36]#41642L, MS[37]#41643L, MS[38]#41644L, MS[39]#41645L, MS[40]#41646L, MS[41]#41647L, MS[42]#41648L, MS[43]#41649L, MS[44]#41650L, MS[45]#41651L, MS[46]#41652L, MS[47]#41653L, MS[48]#41654L, MS[49]#41655L, MS[50]#41656L, MS[51]#41657L, sum#41819L, sum#41820, sum#41821, count#41822L]
Results [59]: [segment#41591, processing_day#41593, count#41823L, MS[0]#41658L, MS[1]#41659L, MS[2]#41660L, MS[3]#41661L, MS[4]#41662L, MS[5]#41663L, MS[6]#41664L, MS[7]#41665L, MS[8]#41666L, MS[9]#41667L, MS[10]#41668L, MS[11]#41669L, MS[12]#41670L, MS[13]#41671L, MS[14]#41672L, MS[15]#41673L, MS[16]#41674L, MS[17]#41675L, MS[18]#41676L, MS[19]#41677L, MS[20]#41678L, MS[21]#41679L, MS[22]#41680L, MS[23]#41681L, MS[24]#41682L, MS[25]#41683L, MS[26]#41684L, MS[27]#41685L, MS[28]#41686L, MS[29]#41687L, MS[30]#41688L, MS[31]#41689L, MS[32]#41690L, MS[33]#41691L, MS[34]#41692L, MS[35]#41693L, MS[36]#41694L, MS[37]#41695L, MS[38]#41696L, MS[39]#41697L, MS[40]#41698L, MS[41]#41699L, MS[42]#41700L, MS[43]#41701L, MS[44]#41702L, MS[45]#41703L, MS[46]#41704L, MS[47]#41705L, MS[48]#41706L, MS[49]#41707L, MS[50]#41708L, MS[51]#41709L, sum#41824L, sum#41825, sum#41826, count#41827L]
(5) Exchange
Input [59]: [segment#41591, processing_day#41593, count#41823L, MS[0]#41658L, MS[1]#41659L, MS[2]#41660L, MS[3]#41661L, MS[4]#41662L, MS[5]#41663L, MS[6]#41664L, MS[7]#41665L, MS[8]#41666L, MS[9]#41667L, MS[10]#41668L, MS[11]#41669L, MS[12]#41670L, MS[13]#41671L, MS[14]#41672L, MS[15]#41673L, MS[16]#41674L, MS[17]#41675L, MS[18]#41676L, MS[19]#41677L, MS[20]#41678L, MS[21]#41679L, MS[22]#41680L, MS[23]#41681L, MS[24]#41682L, MS[25]#41683L, MS[26]#41684L, MS[27]#41685L, MS[28]#41686L, MS[29]#41687L, MS[30]#41688L, MS[31]#41689L, MS[32]#41690L, MS[33]#41691L, MS[34]#41692L, MS[35]#41693L, MS[36]#41694L, MS[37]#41695L, MS[38]#41696L, MS[39]#41697L, MS[40]#41698L, MS[41]#41699L, MS[42]#41700L, MS[43]#41701L, MS[44]#41702L, MS[45]#41703L, MS[46]#41704L, MS[47]#41705L, MS[48]#41706L, MS[49]#41707L, MS[50]#41708L, MS[51]#41709L, sum#41824L, sum#41825, sum#41826, count#41827L]
Arguments: hashpartitioning(segment#41591, processing_day#41593, 200), ENSURE_REQUIREMENTS, [plan_id=3950]
(6) ShuffleQueryStage
Output [59]: [segment#41591, processing_day#41593, count#41823L, MS[0]#41658L, MS[1]#41659L, MS[2]#41660L, MS[3]#41661L, MS[4]#41662L, MS[5]#41663L, MS[6]#41664L, MS[7]#41665L, MS[8]#41666L, MS[9]#41667L, MS[10]#41668L, MS[11]#41669L, MS[12]#41670L, MS[13]#41671L, MS[14]#41672L, MS[15]#41673L, MS[16]#41674L, MS[17]#41675L, MS[18]#41676L, MS[19]#41677L, MS[20]#41678L, MS[21]#41679L, MS[22]#41680L, MS[23]#41681L, MS[24]#41682L, MS[25]#41683L, MS[26]#41684L, MS[27]#41685L, MS[28]#41686L, MS[29]#41687L, MS[30]#41688L, MS[31]#41689L, MS[32]#41690L, MS[33]#41691L, MS[34]#41692L, MS[35]#41693L, MS[36]#41694L, MS[37]#41695L, MS[38]#41696L, MS[39]#41697L, MS[40]#41698L, MS[41]#41699L, MS[42]#41700L, MS[43]#41701L, MS[44]#41702L, MS[45]#41703L, MS[46]#41704L, MS[47]#41705L, MS[48]#41706L, MS[49]#41707L, MS[50]#41708L, MS[51]#41709L, sum#41824L, sum#41825, sum#41826, count#41827L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#41591, processing_day#41593, count#41823L, MS[0]#41658L, MS[1]#41659L, MS[2]#41660L, MS[3]#41661L, MS[4]#41662L, MS[5]#41663L, MS[6]#41664L, MS[7]#41665L, MS[8]#41666L, MS[9]#41667L, MS[10]#41668L, MS[11]#41669L, MS[12]#41670L, MS[13]#41671L, MS[14]#41672L, MS[15]#41673L, MS[16]#41674L, MS[17]#41675L, MS[18]#41676L, MS[19]#41677L, MS[20]#41678L, MS[21]#41679L, MS[22]#41680L, MS[23]#41681L, MS[24]#41682L, MS[25]#41683L, MS[26]#41684L, MS[27]#41685L, MS[28]#41686L, MS[29]#41687L, MS[30]#41688L, MS[31]#41689L, MS[32]#41690L, MS[33]#41691L, MS[34]#41692L, MS[35]#41693L, MS[36]#41694L, MS[37]#41695L, MS[38]#41696L, MS[39]#41697L, MS[40]#41698L, MS[41]#41699L, MS[42]#41700L, MS[43]#41701L, MS[44]#41702L, MS[45]#41703L, MS[46]#41704L, MS[47]#41705L, MS[48]#41706L, MS[49]#41707L, MS[50]#41708L, MS[51]#41709L, sum#41824L, sum#41825, sum#41826, count#41827L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#41591, processing_day#41593, count#41823L, MS[0]#41658L, MS[1]#41659L, MS[2]#41660L, MS[3]#41661L, MS[4]#41662L, MS[5]#41663L, MS[6]#41664L, MS[7]#41665L, MS[8]#41666L, MS[9]#41667L, MS[10]#41668L, MS[11]#41669L, MS[12]#41670L, MS[13]#41671L, MS[14]#41672L, MS[15]#41673L, MS[16]#41674L, MS[17]#41675L, MS[18]#41676L, MS[19]#41677L, MS[20]#41678L, MS[21]#41679L, MS[22]#41680L, MS[23]#41681L, MS[24]#41682L, MS[25]#41683L, MS[26]#41684L, MS[27]#41685L, MS[28]#41686L, MS[29]#41687L, MS[30]#41688L, MS[31]#41689L, MS[32]#41690L, MS[33]#41691L, MS[34]#41692L, MS[35]#41693L, MS[36]#41694L, MS[37]#41695L, MS[38]#41696L, MS[39]#41697L, MS[40]#41698L, MS[41]#41699L, MS[42]#41700L, MS[43]#41701L, MS[44]#41702L, MS[45]#41703L, MS[46]#41704L, MS[47]#41705L, MS[48]#41706L, MS[49]#41707L, MS[50]#41708L, MS[51]#41709L, sum#41824L, sum#41825, sum#41826, count#41827L]
Keys [2]: [segment#41591, processing_day#41593]
Functions [5]: [count(1), approx_count_distinct(customer_id#41587L, 0.05, 0, 0), sum(events#41597), sum(weighted_amount#41599), avg(amount#41595)]
Aggregate Attributes [5]: [count(1)#41605L, approx_count_distinct(customer_id#41587L, 0.05, 0, 0)#41710L, sum(events#41597)#41711L, sum(weighted_amount#41599)#41712, avg(amount#41595)#41713]
Results [7]: [segment#41591, processing_day#41593, count(1)#41605L AS row_count#41600L, approx_count_distinct(customer_id#41587L, 0.05, 0, 0)#41710L AS unique_customers#41601L, sum(events#41597)#41711L AS event_sum#41602L, sum(weighted_amount#41599)#41712 AS weighted_amount_sum#41603, avg(amount#41595)#41713 AS avg_amount#41604]
(9) Exchange
Input [7]: [segment#41591, processing_day#41593, row_count#41600L, unique_customers#41601L, event_sum#41602L, weighted_amount_sum#41603, avg_amount#41604]
Arguments: rangepartitioning(segment#41591 ASC NULLS FIRST, processing_day#41593 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3972]
(10) ShuffleQueryStage
Output [7]: [segment#41591, processing_day#41593, row_count#41600L, unique_customers#41601L, event_sum#41602L, weighted_amount_sum#41603, avg_amount#41604]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#41591, processing_day#41593, row_count#41600L, unique_customers#41601L, event_sum#41602L, weighted_amount_sum#41603, avg_amount#41604]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#41591, processing_day#41593, row_count#41600L, unique_customers#41601L, event_sum#41602L, weighted_amount_sum#41603, avg_amount#41604]
Arguments: [segment#41591 ASC NULLS FIRST, processing_day#41593 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#41591, processing_day#41593, row_count#41600L, unique_customers#41601L, event_sum#41602L, weighted_amount_sum#41603, avg_amount#41604]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#41587L, segment#41591, processing_day#41593, amount#41595, events#41597, weighted_amount#41599]
Keys [2]: [segment#41591, processing_day#41593]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#41587L, 0.05, 0, 0), partial_sum(events#41597), partial_sum(weighted_amount#41599), partial_avg(amount#41595)]
Aggregate Attributes [57]: [count#41818L, MS[0]#41606L, MS[1]#41607L, MS[2]#41608L, MS[3]#41609L, MS[4]#41610L, MS[5]#41611L, MS[6]#41612L, MS[7]#41613L, MS[8]#41614L, MS[9]#41615L, MS[10]#41616L, MS[11]#41617L, MS[12]#41618L, MS[13]#41619L, MS[14]#41620L, MS[15]#41621L, MS[16]#41622L, MS[17]#41623L, MS[18]#41624L, MS[19]#41625L, MS[20]#41626L, MS[21]#41627L, MS[22]#41628L, MS[23]#41629L, MS[24]#41630L, MS[25]#41631L, MS[26]#41632L, MS[27]#41633L, MS[28]#41634L, MS[29]#41635L, MS[30]#41636L, MS[31]#41637L, MS[32]#41638L, MS[33]#41639L, MS[34]#41640L, MS[35]#41641L, MS[36]#41642L, MS[37]#41643L, MS[38]#41644L, MS[39]#41645L, MS[40]#41646L, MS[41]#41647L, MS[42]#41648L, MS[43]#41649L, MS[44]#41650L, MS[45]#41651L, MS[46]#41652L, MS[47]#41653L, MS[48]#41654L, MS[49]#41655L, MS[50]#41656L, MS[51]#41657L, sum#41819L, sum#41820, sum#41821, count#41822L]
Results [59]: [segment#41591, processing_day#41593, count#41823L, MS[0]#41658L, MS[1]#41659L, MS[2]#41660L, MS[3]#41661L, MS[4]#41662L, MS[5]#41663L, MS[6]#41664L, MS[7]#41665L, MS[8]#41666L, MS[9]#41667L, MS[10]#41668L, MS[11]#41669L, MS[12]#41670L, MS[13]#41671L, MS[14]#41672L, MS[15]#41673L, MS[16]#41674L, MS[17]#41675L, MS[18]#41676L, MS[19]#41677L, MS[20]#41678L, MS[21]#41679L, MS[22]#41680L, MS[23]#41681L, MS[24]#41682L, MS[25]#41683L, MS[26]#41684L, MS[27]#41685L, MS[28]#41686L, MS[29]#41687L, MS[30]#41688L, MS[31]#41689L, MS[32]#41690L, MS[33]#41691L, MS[34]#41692L, MS[35]#41693L, MS[36]#41694L, MS[37]#41695L, MS[38]#41696L, MS[39]#41697L, MS[40]#41698L, MS[41]#41699L, MS[42]#41700L, MS[43]#41701L, MS[44]#41702L, MS[45]#41703L, MS[46]#41704L, MS[47]#41705L, MS[48]#41706L, MS[49]#41707L, MS[50]#41708L, MS[51]#41709L, sum#41824L, sum#41825, sum#41826, count#41827L]
(15) Exchange
Input [59]: [segment#41591, processing_day#41593, count#41823L, MS[0]#41658L, MS[1]#41659L, MS[2]#41660L, MS[3]#41661L, MS[4]#41662L, MS[5]#41663L, MS[6]#41664L, MS[7]#41665L, MS[8]#41666L, MS[9]#41667L, MS[10]#41668L, MS[11]#41669L, MS[12]#41670L, MS[13]#41671L, MS[14]#41672L, MS[15]#41673L, MS[16]#41674L, MS[17]#41675L, MS[18]#41676L, MS[19]#41677L, MS[20]#41678L, MS[21]#41679L, MS[22]#41680L, MS[23]#41681L, MS[24]#41682L, MS[25]#41683L, MS[26]#41684L, MS[27]#41685L, MS[28]#41686L, MS[29]#41687L, MS[30]#41688L, MS[31]#41689L, MS[32]#41690L, MS[33]#41691L, MS[34]#41692L, MS[35]#41693L, MS[36]#41694L, MS[37]#41695L, MS[38]#41696L, MS[39]#41697L, MS[40]#41698L, MS[41]#41699L, MS[42]#41700L, MS[43]#41701L, MS[44]#41702L, MS[45]#41703L, MS[46]#41704L, MS[47]#41705L, MS[48]#41706L, MS[49]#41707L, MS[50]#41708L, MS[51]#41709L, sum#41824L, sum#41825, sum#41826, count#41827L]
Arguments: hashpartitioning(segment#41591, processing_day#41593, 200), ENSURE_REQUIREMENTS, [plan_id=3930]
(16) HashAggregate
Input [59]: [segment#41591, processing_day#41593, count#41823L, MS[0]#41658L, MS[1]#41659L, MS[2]#41660L, MS[3]#41661L, MS[4]#41662L, MS[5]#41663L, MS[6]#41664L, MS[7]#41665L, MS[8]#41666L, MS[9]#41667L, MS[10]#41668L, MS[11]#41669L, MS[12]#41670L, MS[13]#41671L, MS[14]#41672L, MS[15]#41673L, MS[16]#41674L, MS[17]#41675L, MS[18]#41676L, MS[19]#41677L, MS[20]#41678L, MS[21]#41679L, MS[22]#41680L, MS[23]#41681L, MS[24]#41682L, MS[25]#41683L, MS[26]#41684L, MS[27]#41685L, MS[28]#41686L, MS[29]#41687L, MS[30]#41688L, MS[31]#41689L, MS[32]#41690L, MS[33]#41691L, MS[34]#41692L, MS[35]#41693L, MS[36]#41694L, MS[37]#41695L, MS[38]#41696L, MS[39]#41697L, MS[40]#41698L, MS[41]#41699L, MS[42]#41700L, MS[43]#41701L, MS[44]#41702L, MS[45]#41703L, MS[46]#41704L, MS[47]#41705L, MS[48]#41706L, MS[49]#41707L, MS[50]#41708L, MS[51]#41709L, sum#41824L, sum#41825, sum#41826, count#41827L]
Keys [2]: [segment#41591, processing_day#41593]
Functions [5]: [count(1), approx_count_distinct(customer_id#41587L, 0.05, 0, 0), sum(events#41597), sum(weighted_amount#41599), avg(amount#41595)]
Aggregate Attributes [5]: [count(1)#41605L, approx_count_distinct(customer_id#41587L, 0.05, 0, 0)#41710L, sum(events#41597)#41711L, sum(weighted_amount#41599)#41712, avg(amount#41595)#41713]
Results [7]: [segment#41591, processing_day#41593, count(1)#41605L AS row_count#41600L, approx_count_distinct(customer_id#41587L, 0.05, 0, 0)#41710L AS unique_customers#41601L, sum(events#41597)#41711L AS event_sum#41602L, sum(weighted_amount#41599)#41712 AS weighted_amount_sum#41603, avg(amount#41595)#41713 AS avg_amount#41604]
(17) Exchange
Input [7]: [segment#41591, processing_day#41593, row_count#41600L, unique_customers#41601L, event_sum#41602L, weighted_amount_sum#41603, avg_amount#41604]
Arguments: rangepartitioning(segment#41591 ASC NULLS FIRST, processing_day#41593 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=3933]
(18) Sort
Input [7]: [segment#41591, processing_day#41593, row_count#41600L, unique_customers#41601L, event_sum#41602L, weighted_amount_sum#41603, avg_amount#41604]
Arguments: [segment#41591 ASC NULLS FIRST, processing_day#41593 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#41591, processing_day#41593, row_count#41600L, unique_customers#41601L, event_sum#41602L, weighted_amount_sum#41603, avg_amount#41604]
Arguments: isFinalPlan=true