0 votes
1 view
in Big Data Hadoop & Spark by (6.1k 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
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...