Error: value read is not a member of org.apache.spark.sql.SQLContext

#1

scala> val lines = sqlContext.read.txt("/wikipedia").as [String]
:35: error: value read is not a member of org.apache.spark.sql.SQLContext
val lines = sqlContext.read.txt("/wikipedia").as [String]
^

0 Likes

#2

Can you share the log generated when you launch spark shell?

0 Likes

#3

@prabhu_s There is a typo in the above line. txt should be text. So the final command should be:

val lines = sqlContext.read.text("/wikipedia").as [String]

Hope this helps!

1 Like

#4

Check if you have import sqlContext.implicits._ and Please try sqlContext.read.format().load()

0 Likes