Loading files from cloud storage into governed tables with COPY INTO
COPY INTO is a SQL command that idempotently and incrementally loads new files from a cloud storage location into a Delta table, tracking which files have already been ingested so reruns skip them. It suits append-only, file-based ingestion at moderate volumes and works with tables registered in Unity Catalog, provided the external location and storage credential are set up for governed access.
1 · Learn the must-know
- COPY INTO tracks already-loaded files internally (via table metadata), so re-running the same command against the same source path will not reload files already ingested, making it safe to schedule repeatedly.
- The target table must already exist (COPY INTO does not create tables); for Unity Catalog use, you create the Delta table first with CREATE TABLE, then run COPY INTO against it.
- Reading from cloud storage (ADLS, S3, GCS) under Unity Catalog requires a configured storage credential and external location (or a volume) with proper access grants; direct cloud URIs need governed access unless using a UC volume path.
COPY_OPTIONSsuch as mergeSchema (to allow schema evolution) and FORCE (to reprocess files even if already loaded) let you override default idempotent, schema-enforced behavior.- For very large numbers of new files or continuous/streaming ingestion, Auto Loader is generally preferred over COPY INTO, which is better suited to periodic batch loads of moderate file counts.
- COPY INTO supports common file formats (CSV, JSON, Parquet, Avro, ORC, text) and lets you specify FILEFORMAT and
FORMAT_OPTIONS(e.g., header, inferSchema) to control how source files are parsed.
2 · Check your understanding
A data engineer runs the following command daily to load new Parquet files from an external ADLS location into a Unity Catalog table: COPY INTO main.sales.transactions FROM 'abfss://[email protected]/transactions/' FILEFORMAT = PARQUET; On day two, 500 new files have landed alongside the original 10,000 files, none of which have been modified or deleted. What happens when the command runs again?
What you have tried across Databricks DEA's objectives, not a readiness score.
Databricks Intelligence Platform6% of the exam0 of 2 tried
Data Ingestion and Loading21% of the exam0 of 7 tried
Data Transformation and Modeling22% of the exam0 of 7 tried
Working with Lakeflow Jobs16% of the exam0 of 4 tried
Implementing CI/CD10% of the exam0 of 4 tried
Troubleshooting, Monitoring, and Optimization10% of the exam0 of 5 tried
Governance and Security15% of the exam0 of 4 tried
3 · Keep going
Ready for more? Take a weighted mock or try free practice questions.