Reply
Explorer
Posts: 12
Registered: ‎11-10-2018

error while reading avro file

[ Edited ]

while reading avro file we r using

 

 

 

scala> import com.databricks.spark.avro._ import com.databricks.spark.avro._

 

scala> var oDF = sqlContext.read.avro("/user/vivekhadoopstudy3117/sqoopimport/avro_orders")

<console>:26: error: not found: value sqlContext

 

 

scala> import org.apache.spark.sql.SQLContextimport org.apache.spark.sql.SQLContextscala>

 

val sqlContext = new SQLContext(sc)

 

var oDF = sqlContext.read.avro("/user/vivekhadoopstudy3117/sqoopimport/avro_orders")

 

warning: there was one deprecation warning; re-run with -deprecation for detailssqlContext: org.apache.spark.sql.SQLContext = org.apache.spark.sql.SQLContext@418bdde9scala>

 

var oDF = sqlContext.read.avro("/user/vivekhadoopstudy3117/sqoopimport/avro_orders")

 

java.lang.NoSuchMethodError: org.apache.spark.sql.DataFrameReader.load(Ljava/lang/String;)Lorg/apache/spark/sql/DataFrame; at com.databricks.spark.avro.package$AvroDataFrameReader$$anonfun$avro$2.apply(package.scala:45) at com.databricks.spark.avro.package$AvroDataFrameReader$$anonfun$avro$2.apply(package.scala:45) ... 51 elided

Explorer
Posts: 12
Registered: ‎11-10-2018

Re: error while reading avro file

sorted.

Announcements
New solutions