Given the following:
val rdd = List(1,2,3)
I assumed that rdd.reduce((x,y) => (x - y)) would return -4 (i.e. <
rdd.reduce((x,y) => (x - y))
-4
You can easy replace subtraction v1 - v2 - ... - vN with v1 - (v2 + ... + vN), so your code can look like
val v1 = 1 val values = Seq(2, 3) val sum = sc.paralellize(values).reduce(_ + _) val result = v1 - sum