Hi @Danh_Hoa , The issue you're experiencing might be due to a few reasons:
1. The Delta table you're trying to truncate and copy into might not actually be a Delta table. If the table was not created as a Delta table, you will not be able to perform Delta operations on it. This is indicated by the error DELTA_MISSING_DELTA_TABLE
. Ensure that the table you're working with is indeed a Delta table.
2. The COPY INTO
command might be failing due to corrupted files. As per the given documentation, if the data you are ingesting cannot be read due to some corruption issue, you can skip corrupted files by setting ignoreCorruptFiles
to true
in the FORMAT_OPTIONS
.
However, if there are too many corrupted files, this might result in no data being copied into your table.
3. The data files for your Delta table might have been deleted due to log cleanup, as indicated by the error DELTA_MISSING_FILES_UNEXPECTED_VERSION
.
In this case, you might need to restart your stream with a new checkpoint location and increase your delta.logRetentionDuration
setting.