QuestionQ256

VerifiedDevelopment and Ingestion

A pipeline uses COPY INTO to load CSV files from cloud object storage into a Unity Catalog Delta table. Occasionally, some files are re-uploaded under the same filename to correct their data.

The engineer wants the corrected data to be ingested as soon as it becomes available.

What should the engineer do?

Explanation

COPY INTO maintains metadata about which files have already been loaded so that reruns are idempotent; re-uploading a file with the same name to the same location causes COPY INTO to skip it as already processed, meaning corrected data in a same-named file will not be picked up. The supported pattern for handling corrections is to have the corrected data arrive as new, distinctly named files and then apply those corrections to the target table via an update/merge (e.g., a MERGE INTO statement) rather than relying on COPY INTO to reprocess an overwritten file. This preserves COPY INTO's exactly-once, incremental loading behavior while still allowing corrections to be applied promptly.

Learn more

Community Discussion

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