Assignment - 1
1. What is Spark and its benefits?
2. Explain Apache Spark architecture with aa neat diagram.
3. What is the importance of SparkSession? Create a spark session.
4. How to read a csv file in spark. Explain the importance of
inferSchema and header.
5. Explain Lazy Evaluation in Spark.
6. What is big data problem, How Spark resolves it?
7. Write a PySpark code to
a) Select only name, department, and marks.
b) Add a new column ‘bonus_marks’ and add 5 marks to every
student.
c) Rename marks to student_marks using withColumnRenamed()
8. Write a Spark code to create a new column named “college” and
give the value “ARMIET” to everyone.
Assignment - 2
1. Write a PySpark code to groupBy department and perform these
aggregations
a. Calculate Count of students (column name should be
std_count)
b. Calculate Sum of Marks (column name should be total_marks)
c. Calculate Average of Marks (column name should be
avg_marks)
2. Distinguish between fillna() and dropna() with example
3. What is the difference between rank() and dense_rank() with
example
4. Explain sorting and write spark code to sort the students by marks.
5. What is inner join, Perform inner join between two data frames.
6. What is left outer join, right outer join and full outer join with
examples.
7. What is union? Explain with example code.
8. What is the difference between union and unionByName.