nerdexam
Databricks

DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #176

The code block shown below should read a parquet at the file path filePath into a DataFrame. Choose the response that correctly fills in the numbered blanks within the code block to complete this…

The correct answer is B. 1. spark. To read a Parquet file into a DataFrame in PySpark, the correct syntax is spark.read.parquet(filePath). The blanks are: 1. spark (the SparkSession), 2. read (the DataFrameReader), 3. parquet (the format-specific method), 4. filePath (the path string). Choice D incorrectly…

Data Ingestion and Transformations

Question

The code block shown below should read a parquet at the file path filePath into a DataFrame. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block:

1.2.3(4)

Options

  • A1.spark
  • B
    1. spark
  • C
    1. spark
  • D
    1. storesDF
  • E
    1. spark

How the community answered

(48 responses)
  • A
    2% (1)
  • B
    88% (42)
  • C
    6% (3)
  • D
    4% (2)

Explanation

To read a Parquet file into a DataFrame in PySpark, the correct syntax is spark.read.parquet(filePath). The blanks are: 1. spark (the SparkSession), 2. read (the DataFrameReader), 3. parquet (the format-specific method), 4. filePath (the path string). Choice D incorrectly starts with storesDF (a DataFrame) instead of spark. Other choices likely differ in the method names used for blanks 2 and 3, such as using format('parquet').load() instead of the shorthand .parquet().

Topics

#Spark DataFrames#Data Ingestion#Parquet Format#SparkSession

Community Discussion

No community discussion yet for this question.

Full DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Practice