JingsongLi commented on code in PR #6232:
URL: https://github.com/apache/paimon/pull/6232#discussion_r2335975793
##########
paimon-api/src/main/java/org/apache/paimon/rest/RESTUtil.java:
##########
@@ -72,19 +74,30 @@ public static Map<String, String> merge(
if (updates == null) {
updates = Maps.newHashMap();
}
- ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
- for (Map.Entry<String, String> entry : targets.entrySet()) {
- if (!updates.containsKey(entry.getKey()) && entry.getValue() !=
null) {
- builder.put(entry.getKey(), entry.getValue());
+
+ Map<String, String> result = Maps.newLinkedHashMap();
+
+ // First, add all non-null entries from updates
+ for (Map.Entry<String, String> entry : updates.entrySet()) {
+ if (entry.getValue() != null) {
+ result.put(entry.getKey(), entry.getValue());
}
}
- for (Map.Entry<String, String> entry : updates.entrySet()) {
+
+ // Then, add entries from targets, which take precedence (override
updates)
+ for (Map.Entry<String, String> entry : targets.entrySet()) {
if (entry.getValue() != null) {
- builder.put(entry.getKey(), entry.getValue());
+ result.put(entry.getKey(), entry.getValue());
}
}
- return builder.build();
+ // Handle special case: dlf.oss-endpoint should override
fs.oss.endpoint
+ String dlfOssEndpoint = result.get(DLF_OSS_ENDPOINT.key());
Review Comment:
Can you just modify `RESTTokenFileIO`? `RESTUtil.merge` should be a very
simple method, just `updates` merge into `targets`.
--
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]