You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "jackye1995 (via GitHub)" <gi...@apache.org> on 2023/04/03 21:56:42 UTC

[GitHub] [iceberg] jackye1995 commented on a diff in pull request #7263: Spark: broadcast table instead of file IO in rewrite manifests

jackye1995 commented on code in PR #7263:
URL: https://github.com/apache/iceberg/pull/7263#discussion_r1156491757


##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java:
##########
@@ -360,25 +358,26 @@ private void deleteFiles(Iterable<String> locations) {
         .noRetry()
         .suppressFailureWhenFinished()
         .onFailure((location, exc) -> LOG.warn("Failed to delete: {}", location, exc))
-        .run(fileIO::deleteFile);
+        .run(location -> table.io().deleteFile(location));
   }
 
   private static ManifestFile writeManifest(
       List<Row> rows,
       int startIndex,
       int endIndex,
-      Broadcast<FileIO> io,
+      Broadcast<Table> tableBroadcast,
       String location,
       int format,
       Types.StructType combinedPartitionType,
       PartitionSpec spec,
       StructType sparkType)
       throws IOException {
 
+    FileIO io = tableBroadcast.value().io();

Review Comment:
   since `io` is only used once, I think we can just put it inline at L380?



-- 
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