yzeng1618 commented on PR #10266: URL: https://github.com/apache/seatunnel/pull/10266#issuecomment-3712851506
> This looks functionally redundant with the existing SaveMode design. For file connectors, SeaTunnel already has: `DataSaveMode` to control how existing data (files) is handled `SchemaSaveMode` to control how the target path / directory is handled File existence is a data-level concern and should be covered by DataSaveMode. Introducing a separate file_exists_mode duplicates this responsibility and fragments behavior control, making the File connector inconsistent with other sinks. It would be preferable to reuse or extend the existing SaveMode mechanism rather than adding a new, connector-specific option. SchemaSaveMode/DataSaveMode are executed pre-write and work at a directory (“table”) level via the Catalog: create/drop/truncate the target path or check whether the directory already contains data files. file_exists_mode is applied at the 2PC commit stage, when we rename/move a temp file under tmp_path to the final target file. It specifically controls the behavior when the final target file name already exists (e.g., single_file_mode, fixed file_name_expression, or binary with relativePath). So it’s not duplicating the existing SaveMode; it complements a commit-time, single-file conflict that SaveMode currently can’t express. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
