Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Big Data Hadoop & Spark by (6.5k points)

Can anyone tell me how to create SQLContext in Spark?

1 Answer

0 votes
by (11.3k points)

To create a Spark SQL Context, first, start a Spark Session in Scala:

-val spark = SparkSession.builder.getOrCreate()

Then, create a SQL Context from the Spark Session:

-val sqlContext = spark.sqlContext

Now, use the 'sqlContext' variable to implement SQL

If you are looking for an online course to learn Spark, check out this Spark Course by Intellipaat.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...