== 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#3537L]
Arguments: Range (4000000, 5000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#3537L % 250000) AS customer_id#3539L, concat(segment-, cast(cast((id#3537L % 12) as int) as string)) AS segment#3543, cast((id#3537L % 14) as int) AS processing_day#3545, ((cast(((id#3537L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#3547, cast((((id#3537L * 29) % 7) + 1) as int) AS events#3549]
Input [1]: [id#3537L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#3539L, segment#3543, processing_day#3545, amount#3547, events#3549, (amount#3547 * cast(events#3549 as double)) AS weighted_amount#3551]
Input [5]: [customer_id#3539L, segment#3543, processing_day#3545, amount#3547, events#3549]
(4) HashAggregate
Input [6]: [customer_id#3539L, segment#3543, processing_day#3545, amount#3547, events#3549, weighted_amount#3551]
Keys [2]: [segment#3543, processing_day#3545]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#3539L, 0.05, 0, 0), partial_sum(events#3549), partial_sum(weighted_amount#3551), partial_avg(amount#3547)]
Aggregate Attributes [57]: [count#3770L, MS[0]#3558L, MS[1]#3559L, MS[2]#3560L, MS[3]#3561L, MS[4]#3562L, MS[5]#3563L, MS[6]#3564L, MS[7]#3565L, MS[8]#3566L, MS[9]#3567L, MS[10]#3568L, MS[11]#3569L, MS[12]#3570L, MS[13]#3571L, MS[14]#3572L, MS[15]#3573L, MS[16]#3574L, MS[17]#3575L, MS[18]#3576L, MS[19]#3577L, MS[20]#3578L, MS[21]#3579L, MS[22]#3580L, MS[23]#3581L, MS[24]#3582L, MS[25]#3583L, MS[26]#3584L, MS[27]#3585L, MS[28]#3586L, MS[29]#3587L, MS[30]#3588L, MS[31]#3589L, MS[32]#3590L, MS[33]#3591L, MS[34]#3592L, MS[35]#3593L, MS[36]#3594L, MS[37]#3595L, MS[38]#3596L, MS[39]#3597L, MS[40]#3598L, MS[41]#3599L, MS[42]#3600L, MS[43]#3601L, MS[44]#3602L, MS[45]#3603L, MS[46]#3604L, MS[47]#3605L, MS[48]#3606L, MS[49]#3607L, MS[50]#3608L, MS[51]#3609L, sum#3771L, sum#3772, sum#3773, count#3774L]
Results [59]: [segment#3543, processing_day#3545, count#3775L, MS[0]#3610L, MS[1]#3611L, MS[2]#3612L, MS[3]#3613L, MS[4]#3614L, MS[5]#3615L, MS[6]#3616L, MS[7]#3617L, MS[8]#3618L, MS[9]#3619L, MS[10]#3620L, MS[11]#3621L, MS[12]#3622L, MS[13]#3623L, MS[14]#3624L, MS[15]#3625L, MS[16]#3626L, MS[17]#3627L, MS[18]#3628L, MS[19]#3629L, MS[20]#3630L, MS[21]#3631L, MS[22]#3632L, MS[23]#3633L, MS[24]#3634L, MS[25]#3635L, MS[26]#3636L, MS[27]#3637L, MS[28]#3638L, MS[29]#3639L, MS[30]#3640L, MS[31]#3641L, MS[32]#3642L, MS[33]#3643L, MS[34]#3644L, MS[35]#3645L, MS[36]#3646L, MS[37]#3647L, MS[38]#3648L, MS[39]#3649L, MS[40]#3650L, MS[41]#3651L, MS[42]#3652L, MS[43]#3653L, MS[44]#3654L, MS[45]#3655L, MS[46]#3656L, MS[47]#3657L, MS[48]#3658L, MS[49]#3659L, MS[50]#3660L, MS[51]#3661L, sum#3776L, sum#3777, sum#3778, count#3779L]
(5) Exchange
Input [59]: [segment#3543, processing_day#3545, count#3775L, MS[0]#3610L, MS[1]#3611L, MS[2]#3612L, MS[3]#3613L, MS[4]#3614L, MS[5]#3615L, MS[6]#3616L, MS[7]#3617L, MS[8]#3618L, MS[9]#3619L, MS[10]#3620L, MS[11]#3621L, MS[12]#3622L, MS[13]#3623L, MS[14]#3624L, MS[15]#3625L, MS[16]#3626L, MS[17]#3627L, MS[18]#3628L, MS[19]#3629L, MS[20]#3630L, MS[21]#3631L, MS[22]#3632L, MS[23]#3633L, MS[24]#3634L, MS[25]#3635L, MS[26]#3636L, MS[27]#3637L, MS[28]#3638L, MS[29]#3639L, MS[30]#3640L, MS[31]#3641L, MS[32]#3642L, MS[33]#3643L, MS[34]#3644L, MS[35]#3645L, MS[36]#3646L, MS[37]#3647L, MS[38]#3648L, MS[39]#3649L, MS[40]#3650L, MS[41]#3651L, MS[42]#3652L, MS[43]#3653L, MS[44]#3654L, MS[45]#3655L, MS[46]#3656L, MS[47]#3657L, MS[48]#3658L, MS[49]#3659L, MS[50]#3660L, MS[51]#3661L, sum#3776L, sum#3777, sum#3778, count#3779L]
Arguments: hashpartitioning(segment#3543, processing_day#3545, 200), ENSURE_REQUIREMENTS, [plan_id=375]
(6) ShuffleQueryStage
Output [59]: [segment#3543, processing_day#3545, count#3775L, MS[0]#3610L, MS[1]#3611L, MS[2]#3612L, MS[3]#3613L, MS[4]#3614L, MS[5]#3615L, MS[6]#3616L, MS[7]#3617L, MS[8]#3618L, MS[9]#3619L, MS[10]#3620L, MS[11]#3621L, MS[12]#3622L, MS[13]#3623L, MS[14]#3624L, MS[15]#3625L, MS[16]#3626L, MS[17]#3627L, MS[18]#3628L, MS[19]#3629L, MS[20]#3630L, MS[21]#3631L, MS[22]#3632L, MS[23]#3633L, MS[24]#3634L, MS[25]#3635L, MS[26]#3636L, MS[27]#3637L, MS[28]#3638L, MS[29]#3639L, MS[30]#3640L, MS[31]#3641L, MS[32]#3642L, MS[33]#3643L, MS[34]#3644L, MS[35]#3645L, MS[36]#3646L, MS[37]#3647L, MS[38]#3648L, MS[39]#3649L, MS[40]#3650L, MS[41]#3651L, MS[42]#3652L, MS[43]#3653L, MS[44]#3654L, MS[45]#3655L, MS[46]#3656L, MS[47]#3657L, MS[48]#3658L, MS[49]#3659L, MS[50]#3660L, MS[51]#3661L, sum#3776L, sum#3777, sum#3778, count#3779L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#3543, processing_day#3545, count#3775L, MS[0]#3610L, MS[1]#3611L, MS[2]#3612L, MS[3]#3613L, MS[4]#3614L, MS[5]#3615L, MS[6]#3616L, MS[7]#3617L, MS[8]#3618L, MS[9]#3619L, MS[10]#3620L, MS[11]#3621L, MS[12]#3622L, MS[13]#3623L, MS[14]#3624L, MS[15]#3625L, MS[16]#3626L, MS[17]#3627L, MS[18]#3628L, MS[19]#3629L, MS[20]#3630L, MS[21]#3631L, MS[22]#3632L, MS[23]#3633L, MS[24]#3634L, MS[25]#3635L, MS[26]#3636L, MS[27]#3637L, MS[28]#3638L, MS[29]#3639L, MS[30]#3640L, MS[31]#3641L, MS[32]#3642L, MS[33]#3643L, MS[34]#3644L, MS[35]#3645L, MS[36]#3646L, MS[37]#3647L, MS[38]#3648L, MS[39]#3649L, MS[40]#3650L, MS[41]#3651L, MS[42]#3652L, MS[43]#3653L, MS[44]#3654L, MS[45]#3655L, MS[46]#3656L, MS[47]#3657L, MS[48]#3658L, MS[49]#3659L, MS[50]#3660L, MS[51]#3661L, sum#3776L, sum#3777, sum#3778, count#3779L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#3543, processing_day#3545, count#3775L, MS[0]#3610L, MS[1]#3611L, MS[2]#3612L, MS[3]#3613L, MS[4]#3614L, MS[5]#3615L, MS[6]#3616L, MS[7]#3617L, MS[8]#3618L, MS[9]#3619L, MS[10]#3620L, MS[11]#3621L, MS[12]#3622L, MS[13]#3623L, MS[14]#3624L, MS[15]#3625L, MS[16]#3626L, MS[17]#3627L, MS[18]#3628L, MS[19]#3629L, MS[20]#3630L, MS[21]#3631L, MS[22]#3632L, MS[23]#3633L, MS[24]#3634L, MS[25]#3635L, MS[26]#3636L, MS[27]#3637L, MS[28]#3638L, MS[29]#3639L, MS[30]#3640L, MS[31]#3641L, MS[32]#3642L, MS[33]#3643L, MS[34]#3644L, MS[35]#3645L, MS[36]#3646L, MS[37]#3647L, MS[38]#3648L, MS[39]#3649L, MS[40]#3650L, MS[41]#3651L, MS[42]#3652L, MS[43]#3653L, MS[44]#3654L, MS[45]#3655L, MS[46]#3656L, MS[47]#3657L, MS[48]#3658L, MS[49]#3659L, MS[50]#3660L, MS[51]#3661L, sum#3776L, sum#3777, sum#3778, count#3779L]
Keys [2]: [segment#3543, processing_day#3545]
Functions [5]: [count(1), approx_count_distinct(customer_id#3539L, 0.05, 0, 0), sum(events#3549), sum(weighted_amount#3551), avg(amount#3547)]
Aggregate Attributes [5]: [count(1)#3557L, approx_count_distinct(customer_id#3539L, 0.05, 0, 0)#3662L, sum(events#3549)#3663L, sum(weighted_amount#3551)#3664, avg(amount#3547)#3665]
Results [7]: [segment#3543, processing_day#3545, count(1)#3557L AS row_count#3552L, approx_count_distinct(customer_id#3539L, 0.05, 0, 0)#3662L AS unique_customers#3553L, sum(events#3549)#3663L AS event_sum#3554L, sum(weighted_amount#3551)#3664 AS weighted_amount_sum#3555, avg(amount#3547)#3665 AS avg_amount#3556]
(9) Exchange
Input [7]: [segment#3543, processing_day#3545, row_count#3552L, unique_customers#3553L, event_sum#3554L, weighted_amount_sum#3555, avg_amount#3556]
Arguments: rangepartitioning(segment#3543 ASC NULLS FIRST, processing_day#3545 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=397]
(10) ShuffleQueryStage
Output [7]: [segment#3543, processing_day#3545, row_count#3552L, unique_customers#3553L, event_sum#3554L, weighted_amount_sum#3555, avg_amount#3556]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#3543, processing_day#3545, row_count#3552L, unique_customers#3553L, event_sum#3554L, weighted_amount_sum#3555, avg_amount#3556]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#3543, processing_day#3545, row_count#3552L, unique_customers#3553L, event_sum#3554L, weighted_amount_sum#3555, avg_amount#3556]
Arguments: [segment#3543 ASC NULLS FIRST, processing_day#3545 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#3543, processing_day#3545, row_count#3552L, unique_customers#3553L, event_sum#3554L, weighted_amount_sum#3555, avg_amount#3556]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#3539L, segment#3543, processing_day#3545, amount#3547, events#3549, weighted_amount#3551]
Keys [2]: [segment#3543, processing_day#3545]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#3539L, 0.05, 0, 0), partial_sum(events#3549), partial_sum(weighted_amount#3551), partial_avg(amount#3547)]
Aggregate Attributes [57]: [count#3770L, MS[0]#3558L, MS[1]#3559L, MS[2]#3560L, MS[3]#3561L, MS[4]#3562L, MS[5]#3563L, MS[6]#3564L, MS[7]#3565L, MS[8]#3566L, MS[9]#3567L, MS[10]#3568L, MS[11]#3569L, MS[12]#3570L, MS[13]#3571L, MS[14]#3572L, MS[15]#3573L, MS[16]#3574L, MS[17]#3575L, MS[18]#3576L, MS[19]#3577L, MS[20]#3578L, MS[21]#3579L, MS[22]#3580L, MS[23]#3581L, MS[24]#3582L, MS[25]#3583L, MS[26]#3584L, MS[27]#3585L, MS[28]#3586L, MS[29]#3587L, MS[30]#3588L, MS[31]#3589L, MS[32]#3590L, MS[33]#3591L, MS[34]#3592L, MS[35]#3593L, MS[36]#3594L, MS[37]#3595L, MS[38]#3596L, MS[39]#3597L, MS[40]#3598L, MS[41]#3599L, MS[42]#3600L, MS[43]#3601L, MS[44]#3602L, MS[45]#3603L, MS[46]#3604L, MS[47]#3605L, MS[48]#3606L, MS[49]#3607L, MS[50]#3608L, MS[51]#3609L, sum#3771L, sum#3772, sum#3773, count#3774L]
Results [59]: [segment#3543, processing_day#3545, count#3775L, MS[0]#3610L, MS[1]#3611L, MS[2]#3612L, MS[3]#3613L, MS[4]#3614L, MS[5]#3615L, MS[6]#3616L, MS[7]#3617L, MS[8]#3618L, MS[9]#3619L, MS[10]#3620L, MS[11]#3621L, MS[12]#3622L, MS[13]#3623L, MS[14]#3624L, MS[15]#3625L, MS[16]#3626L, MS[17]#3627L, MS[18]#3628L, MS[19]#3629L, MS[20]#3630L, MS[21]#3631L, MS[22]#3632L, MS[23]#3633L, MS[24]#3634L, MS[25]#3635L, MS[26]#3636L, MS[27]#3637L, MS[28]#3638L, MS[29]#3639L, MS[30]#3640L, MS[31]#3641L, MS[32]#3642L, MS[33]#3643L, MS[34]#3644L, MS[35]#3645L, MS[36]#3646L, MS[37]#3647L, MS[38]#3648L, MS[39]#3649L, MS[40]#3650L, MS[41]#3651L, MS[42]#3652L, MS[43]#3653L, MS[44]#3654L, MS[45]#3655L, MS[46]#3656L, MS[47]#3657L, MS[48]#3658L, MS[49]#3659L, MS[50]#3660L, MS[51]#3661L, sum#3776L, sum#3777, sum#3778, count#3779L]
(15) Exchange
Input [59]: [segment#3543, processing_day#3545, count#3775L, MS[0]#3610L, MS[1]#3611L, MS[2]#3612L, MS[3]#3613L, MS[4]#3614L, MS[5]#3615L, MS[6]#3616L, MS[7]#3617L, MS[8]#3618L, MS[9]#3619L, MS[10]#3620L, MS[11]#3621L, MS[12]#3622L, MS[13]#3623L, MS[14]#3624L, MS[15]#3625L, MS[16]#3626L, MS[17]#3627L, MS[18]#3628L, MS[19]#3629L, MS[20]#3630L, MS[21]#3631L, MS[22]#3632L, MS[23]#3633L, MS[24]#3634L, MS[25]#3635L, MS[26]#3636L, MS[27]#3637L, MS[28]#3638L, MS[29]#3639L, MS[30]#3640L, MS[31]#3641L, MS[32]#3642L, MS[33]#3643L, MS[34]#3644L, MS[35]#3645L, MS[36]#3646L, MS[37]#3647L, MS[38]#3648L, MS[39]#3649L, MS[40]#3650L, MS[41]#3651L, MS[42]#3652L, MS[43]#3653L, MS[44]#3654L, MS[45]#3655L, MS[46]#3656L, MS[47]#3657L, MS[48]#3658L, MS[49]#3659L, MS[50]#3660L, MS[51]#3661L, sum#3776L, sum#3777, sum#3778, count#3779L]
Arguments: hashpartitioning(segment#3543, processing_day#3545, 200), ENSURE_REQUIREMENTS, [plan_id=355]
(16) HashAggregate
Input [59]: [segment#3543, processing_day#3545, count#3775L, MS[0]#3610L, MS[1]#3611L, MS[2]#3612L, MS[3]#3613L, MS[4]#3614L, MS[5]#3615L, MS[6]#3616L, MS[7]#3617L, MS[8]#3618L, MS[9]#3619L, MS[10]#3620L, MS[11]#3621L, MS[12]#3622L, MS[13]#3623L, MS[14]#3624L, MS[15]#3625L, MS[16]#3626L, MS[17]#3627L, MS[18]#3628L, MS[19]#3629L, MS[20]#3630L, MS[21]#3631L, MS[22]#3632L, MS[23]#3633L, MS[24]#3634L, MS[25]#3635L, MS[26]#3636L, MS[27]#3637L, MS[28]#3638L, MS[29]#3639L, MS[30]#3640L, MS[31]#3641L, MS[32]#3642L, MS[33]#3643L, MS[34]#3644L, MS[35]#3645L, MS[36]#3646L, MS[37]#3647L, MS[38]#3648L, MS[39]#3649L, MS[40]#3650L, MS[41]#3651L, MS[42]#3652L, MS[43]#3653L, MS[44]#3654L, MS[45]#3655L, MS[46]#3656L, MS[47]#3657L, MS[48]#3658L, MS[49]#3659L, MS[50]#3660L, MS[51]#3661L, sum#3776L, sum#3777, sum#3778, count#3779L]
Keys [2]: [segment#3543, processing_day#3545]
Functions [5]: [count(1), approx_count_distinct(customer_id#3539L, 0.05, 0, 0), sum(events#3549), sum(weighted_amount#3551), avg(amount#3547)]
Aggregate Attributes [5]: [count(1)#3557L, approx_count_distinct(customer_id#3539L, 0.05, 0, 0)#3662L, sum(events#3549)#3663L, sum(weighted_amount#3551)#3664, avg(amount#3547)#3665]
Results [7]: [segment#3543, processing_day#3545, count(1)#3557L AS row_count#3552L, approx_count_distinct(customer_id#3539L, 0.05, 0, 0)#3662L AS unique_customers#3553L, sum(events#3549)#3663L AS event_sum#3554L, sum(weighted_amount#3551)#3664 AS weighted_amount_sum#3555, avg(amount#3547)#3665 AS avg_amount#3556]
(17) Exchange
Input [7]: [segment#3543, processing_day#3545, row_count#3552L, unique_customers#3553L, event_sum#3554L, weighted_amount_sum#3555, avg_amount#3556]
Arguments: rangepartitioning(segment#3543 ASC NULLS FIRST, processing_day#3545 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=358]
(18) Sort
Input [7]: [segment#3543, processing_day#3545, row_count#3552L, unique_customers#3553L, event_sum#3554L, weighted_amount_sum#3555, avg_amount#3556]
Arguments: [segment#3543 ASC NULLS FIRST, processing_day#3545 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#3543, processing_day#3545, row_count#3552L, unique_customers#3553L, event_sum#3554L, weighted_amount_sum#3555, avg_amount#3556]
Arguments: isFinalPlan=true