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.
   
   ```java
   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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to