QuestionQ25

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

A data engineer must build an ingestion pipeline for a set of Parquet files that an upstream team delivers nightly. The data resides in a directory structure with the base path /path/events/data. The upstream team places daily data in the underlying subdirectories using the year/month/day convention.

Examples of the directory structure include:

Question Image

Which of the following code snippets reads all data in the directory structure?

Explanation

The recursiveFileLookup option directs Spark to load files recursively under the specified base directory, so it includes every year/month/day subtree. This option is intended for the nested layout shown. Executable PySpark must call .parquet(...); the .paquet(...) spelling in the selected choice is a typographical error.

Learn more

Community Discussion

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