Regarding the naming convention in aggregation

apache-spark

#1

i used the code to write :
val orderItemsAggregationByKey = orderItemsMap.
aggregateByKey((0.0f,0.0f))(
(inter, min) => (min , if(min > inter._2) min else inter._2),
(total, inter) => (inter._1, if(total._2 > inter._2) total._2 else inter._2)
)
during this time i am not getting any error,
but instead of total i used the final, i am getting the error can anyone suggest the reason for this

val orderItemsAggregationByKey = orderItemsMap.
aggregateByKey((0.0f,0.0f))(
(inter, min) => (min , if(min > inter._2) min else inter._2),
(final, inter) => (inter._1, if(final._2 > inter._2) final._2 else inter._2)
)