Which of the following code blocks reads a CSV at the file path filePath into a Data Frame with the specified schema schema?
Which of the following code blocks reads a CSV at the file path filePath into a Data Frame with the specified schema schema?
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.
C is the right choice
It's C