PySpark MCQ Solution - Part 1

PySpark MCQ Solution Part 1

PySpark MCQ Solution Part 1

1. Which of the following statements is correct about PySpark SparkContext:

  1. SparkContext sets up internal services
  2. Does not establish a connection to a Spark execution environment
  3. SparkContext object sends the application to executors
  4. SparkContext does not execute tasks in each executor

A. 1, 2, and 3
B. 2 and 4
C. 1 and 3 (correct)
D. 2, 3, and 4

2. The entry point of a PySpark program is an object. This object allows you to connect to a Spark cluster and create RDDs. What is this object called?

A. SparkContent
B. SparkContext (correct)
C. ContextSpark
D. ContentSpark

3. Which of the following is a feature of a PySpark DataFrame:

  1. They are distributed in nature
  2. They are immutable in nature
  3. Execution starts before an action is triggered

A. 1
B. 2
C. 1 and 2 (correct)
D. All of these

4. You are using the csv function in pyspark.sql.DataFrameReader(spark) interface to load a CSV file and returns the result as a DataFrame.
When will this function go through the input once to determine the input schema?

A.If inferSchema is enabled and the schema is explicitly specified using "schema"
B.If inferSchema is disabled
C.If the schema is explicitly specified using "schema"
D.If inferSchema is enabled (correct) 

5. Which of the following platform is used for linking the Python API to Spark Core and initializing SparkContext?

A.PySpark SQL
B.PySpark Core
C.PySpark Shell (correct)
D.None of these

PySpark MCQ Solution Part 1

Post a Comment

Post a Comment (0)

Previous Post Next Post