Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqi1129 committed Sep 24, 2024
1 parent 3c21686 commit 49f9ac3
Showing 1 changed file with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -891,15 +891,23 @@ private void createCatalog() {
// Why needs this conversion? Because PaimonCatalogOperations#initialize will try to convert
// Gravitino general S3 properties to Paimon specific S3 properties.
Map<String, String> copy = Maps.newHashMap(catalogProperties);
copy.put(
PaimonCatalogPropertiesMetadata.S3_ENDPOINT,
catalogProperties.get(S3Properties.GRAVITINO_S3_ENDPOINT));
copy.put(
PaimonCatalogPropertiesMetadata.S3_ACCESS_KEY,
catalogProperties.get(S3Properties.GRAVITINO_S3_ACCESS_KEY_ID));
copy.put(
PaimonCatalogPropertiesMetadata.S3_SECRET_KEY,
catalogProperties.get(S3Properties.GRAVITINO_S3_SECRET_ACCESS_KEY));
if (catalogProperties.containsKey(S3Properties.GRAVITINO_S3_ENDPOINT)) {
copy.put(
PaimonCatalogPropertiesMetadata.S3_ENDPOINT,
catalogProperties.get(S3Properties.GRAVITINO_S3_ENDPOINT));
}

if (catalogProperties.containsKey(S3Properties.GRAVITINO_S3_ACCESS_KEY_ID)) {
copy.put(
PaimonCatalogPropertiesMetadata.S3_ACCESS_KEY,
catalogProperties.get(S3Properties.GRAVITINO_S3_ACCESS_KEY_ID));
}

if (catalogProperties.containsKey(S3Properties.GRAVITINO_S3_SECRET_ACCESS_KEY)) {
copy.put(
PaimonCatalogPropertiesMetadata.S3_SECRET_KEY,
catalogProperties.get(S3Properties.GRAVITINO_S3_SECRET_ACCESS_KEY));
}

PaimonBackendCatalogWrapper paimonBackendCatalogWrapper =
CatalogUtils.loadCatalogBackend(new PaimonConfig(copy));
Expand Down

0 comments on commit 49f9ac3

Please sign in to comment.