How to Instantiate the Schema.Parser

val schemaAvro = new Schema.Parser().parse(new File("/user/modinesh/spark/avro/person.avsc"))

it is throwing below error
:28: error: not found: value Schema

person.avsc file path is given below
person.avsc file


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

Above problem is resolved by using following command
import org.apache.avro.Schema
but I came across another problem i.e when i execute following command error is error:not found : type File
val schema = new Schema.Parser().parse(new File(“user.avsc”))
:32: error: not found: type File

please help me out.