in polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/CsvETagManager.java [113:137]
public void close() throws IOException {
BufferedWriter writer = Files.newBufferedWriter(file.toPath(), UTF_8);
writer.write(""); // clear file
CSVFormat csvFormat = CSVFormat.DEFAULT.builder().setHeader(HEADERS).get();
CSVPrinter printer = new CSVPrinter(writer, csvFormat);
// write etags to file
tablesByCatalogName.forEach(
(catalogName, etagsByTable) -> {
etagsByTable.forEach(
(tableIdentifier, etag) -> {
try {
printer.printRecord(catalogName, tableIdentifier.toString(), etag);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
});
printer.flush();
printer.close();
}