nastra commented on code in PR #14608:
URL: https://github.com/apache/iceberg/pull/14608#discussion_r2580846947
##########
core/src/main/java/org/apache/iceberg/util/PropertyUtil.java:
##########
@@ -191,6 +193,21 @@ public static Map<String, String> filterProperties(
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
}
+ public static Map<String, String> mergeProperties(
+ Map<String, String> properties, Map<String, String> overrides) {
+ if (overrides == null || overrides.isEmpty()) {
+ return properties;
+ }
+
+ if (properties == null || properties.isEmpty()) {
+ return overrides;
+ }
+
+ Map<String, String> merged = Maps.newHashMap(properties);
+ merged.putAll(overrides);
+ return ImmutableMap.copyOf(Maps.filterValues(merged, Objects::nonNull));
Review Comment:
I don't think we should be filtering here, as the method indicates that it
does a merge only. Also let's just remove the merged map instead of the
ImmutableMap
--
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]