Support Questions

Find answers, ask questions, and share your expertise
Announcements
Now Live: Explore expert insights and technical deep dives on the new Cloudera Community BlogsRead the Announcement

How to use sqlContext? Getting an error!

avatar
New Member

sqlcontext.png Please find snapshot attached for the issue.

1 ACCEPTED SOLUTION

avatar
@sudhir reddy

SqlContext is not available by default in Spark2 shell.

Create a sqlContext using below statement after launching the spark-shell and then you can read the json using this sqlContext.

val sqlContext = new org.apache.spark.sql.SQLContext(sc)

Let me know if this helps.

View solution in original post

10 REPLIES 10

avatar
New Member

Hope this helps.