tom-s-powell commented on code in PR #14608:
URL: https://github.com/apache/iceberg/pull/14608#discussion_r2580942345
##########
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:
Fair enough. I had done this to match the behaviour of `ConfigResponse` but
given I've removed that I've removed this. One thing to be mindful of is
`ImmutableMap` will _not_ accept nulls, and I am still using
`ImmutableMap.copyOf`. I guess it is unexpected to have nulls in the place
where we're currently using this utility so likely fine.
--
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]