Data-Engineer-Associate - Data Ingestion and Loading (21% of the exam) - Section 2.2

Use the COPY INTO command to incrementally load files from cloud object storage into Unity Catalog governed tables.

Write COPY INTO statements that load files from ADLS, S3 or GCS into a Unity Catalog table, and explain its idempotent behaviour: files already loaded are skipped on rerun. Recognise when COPY INTO fits (thousands of files, SQL-first teams) and when Auto Loader is the better choice.

COPY INTOidempotent loadingcloud object storageFILEFORMATUnity Catalog tables

Practice question for this objective

Free sampleData Ingestion and Loadingmedium

A data engineer loads a Unity Catalog managed table from a cloud object storage folder using COPY INTO. The first run ingests the twelve JSON files present in the folder. A partner then adds three further files to the same folder, and the engineer runs the identical COPY INTO statement again without changing any option. What does the second run load into the table?

COPY INTO prod.raw.events
FROM 's3://landing/events/'
FILEFORMAT = JSON
  • AAll fifteen files, because COPY INTO rescans the source folder and rewrites the target table from the complete file listing on every run.
  • BAll fifteen files, because file tracking applies only when a PATTERN clause narrows the source folder to a subset of the files it contains.
  • COnly the three new files, because COPY INTO records which files it has already ingested and skips them on subsequent runs against the same target table. Correct
  • DNothing at all, because the target table already exists and COPY INTO refuses to append to a table it has previously written to without a force option.
COPY INTO is idempotent: it tracks the files already ingested into a target table and loads only newly arrived files on later runs. COPY INTO maintains load metadata associating a target table with the source files already ingested into it. When the same statement runs again, each file in the source location is compared against that record, previously ingested files are skipped, and only the newly arrived files are appended. This is what makes repeated scheduled runs safe rather than duplicating rows.

Why A is wrong: This is tempting because the statement does name the whole folder each time, but COPY INTO appends incrementally and does not rewrite the target from the full listing.

Why B is wrong: PATTERN is a real clause and does filter which files are considered, but it plays no part in whether already-ingested files are skipped, so this reasoning is wrong.

Why C is correct: Correct. COPY INTO keeps per-target metadata of the source files it has already ingested, so a repeated run picks up only files it has not seen before.

Why D is wrong: Tempting because a force option does exist, but its role is to clear the load history and reprocess, not to permit any append at all, so a plain rerun still loads new files.

See more Data-Engineer-Associate practice questions, answers explained.

Exam traps in Data Ingestion and Loading

Answers that look right on this material and are not. Each one is a distractor from a different question in the Data-Engineer-Associate bank for this domain.

  • Re-run the statement with COPY_OPTIONS ('mergeSchema' = 'true') so that the corrected files are read with their revised schema and appended to the table.

    Why it is wrong: The merge schema copy option is real and does evolve the target schema, but the load returned zero rows because of file tracking, not because a column failed to match.

  • Use Auto Loader for both folders, because COPY INTO cannot write into a Unity Catalog managed table and is restricted to tables backed by an external location.

    Why it is wrong: Auto Loader would technically work in both cases, but the stated reason is false: COPY INTO writes into Unity Catalog managed tables perfectly well.

  • COPY INTO suits it better because it learns of new files from a cloud queue, whereas Auto Loader has to list the whole source directory again on every run.

    Why it is wrong: The description of queue based discovery is real but belongs to Auto Loader's file notification mode, so the two products have been swapped. COPY INTO has no notification mode of its own.

Examworthy is not affiliated with or endorsed by Databricks. Original, blueprint-aligned practice material only.