Error at row level filtering (Kindly resolve)


I am attempting to filter the data set at a row level by extracting out all the completed and closed orders for the month of September by executing this code. I’m getting this every time. Kindly help me resolve this.

error: recursive value i needs type

val filtered = orders.filter(o => {
| val i = o.split(",") (i(3)==“COMPLETE” || i(3)==“CLOSED”) && (i(1).contains(“2013-09”))
| })

Learn Spark 1.6.x or Spark 2.x on our state of the art big data labs

  • Click here for access to state of the art 13 node Hadoop and Spark Cluster



Can you paste the complete code you are trying?



val filtered = orders.filter(
o => {
val i = o.split(",")
(i(3)==“COMPLETE” || i(3)==“CLOSED”) && (i(1).contains(“2013-09”))