jerryshao commented on code in PR #5134:
URL: https://github.com/apache/gravitino/pull/5134#discussion_r1802875943
##########
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/ops/IcebergCatalogWrapper.java:
##########
@@ -303,18 +348,38 @@ private void closePostgreSQLCatalogResource() {
}
// Some io and security configuration should pass to Iceberg REST client
- private LoadTableResponse injectTableConfig(Supplier<LoadTableResponse>
supplier) {
+ private LoadTableResponse injectTableConfig(
+ Supplier<LoadTableResponse> supplier, Function<String, Map<String,
String>> configInjector) {
LoadTableResponse loadTableResponse = supplier.get();
return LoadTableResponse.builder()
.withTableMetadata(loadTableResponse.tableMetadata())
- .addAllConfig(getCatalogConfigToClient())
+
.addAllConfig(configInjector.apply(loadTableResponse.tableMetadata().location()))
.build();
}
- private Map<String, String> getCatalogConfigToClient() {
+ private Map<String, String> getCatalogConfigToClient(String location) {
return catalogConfigToClients;
}
+ private Map<String, String> vendCredentials(String location) {
+ // ifPresentOrElse is not supported in Java8
+ if (credentialProvider.isPresent()) {
+ Map<String, String> configs = new HashMap<>(catalogConfigToClients);
+ // todo(fanng): check user privilege.
+ PathBasedCredentialContext pathBasedCredentialContext =
+ new PathBasedCredentialContext(
+ PrincipalUtils.getCurrentUserName(), ImmutableSet.of(location),
ImmutableSet.of());
Review Comment:
Do you need to set write path?
--
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]