mchades commented on code in PR #6923:
URL: https://github.com/apache/gravitino/pull/6923#discussion_r2065321244
##########
catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalogOperations.java:
##########
@@ -69,7 +72,15 @@ public class HudiCatalogOperations implements
CatalogOperations, SupportsSchemas
public void initialize(
Map<String, String> config, CatalogInfo info, HasPropertyMetadata
propertiesMetadata)
throws RuntimeException {
- HudiCatalogBackend hudiCatalogBackend =
CatalogUtils.loadHudiCatalogBackend(config);
+ Map<String, String> newConfig;
+ if (config instanceof ImmutableMap) {
+ newConfig = new LinkedHashMap<>(config);
+ } else {
+ newConfig = config;
+ }
+ newConfig.put(
+ CatalogUtils.CATALOG_ID_KEY, Objects.nonNull(info) ?
String.valueOf(info.id()) : "0");
+ HudiCatalogBackend hudiCatalogBackend =
CatalogUtils.loadHudiCatalogBackend(newConfig);
Review Comment:
suggestion:
```java
ImmutableMap.Builder<Object, Object> newConf = ImmutableMap.builder();
newConf.putAll(config);
newConf.put(
CatalogUtils.CATALOG_ID_KEY, Objects.nonNull(info) ?
String.valueOf(info.id()) : "0");
HudiCatalogBackend hudiCatalogBackend =
CatalogUtils.loadHudiCatalogBackend(newConf.build());
```
--
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]