QuestionQ143

VerifiedDevelopment and Ingestion

A data engineer is working on a Databricks project that utilizes cloud storage. The data engineer wants to load several JSON files from containers on a storage account as soon as the file arrives within the storage account.

Which syntax should the data engineer follow to first load the files into a dataframe and check that it is working as expected using Python?

Explanation

Auto Loader is used to incrementally and efficiently load new files as they arrive in cloud storage, and its Python syntax uses spark.readStream.format("cloudFiles").option("cloudFiles.format", "json").load("/input/path"). The other options either read statically (not as a stream), use an invalid format string ("cloud"), or contain a syntax error in the format call. Learn more: What is Auto Loader? - Databricks

Community Discussion

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