What is the difference between reduceByKey(+) and reduceByKey (++). I know the internal working of reduceByKey(+). But how reduceByKey (++) works internally. I have google reduceByKey (++) but not found any resource everyone is talking about reduceByKey (+).
reduceByKey on a collection of elements of type
T expects a binary operation of type
Fucntion2[T, T, U], which means it expects a function from two arguments with type
T to a value with type
+is defined for type
_ + _adheres to this expected type.
++is defined for type
_ ++ _adheres to this type.
Tis your own class not defining any of these operators) then neither would compile.