QuestionQ253

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which of the following code blocks writes the DataFrame storesDF to the file path filePath in Parquet format and partitions it by the values in the division column?

Explanation

PySpark DataFrameWriter.partitionBy takes the name of a partitioning column, and DataFrameWriter.parquet(path) writes the DataFrame in Parquet format to the specified path. Thus, chaining partitionBy("division") with parquet(filePath) creates a Parquet output partitioned by division.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!