Error at row level filtering (Kindly resolve)


#1

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

Code:
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


#2

@rachit92

Can you paste the complete code you are trying?


#3

Try

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