Exam Certified Associate Developer for Apache Spark All QuestionsBrowse all questions from this exam
Question 113

Which of the following code blocks reads a CSV at the file path filePath into a Data Frame with the specified schema schema?

    Correct Answer: C

    To read a CSV file into a DataFrame with a specified schema using Spark, you would use the spark.read.schema method and provide the schema as an argument. The correct syntax for doing this is spark.read.schema(schema).csv(filePath), where schema is the variable containing the schema definition and filePath is the path to the CSV file.

Discussion
SaiPavan10Option: C

C is the right choice

Sowwy1Option: C

It's C