== 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#104451L]
Arguments: Range (22000000, 23000000, step=1, splits=Some(24))
(2) Project [codegen id : 1]
Output [5]: [(id#104451L % 250000) AS customer_id#104453L, concat(segment-, cast(cast((id#104451L % 12) as int) as string)) AS segment#104457, cast((id#104451L % 14) as int) AS processing_day#104459, ((cast(((id#104451L * 17) % 1000) as double) / 10.0) + 1.0) AS amount#104461, cast((((id#104451L * 29) % 7) + 1) as int) AS events#104463]
Input [1]: [id#104451L]
(3) Project [codegen id : 1]
Output [6]: [customer_id#104453L, segment#104457, processing_day#104459, amount#104461, events#104463, (amount#104461 * cast(events#104463 as double)) AS weighted_amount#104465]
Input [5]: [customer_id#104453L, segment#104457, processing_day#104459, amount#104461, events#104463]
(4) HashAggregate
Input [6]: [customer_id#104453L, segment#104457, processing_day#104459, amount#104461, events#104463, weighted_amount#104465]
Keys [2]: [segment#104457, processing_day#104459]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#104453L, 0.05, 0, 0), partial_sum(events#104463), partial_sum(weighted_amount#104465), partial_avg(amount#104461)]
Aggregate Attributes [57]: [count#104684L, MS[0]#104472L, MS[1]#104473L, MS[2]#104474L, MS[3]#104475L, MS[4]#104476L, MS[5]#104477L, MS[6]#104478L, MS[7]#104479L, MS[8]#104480L, MS[9]#104481L, MS[10]#104482L, MS[11]#104483L, MS[12]#104484L, MS[13]#104485L, MS[14]#104486L, MS[15]#104487L, MS[16]#104488L, MS[17]#104489L, MS[18]#104490L, MS[19]#104491L, MS[20]#104492L, MS[21]#104493L, MS[22]#104494L, MS[23]#104495L, MS[24]#104496L, MS[25]#104497L, MS[26]#104498L, MS[27]#104499L, MS[28]#104500L, MS[29]#104501L, MS[30]#104502L, MS[31]#104503L, MS[32]#104504L, MS[33]#104505L, MS[34]#104506L, MS[35]#104507L, MS[36]#104508L, MS[37]#104509L, MS[38]#104510L, MS[39]#104511L, MS[40]#104512L, MS[41]#104513L, MS[42]#104514L, MS[43]#104515L, MS[44]#104516L, MS[45]#104517L, MS[46]#104518L, MS[47]#104519L, MS[48]#104520L, MS[49]#104521L, MS[50]#104522L, MS[51]#104523L, sum#104685L, sum#104686, sum#104687, count#104688L]
Results [59]: [segment#104457, processing_day#104459, count#104689L, MS[0]#104524L, MS[1]#104525L, MS[2]#104526L, MS[3]#104527L, MS[4]#104528L, MS[5]#104529L, MS[6]#104530L, MS[7]#104531L, MS[8]#104532L, MS[9]#104533L, MS[10]#104534L, MS[11]#104535L, MS[12]#104536L, MS[13]#104537L, MS[14]#104538L, MS[15]#104539L, MS[16]#104540L, MS[17]#104541L, MS[18]#104542L, MS[19]#104543L, MS[20]#104544L, MS[21]#104545L, MS[22]#104546L, MS[23]#104547L, MS[24]#104548L, MS[25]#104549L, MS[26]#104550L, MS[27]#104551L, MS[28]#104552L, MS[29]#104553L, MS[30]#104554L, MS[31]#104555L, MS[32]#104556L, MS[33]#104557L, MS[34]#104558L, MS[35]#104559L, MS[36]#104560L, MS[37]#104561L, MS[38]#104562L, MS[39]#104563L, MS[40]#104564L, MS[41]#104565L, MS[42]#104566L, MS[43]#104567L, MS[44]#104568L, MS[45]#104569L, MS[46]#104570L, MS[47]#104571L, MS[48]#104572L, MS[49]#104573L, MS[50]#104574L, MS[51]#104575L, sum#104690L, sum#104691, sum#104692, count#104693L]
(5) Exchange
Input [59]: [segment#104457, processing_day#104459, count#104689L, MS[0]#104524L, MS[1]#104525L, MS[2]#104526L, MS[3]#104527L, MS[4]#104528L, MS[5]#104529L, MS[6]#104530L, MS[7]#104531L, MS[8]#104532L, MS[9]#104533L, MS[10]#104534L, MS[11]#104535L, MS[12]#104536L, MS[13]#104537L, MS[14]#104538L, MS[15]#104539L, MS[16]#104540L, MS[17]#104541L, MS[18]#104542L, MS[19]#104543L, MS[20]#104544L, MS[21]#104545L, MS[22]#104546L, MS[23]#104547L, MS[24]#104548L, MS[25]#104549L, MS[26]#104550L, MS[27]#104551L, MS[28]#104552L, MS[29]#104553L, MS[30]#104554L, MS[31]#104555L, MS[32]#104556L, MS[33]#104557L, MS[34]#104558L, MS[35]#104559L, MS[36]#104560L, MS[37]#104561L, MS[38]#104562L, MS[39]#104563L, MS[40]#104564L, MS[41]#104565L, MS[42]#104566L, MS[43]#104567L, MS[44]#104568L, MS[45]#104569L, MS[46]#104570L, MS[47]#104571L, MS[48]#104572L, MS[49]#104573L, MS[50]#104574L, MS[51]#104575L, sum#104690L, sum#104691, sum#104692, count#104693L]
Arguments: hashpartitioning(segment#104457, processing_day#104459, 200), ENSURE_REQUIREMENTS, [plan_id=9861]
(6) ShuffleQueryStage
Output [59]: [segment#104457, processing_day#104459, count#104689L, MS[0]#104524L, MS[1]#104525L, MS[2]#104526L, MS[3]#104527L, MS[4]#104528L, MS[5]#104529L, MS[6]#104530L, MS[7]#104531L, MS[8]#104532L, MS[9]#104533L, MS[10]#104534L, MS[11]#104535L, MS[12]#104536L, MS[13]#104537L, MS[14]#104538L, MS[15]#104539L, MS[16]#104540L, MS[17]#104541L, MS[18]#104542L, MS[19]#104543L, MS[20]#104544L, MS[21]#104545L, MS[22]#104546L, MS[23]#104547L, MS[24]#104548L, MS[25]#104549L, MS[26]#104550L, MS[27]#104551L, MS[28]#104552L, MS[29]#104553L, MS[30]#104554L, MS[31]#104555L, MS[32]#104556L, MS[33]#104557L, MS[34]#104558L, MS[35]#104559L, MS[36]#104560L, MS[37]#104561L, MS[38]#104562L, MS[39]#104563L, MS[40]#104564L, MS[41]#104565L, MS[42]#104566L, MS[43]#104567L, MS[44]#104568L, MS[45]#104569L, MS[46]#104570L, MS[47]#104571L, MS[48]#104572L, MS[49]#104573L, MS[50]#104574L, MS[51]#104575L, sum#104690L, sum#104691, sum#104692, count#104693L]
Arguments: 0
(7) AQEShuffleRead
Input [59]: [segment#104457, processing_day#104459, count#104689L, MS[0]#104524L, MS[1]#104525L, MS[2]#104526L, MS[3]#104527L, MS[4]#104528L, MS[5]#104529L, MS[6]#104530L, MS[7]#104531L, MS[8]#104532L, MS[9]#104533L, MS[10]#104534L, MS[11]#104535L, MS[12]#104536L, MS[13]#104537L, MS[14]#104538L, MS[15]#104539L, MS[16]#104540L, MS[17]#104541L, MS[18]#104542L, MS[19]#104543L, MS[20]#104544L, MS[21]#104545L, MS[22]#104546L, MS[23]#104547L, MS[24]#104548L, MS[25]#104549L, MS[26]#104550L, MS[27]#104551L, MS[28]#104552L, MS[29]#104553L, MS[30]#104554L, MS[31]#104555L, MS[32]#104556L, MS[33]#104557L, MS[34]#104558L, MS[35]#104559L, MS[36]#104560L, MS[37]#104561L, MS[38]#104562L, MS[39]#104563L, MS[40]#104564L, MS[41]#104565L, MS[42]#104566L, MS[43]#104567L, MS[44]#104568L, MS[45]#104569L, MS[46]#104570L, MS[47]#104571L, MS[48]#104572L, MS[49]#104573L, MS[50]#104574L, MS[51]#104575L, sum#104690L, sum#104691, sum#104692, count#104693L]
Arguments: coalesced
(8) HashAggregate
Input [59]: [segment#104457, processing_day#104459, count#104689L, MS[0]#104524L, MS[1]#104525L, MS[2]#104526L, MS[3]#104527L, MS[4]#104528L, MS[5]#104529L, MS[6]#104530L, MS[7]#104531L, MS[8]#104532L, MS[9]#104533L, MS[10]#104534L, MS[11]#104535L, MS[12]#104536L, MS[13]#104537L, MS[14]#104538L, MS[15]#104539L, MS[16]#104540L, MS[17]#104541L, MS[18]#104542L, MS[19]#104543L, MS[20]#104544L, MS[21]#104545L, MS[22]#104546L, MS[23]#104547L, MS[24]#104548L, MS[25]#104549L, MS[26]#104550L, MS[27]#104551L, MS[28]#104552L, MS[29]#104553L, MS[30]#104554L, MS[31]#104555L, MS[32]#104556L, MS[33]#104557L, MS[34]#104558L, MS[35]#104559L, MS[36]#104560L, MS[37]#104561L, MS[38]#104562L, MS[39]#104563L, MS[40]#104564L, MS[41]#104565L, MS[42]#104566L, MS[43]#104567L, MS[44]#104568L, MS[45]#104569L, MS[46]#104570L, MS[47]#104571L, MS[48]#104572L, MS[49]#104573L, MS[50]#104574L, MS[51]#104575L, sum#104690L, sum#104691, sum#104692, count#104693L]
Keys [2]: [segment#104457, processing_day#104459]
Functions [5]: [count(1), approx_count_distinct(customer_id#104453L, 0.05, 0, 0), sum(events#104463), sum(weighted_amount#104465), avg(amount#104461)]
Aggregate Attributes [5]: [count(1)#104471L, approx_count_distinct(customer_id#104453L, 0.05, 0, 0)#104576L, sum(events#104463)#104577L, sum(weighted_amount#104465)#104578, avg(amount#104461)#104579]
Results [7]: [segment#104457, processing_day#104459, count(1)#104471L AS row_count#104466L, approx_count_distinct(customer_id#104453L, 0.05, 0, 0)#104576L AS unique_customers#104467L, sum(events#104463)#104577L AS event_sum#104468L, sum(weighted_amount#104465)#104578 AS weighted_amount_sum#104469, avg(amount#104461)#104579 AS avg_amount#104470]
(9) Exchange
Input [7]: [segment#104457, processing_day#104459, row_count#104466L, unique_customers#104467L, event_sum#104468L, weighted_amount_sum#104469, avg_amount#104470]
Arguments: rangepartitioning(segment#104457 ASC NULLS FIRST, processing_day#104459 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9883]
(10) ShuffleQueryStage
Output [7]: [segment#104457, processing_day#104459, row_count#104466L, unique_customers#104467L, event_sum#104468L, weighted_amount_sum#104469, avg_amount#104470]
Arguments: 1
(11) AQEShuffleRead
Input [7]: [segment#104457, processing_day#104459, row_count#104466L, unique_customers#104467L, event_sum#104468L, weighted_amount_sum#104469, avg_amount#104470]
Arguments: coalesced
(12) Sort [codegen id : 2]
Input [7]: [segment#104457, processing_day#104459, row_count#104466L, unique_customers#104467L, event_sum#104468L, weighted_amount_sum#104469, avg_amount#104470]
Arguments: [segment#104457 ASC NULLS FIRST, processing_day#104459 ASC NULLS FIRST], true, 0
(13) ResultQueryStage
Output [7]: [segment#104457, processing_day#104459, row_count#104466L, unique_customers#104467L, event_sum#104468L, weighted_amount_sum#104469, avg_amount#104470]
Arguments: 2
(14) HashAggregate
Input [6]: [customer_id#104453L, segment#104457, processing_day#104459, amount#104461, events#104463, weighted_amount#104465]
Keys [2]: [segment#104457, processing_day#104459]
Functions [5]: [partial_count(1), partial_approx_count_distinct(customer_id#104453L, 0.05, 0, 0), partial_sum(events#104463), partial_sum(weighted_amount#104465), partial_avg(amount#104461)]
Aggregate Attributes [57]: [count#104684L, MS[0]#104472L, MS[1]#104473L, MS[2]#104474L, MS[3]#104475L, MS[4]#104476L, MS[5]#104477L, MS[6]#104478L, MS[7]#104479L, MS[8]#104480L, MS[9]#104481L, MS[10]#104482L, MS[11]#104483L, MS[12]#104484L, MS[13]#104485L, MS[14]#104486L, MS[15]#104487L, MS[16]#104488L, MS[17]#104489L, MS[18]#104490L, MS[19]#104491L, MS[20]#104492L, MS[21]#104493L, MS[22]#104494L, MS[23]#104495L, MS[24]#104496L, MS[25]#104497L, MS[26]#104498L, MS[27]#104499L, MS[28]#104500L, MS[29]#104501L, MS[30]#104502L, MS[31]#104503L, MS[32]#104504L, MS[33]#104505L, MS[34]#104506L, MS[35]#104507L, MS[36]#104508L, MS[37]#104509L, MS[38]#104510L, MS[39]#104511L, MS[40]#104512L, MS[41]#104513L, MS[42]#104514L, MS[43]#104515L, MS[44]#104516L, MS[45]#104517L, MS[46]#104518L, MS[47]#104519L, MS[48]#104520L, MS[49]#104521L, MS[50]#104522L, MS[51]#104523L, sum#104685L, sum#104686, sum#104687, count#104688L]
Results [59]: [segment#104457, processing_day#104459, count#104689L, MS[0]#104524L, MS[1]#104525L, MS[2]#104526L, MS[3]#104527L, MS[4]#104528L, MS[5]#104529L, MS[6]#104530L, MS[7]#104531L, MS[8]#104532L, MS[9]#104533L, MS[10]#104534L, MS[11]#104535L, MS[12]#104536L, MS[13]#104537L, MS[14]#104538L, MS[15]#104539L, MS[16]#104540L, MS[17]#104541L, MS[18]#104542L, MS[19]#104543L, MS[20]#104544L, MS[21]#104545L, MS[22]#104546L, MS[23]#104547L, MS[24]#104548L, MS[25]#104549L, MS[26]#104550L, MS[27]#104551L, MS[28]#104552L, MS[29]#104553L, MS[30]#104554L, MS[31]#104555L, MS[32]#104556L, MS[33]#104557L, MS[34]#104558L, MS[35]#104559L, MS[36]#104560L, MS[37]#104561L, MS[38]#104562L, MS[39]#104563L, MS[40]#104564L, MS[41]#104565L, MS[42]#104566L, MS[43]#104567L, MS[44]#104568L, MS[45]#104569L, MS[46]#104570L, MS[47]#104571L, MS[48]#104572L, MS[49]#104573L, MS[50]#104574L, MS[51]#104575L, sum#104690L, sum#104691, sum#104692, count#104693L]
(15) Exchange
Input [59]: [segment#104457, processing_day#104459, count#104689L, MS[0]#104524L, MS[1]#104525L, MS[2]#104526L, MS[3]#104527L, MS[4]#104528L, MS[5]#104529L, MS[6]#104530L, MS[7]#104531L, MS[8]#104532L, MS[9]#104533L, MS[10]#104534L, MS[11]#104535L, MS[12]#104536L, MS[13]#104537L, MS[14]#104538L, MS[15]#104539L, MS[16]#104540L, MS[17]#104541L, MS[18]#104542L, MS[19]#104543L, MS[20]#104544L, MS[21]#104545L, MS[22]#104546L, MS[23]#104547L, MS[24]#104548L, MS[25]#104549L, MS[26]#104550L, MS[27]#104551L, MS[28]#104552L, MS[29]#104553L, MS[30]#104554L, MS[31]#104555L, MS[32]#104556L, MS[33]#104557L, MS[34]#104558L, MS[35]#104559L, MS[36]#104560L, MS[37]#104561L, MS[38]#104562L, MS[39]#104563L, MS[40]#104564L, MS[41]#104565L, MS[42]#104566L, MS[43]#104567L, MS[44]#104568L, MS[45]#104569L, MS[46]#104570L, MS[47]#104571L, MS[48]#104572L, MS[49]#104573L, MS[50]#104574L, MS[51]#104575L, sum#104690L, sum#104691, sum#104692, count#104693L]
Arguments: hashpartitioning(segment#104457, processing_day#104459, 200), ENSURE_REQUIREMENTS, [plan_id=9841]
(16) HashAggregate
Input [59]: [segment#104457, processing_day#104459, count#104689L, MS[0]#104524L, MS[1]#104525L, MS[2]#104526L, MS[3]#104527L, MS[4]#104528L, MS[5]#104529L, MS[6]#104530L, MS[7]#104531L, MS[8]#104532L, MS[9]#104533L, MS[10]#104534L, MS[11]#104535L, MS[12]#104536L, MS[13]#104537L, MS[14]#104538L, MS[15]#104539L, MS[16]#104540L, MS[17]#104541L, MS[18]#104542L, MS[19]#104543L, MS[20]#104544L, MS[21]#104545L, MS[22]#104546L, MS[23]#104547L, MS[24]#104548L, MS[25]#104549L, MS[26]#104550L, MS[27]#104551L, MS[28]#104552L, MS[29]#104553L, MS[30]#104554L, MS[31]#104555L, MS[32]#104556L, MS[33]#104557L, MS[34]#104558L, MS[35]#104559L, MS[36]#104560L, MS[37]#104561L, MS[38]#104562L, MS[39]#104563L, MS[40]#104564L, MS[41]#104565L, MS[42]#104566L, MS[43]#104567L, MS[44]#104568L, MS[45]#104569L, MS[46]#104570L, MS[47]#104571L, MS[48]#104572L, MS[49]#104573L, MS[50]#104574L, MS[51]#104575L, sum#104690L, sum#104691, sum#104692, count#104693L]
Keys [2]: [segment#104457, processing_day#104459]
Functions [5]: [count(1), approx_count_distinct(customer_id#104453L, 0.05, 0, 0), sum(events#104463), sum(weighted_amount#104465), avg(amount#104461)]
Aggregate Attributes [5]: [count(1)#104471L, approx_count_distinct(customer_id#104453L, 0.05, 0, 0)#104576L, sum(events#104463)#104577L, sum(weighted_amount#104465)#104578, avg(amount#104461)#104579]
Results [7]: [segment#104457, processing_day#104459, count(1)#104471L AS row_count#104466L, approx_count_distinct(customer_id#104453L, 0.05, 0, 0)#104576L AS unique_customers#104467L, sum(events#104463)#104577L AS event_sum#104468L, sum(weighted_amount#104465)#104578 AS weighted_amount_sum#104469, avg(amount#104461)#104579 AS avg_amount#104470]
(17) Exchange
Input [7]: [segment#104457, processing_day#104459, row_count#104466L, unique_customers#104467L, event_sum#104468L, weighted_amount_sum#104469, avg_amount#104470]
Arguments: rangepartitioning(segment#104457 ASC NULLS FIRST, processing_day#104459 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=9844]
(18) Sort
Input [7]: [segment#104457, processing_day#104459, row_count#104466L, unique_customers#104467L, event_sum#104468L, weighted_amount_sum#104469, avg_amount#104470]
Arguments: [segment#104457 ASC NULLS FIRST, processing_day#104459 ASC NULLS FIRST], true, 0
(19) AdaptiveSparkPlan
Output [7]: [segment#104457, processing_day#104459, row_count#104466L, unique_customers#104467L, event_sum#104468L, weighted_amount_sum#104469, avg_amount#104470]
Arguments: isFinalPlan=true