diff --git a/core/src/main/java/com/netease/arctic/table/BasicKeyedTable.java b/core/src/main/java/com/netease/arctic/table/BasicKeyedTable.java index 3f363c4e27..fa039cf05f 100644 --- a/core/src/main/java/com/netease/arctic/table/BasicKeyedTable.java +++ b/core/src/main/java/com/netease/arctic/table/BasicKeyedTable.java @@ -40,6 +40,7 @@ import org.apache.iceberg.UpdateSchema; import org.apache.iceberg.events.CreateSnapshotEvent; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; +import org.apache.iceberg.relocated.com.google.common.collect.Maps; import java.util.Map; @@ -119,22 +120,22 @@ public Map properties() { long changeWatermark = TablePropertyUtil.getTableWatermark(changeTable.properties()); long baseWatermark = TablePropertyUtil.getTableWatermark(baseTable.properties()); - ImmutableMap.Builder builder = ImmutableMap.builder(); + Map properties = Maps.newHashMap(); if (changeWatermark > baseWatermark) { baseTable .properties() .forEach( (k, v) -> { if (!TableProperties.WATERMARK_TABLE.equals(k)) { - builder.put(k, v); + properties.put(k, v); } }); - builder.put(TableProperties.WATERMARK_TABLE, String.valueOf(changeWatermark)); + properties.put(TableProperties.WATERMARK_TABLE, String.valueOf(changeWatermark)); } else { - builder.putAll(baseTable.properties()); + properties.putAll(baseTable.properties()); } - builder.put(TableProperties.WATERMARK_BASE_STORE, String.valueOf(baseWatermark)); - return builder.build(); + properties.put(TableProperties.WATERMARK_BASE_STORE, String.valueOf(baseWatermark)); + return ImmutableMap.copyOf(properties); } @Override