You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "abmo-x (via GitHub)" <gi...@apache.org> on 2023/02/16 02:06:42 UTC

[GitHub] [iceberg] abmo-x commented on a diff in pull request #6839: Fix: Do not use overwrite avro appender for manifests with non Hadoop io

abmo-x commented on code in PR #6839:
URL: https://github.com/apache/iceberg/pull/6839#discussion_r1107931390


##########
core/src/main/java/org/apache/iceberg/avro/Avro.java:
##########
@@ -153,6 +155,18 @@ public WriteBuilder metricsConfig(MetricsConfig newMetricsConfig) {
       return this;
     }
 
+    /**
+     * Overwrite only if needed on File systems where a new empty file gets pre-created like {@link
+     * HadoopFileIO}
+     *
+     * @return {@link WriteBuilder}
+     */
+    public WriteBuilder overwriteIfNeeded() {
+      boolean needsOverwrite =
+          file instanceof HadoopFileIO || file instanceof Files.LocalOutputFile;

Review Comment:
   yes its used in unit tests and `tmp.newFile` pre-creates a local empty file.
   
   Had to make it public to be used in this class here, as package is different I couldn't use protected/package-protected



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org