pvary commented on code in PR #3362:
URL: https://github.com/apache/hive/pull/3362#discussion_r907321359


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/writer/WriterRegistry.java:
##########
@@ -19,26 +19,29 @@
 
 package org.apache.iceberg.mr.hive.writer;
 
+import java.util.List;
 import java.util.Map;
 import org.apache.hadoop.mapred.TaskAttemptID;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
 import org.apache.iceberg.relocated.com.google.common.collect.Maps;
 
 public class WriterRegistry {
-  private static final Map<TaskAttemptID, Map<String, HiveIcebergWriter>> 
writers = Maps.newConcurrentMap();
+  private static final Map<TaskAttemptID, Map<String, 
List<HiveIcebergWriter>>> writers = Maps.newConcurrentMap();
 
   private WriterRegistry() {
   }
 
-  public static Map<String, HiveIcebergWriter> removeWriters(TaskAttemptID 
taskAttemptID) {
+  public static Map<String, List<HiveIcebergWriter>> 
removeWriters(TaskAttemptID taskAttemptID) {
     return writers.remove(taskAttemptID);
   }
 
   public static void registerWriter(TaskAttemptID taskAttemptID, String 
tableName, HiveIcebergWriter writer) {
     writers.putIfAbsent(taskAttemptID, Maps.newConcurrentMap());
-    writers.get(taskAttemptID).put(tableName, writer);
+    writers.get(taskAttemptID).putIfAbsent(tableName, Lists.newArrayList());

Review Comment:
   nit: would it worth to declare a variable for this?



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