Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

error while reading avro file

error while reading avro file

Explorer

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

1 REPLY 1

Re: error while reading avro file

Explorer

sorted.