A data engineer runs a COPY INTO statement that loads 120 files from an external S3 stage into a target table. The LOAD_UNCERTAIN_FILES option was not specified, and 42 files were already loaded by an earlier run that completed successfully. The engineer expects all 120 files to be reprocessed because the target table was truncated before this run. What will Snowflake actually do, and why?
Snowflake records which staged files have been loaded into each table in metadata that persists across DML such as TRUNCATE. Because LOAD_UNCERTAIN_FILES was omitted, files with a LOADED status for that table are filtered out before reading. Only the 78 files with no prior successful load are processed in this run.
Why this answer
COPY INTO maintains a per-table record of which staged files have already been loaded, and this record survives operations that change or remove table rows. With LOAD_UNCERTAIN_FILES left at its default, only files that have not been successfully loaded into the target are read, so a truncated table does not force reprocessing of files already recorded as loaded.
Exam trap
The trap here is assuming that clearing or truncating the target table also clears the per-table load metadata that COPY INTO uses to filter staged files.