private void closeCurrent() throws IOException {
            if (currentWriter != null) {
                try {
                    currentWriter.close();

                    if (currentRows == 0L) {
                        try {
                            io.deleteFile(currentFile.encryptingOutputFile());
                        } catch (UncheckedIOException e) {
                            // the file may not have been created, and it isn't worth failing the job to clean up,
                            // skip deleting
                        }
                    } else {
                        complete(currentWriter);
                    }

                } catch (IOException | RuntimeException e) {
                    setFailure(e);
                    throw e;

                } finally {
                    this.currentFile = null;
                    this.currentWriter = null;
                    this.currentRows = 0;
                }
            }
        }
Delete those rows with the given key. It will only write the values of equality fields into
the equality-delete file.

@param key is the projected data whose columns are the same as the equality fields.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/sink/trick/BaseTaskWriter.java