databricks Data Engineer Associate · Practice questions

Section 2: Data Ingestion and Loading Practice Questions

Review 10 sample questions with their correct answers and explanations. Sign up free to continue with the full topic quiz.

Sign up free for the full quiz

Question 1

Which COPY INTO statement loads JSON files and allows new columns in the files to be added to the target table schema?

  1. COPY INTO t FROM '/Volumes/raw/app/events' FILEFORMAT = JSON FORMAT_OPTIONS ('addNewColumns' = 'true')
  2. COPY INTO t FROM '/Volumes/raw/app/events' FILEFORMAT = JSON COPY_OPTIONS ('force' = 'true')
  3. COPY INTO t FROM '/Volumes/raw/app/events' FILEFORMAT = JSON COPY_OPTIONS ('mergeSchema' = 'true') — Correct
  4. COPY INTO t FROM '/Volumes/raw/app/events' FILEFORMAT = JSON SCHEMA EVOLUTION = 'auto'

Correct answer

COPY INTO t FROM '/Volumes/raw/app/events' FILEFORMAT = JSON COPY_OPTIONS ('mergeSchema' = 'true')

Explanation

COPY_OPTIONS ('mergeSchema' = 'true') lets COPY INTO evolve the target schema. force = true reloads files regardless of history.

Question 2

Which ingestion method should be chosen when a supported database such as SQL Server needs ongoing CDC replication into Delta tables, with minimal custom code?

  1. UI file upload
  2. Lakeflow Connect managed connector for SQL Server — Correct
  3. A nightly JDBC full extract into CSV files in a volume
  4. A Delta Sharing recipient

Correct answer

Lakeflow Connect managed connector for SQL Server

Explanation

Lakeflow Connect database connectors capture changes from sources like SQL Server and keep Delta tables updated incrementally.

Question 3

An engineer must read a table from an on-premises PostgreSQL database into a notebook once per night and write it to a Delta table. Credentials must not appear in the notebook. Which approach is correct?

  1. Use Auto Loader with cloudFiles.format set to jdbc and the password in the options
  2. Use spark.read.format('jdbc') with the password typed into a notebook widget each night
  3. Use COPY INTO with a JDBC URL that includes the password as a query parameter
  4. Use the JDBC reader with the password read from a secret scope — Correct

Correct answer

Use the JDBC reader with the password read from a secret scope

Explanation

The JDBC reader can read database tables; secrets should be stored in a secret scope and retrieved with dbutils.secrets.get, which redacts them in output.

Question 4

A data engineer must load only files modified after a certain date from a folder that already contains years of historical files, using Auto Loader. Which option helps?

  1. cloudFiles.includeExistingFiles = true
  2. modifiedAfter — Correct
  3. cloudFiles.partitionColumns
  4. cloudFiles.backfillInterval

Correct answer

modifiedAfter

Explanation

The modifiedAfter option filters input files by modification time. includeExistingFiles = false would skip all files present when the stream first starts.

Question 5

A Kafka topic carries order events. The data engineer must ingest them into a bronze Delta table continuously. Which approach is appropriate?

  1. A Lakehouse Federation connection to the Kafka cluster
  2. COPY INTO with FILEFORMAT = KAFKA
  3. Auto Loader with cloudFiles.format = 'kafka'
  4. A Structured Streaming Kafka source written to Delta with a checkpoint — Correct

Correct answer

A Structured Streaming Kafka source written to Delta with a checkpoint

Explanation

Structured Streaming's Kafka source reads topics; writing to Delta with a checkpoint provides fault-tolerant ingestion. Auto Loader and COPY INTO read files.

Question 6

An Auto Loader stream was started with cloudFiles.includeExistingFiles set to false. What happens to files that were already in the folder when the stream first started?

  1. The stream fails until they are deleted
  2. They are processed first, before new files
  3. They are skipped; only later files are ingested — Correct
  4. They are moved into a quarantine folder

Correct answer

They are skipped; only later files are ingested

Explanation

includeExistingFiles = false ignores files present at the first start and processes only new arrivals.

Question 7

Which column can be selected in a file-based read to get the source file name and modification time of each row?

  1. input_file_path()
  2. _metadata — Correct
  3. _rescued_data
  4. _source

Correct answer

_metadata

Explanation

The hidden _metadata column provides file_path, file_name, file_size and file_modification_time for file-based sources. input_file_name() is the older function.

Question 8

A data engineer must ingest JSON files that arrive continuously in a cloud storage folder into a bronze Delta table. New fields appear occasionally and must be added to the table schema without manual changes. Which approach meets these requirements with the least effort?

  1. A Lakehouse Federation connection to the storage folder queried through a foreign catalog
  2. A scheduled spark.read.json job that overwrites the bronze table each hour with mergeSchema enabled
  3. COPY INTO with FORMAT_OPTIONS ('inferSchema' = 'false') and a fixed DDL schema on the target table
  4. Auto Loader with a schema location and schemaEvolutionMode set to addNewColumns — Correct

Correct answer

Auto Loader with a schema location and schemaEvolutionMode set to addNewColumns

Explanation

Auto Loader incrementally discovers new files, tracks progress in a checkpoint, and with a schema location can infer and evolve the schema. addNewColumns (the default when no schema is provided) adds new fields.

Question 9

A daily job must process all new files that arrived since the last run with Auto Loader and then stop, to save cost. Which trigger should be used?

  1. trigger(continuous='1 second')
  2. trigger(availableNow=True) — Correct
  3. trigger(processingTime='0 seconds')
  4. No trigger, with the default micro-batch interval

Correct answer

trigger(availableNow=True)

Explanation

availableNow processes all available data in one or more micro-batches and then stops, giving incremental batch semantics. The default trigger runs continuously.

Question 10

A data engineer must ingest a few Excel-like CSV extracts that a business user uploads occasionally. The extracts should be queryable by analysts the same day. What is the simplest option?

  1. Build a Kafka topic for the files
  2. Create a Lakehouse Federation connection to the user's laptop
  3. Write a custom Spark data source
  4. Upload the files and create a managed table — Correct

Correct answer

Upload the files and create a managed table

Explanation

For occasional small files, uploading to a volume or using the table upload UI is the simplest path.

Ready for the full quiz?

Create a free QuizAnalyst account to practice the complete question set and save your progress.

Sign up free for the full quiz