Pyspark First Assignment

For The Below File Given Link WIth Path Please Explore The FIle Using RDD
NOTE :=> please import pyspark and Create SparkSession and SParkContex Then Solve The challenge
File Path :=> file:///root/data/user_data.txt

Example :=>

import pyspark
#Initializing PySpark
from pyspark import SparkContext, SparkConf
from pyspark.sql import SparkSession
# #Spark Config
conf = SparkConf().setAppName("sample_app")
sc = SparkContext(conf=conf)
spark = SparkSession.builder.appName('SparkByExamples.com').getOrCreate()
data1 = sc.textFile("file:///root/data/user_data.txt")

Question1 :=>

How many unique professions do we have in the data file?
Total : 0 Discussion
Login