SaveMode is not working in Spark SQL

Viewed 14265

I was running Spark SQL example with SaveMode option but getting following error.

val df = sqlContext.read.format("json").load("/user/root/spark/data/people.json")
df.select("name","age").write.format("json").save("Output",SaveMode.ErrorIfExist)


<console>:35: error: overloaded method value save with alternatives:
  ()Unit <and>
  (path: String)Unit
 cannot be applied to (String, org.apache.spark.sql.SaveMode)
              df.select("name", "age").write.format("json").save("Output",SaveMode.ErrorIfExists

I checked documentation , it says SaveMode is deprecated. How do I fix this?

Any suggestion.

1 Answers
Related