Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to use sqlContext? Getting an error!

avatar

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 Contributor

Hope this helps.