title: Why is "error: illegal start of simple expression" for reduceByKey?
body: <p>I am new to scala and spark and while implementing reduceByKey  i got the below error.</p>
  
  <pre><code>var redRdd = filterRdd.reduceByKey((acc , val) =&gt; if (acc &gt; val ) acc else val)
  &lt;console&gt;:1: error: illegal start of simple expression
  var redRdd = filterRdd.reduceByKey((acc , val) =&gt; if (acc &gt; val ) acc else val)
  </code></pre>
  
  <p>filterRdd is just (order_id, Amount) tuple.</p>
  
  <pre><code>scala&gt; filterRdd.first
  res10: (Int, Double) = (1,299.98)
  </code></pre>
  
  <p>I want to first  get the max value per partition and then reduce output from all partitions.
  can someone help me in understanding why i am getting this error?</p>