When you run a mapping in the native environment or on the Spark engine to write data to a complex file target, you can choose to overwrite the target data. You can select the
Overwrite Target
option in the advanced write properties of the complex file data object.
If you select the
Overwrite Target
option, the Data Integration Service deletes the target data before writing data. If you do not select this option, the Data Integration Service creates a new file in the target and writes the data to the file.
If you select the
Overwrite Target
option, the Data Integration Service deletes all the files and folders in the target directory that are prefixed with the target file name.
For example, the following image shows target data with Overwrite Fileport connected:
If you select the
Overwrite Target
option, the Data Integration Service deletes all the folders and files in the target directory that are prefixed with the target file name.
The following image shows the file structure after using the
Overwrite Target
option:
If you do not use the
Overwrite Target
option, the Data Integration Service adds the data to the existing files and folders in the target directory.
The following image shows the file structure when you append data:
To avoid unnecessary deletion of files and folders, you must verify that the target directory does not contain any folder or file with the same name as the target file name.