You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/07/26 07:24:02 UTC

[GitHub] [iceberg] kbendick commented on a change in pull request #2858: Core: Support multiple specs in OutputFileFactory

kbendick commented on a change in pull request #2858:
URL: https://github.com/apache/iceberg/pull/2858#discussion_r676354406



##########
File path: spark2/src/main/java/org/apache/iceberg/spark/source/Writer.java
##########
@@ -263,7 +263,7 @@ public String toString() {
     public DataWriter<InternalRow> createDataWriter(int partitionId, long taskId, long epochId) {
       Table table = tableBroadcast.value();
 
-      OutputFileFactory fileFactory = new OutputFileFactory(table, format, partitionId, taskId);
+      OutputFileFactory fileFactory = OutputFileFactory.builderFor(table, format, partitionId, taskId).build();

Review comment:
       Nit: Instead of keeping the constructor arguments, since we're using a builder, would it make sense to use a builder pattern constructor, such as the following?
   
   Since these are all required fields, this might introduce more complexity than it is worth, but some of the fields _seem_ like things we might be able to determine other ways (such as partitionId). But I'm not quite sure if that's correct or not.
   
   ```
   OutputFileFactor
       .builderFor(table)
       .withFormat(format)
       .withPartitonId(partitionId)
       .withTaskId(taskId)
       .build();
   ```
   




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