private void createTaskWriter() {
        if (switchAppendUpsertEnable) {
            // when the job starts and the switch is enabled, the writer
            // should be in append mode by default
            taskWriterFactory.switchToAppend();
        }
        this.writer = taskWriterFactory.create();
    }
this method should only be called in open() method
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/sink/multiple/IcebergSingleStreamWriter.java