xiaoxuandev commented on a change in pull request #4280:
URL: https://github.com/apache/iceberg/pull/4280#discussion_r833564623
##########
File path: aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java
##########
@@ -104,13 +109,35 @@ public GlueCatalog() {
@Override
public void initialize(String name, Map<String, String> properties) {
+ AwsClientFactory awsClientFactory;
+ FileIO catalogFileIO;
+ if (PropertyUtil.propertyAsBoolean(
+ properties,
+ AwsProperties.GLUE_LAKEFORMATION_ENABLED,
+ AwsProperties.GLUE_LAKEFORMATION_ENABLED_DEFAULT)) {
+ String factoryImpl = PropertyUtil.propertyAsString(properties,
AwsProperties.CLIENT_FACTORY, null);
+ ImmutableMap.Builder<String, String> builder = ImmutableMap.<String,
String>builder().putAll(properties);
+ if (factoryImpl == null) {
+ builder.put(AwsProperties.CLIENT_FACTORY,
LakeFormationAwsClientFactory.class.getName());
+ }
+ this.catalogProperties = builder.build();
+ awsClientFactory = AwsClientFactories.from(catalogProperties);
+ Preconditions.checkArgument(awsClientFactory instanceof
LakeFormationAwsClientFactory,
+ "Detected LakeFormation enabled for Glue catalog, " +
+ "should use a client factory that extends %s, but found %s",
+ LakeFormationAwsClientFactory.class.getName(), factoryImpl);
+ catalogFileIO = null;
+ } else {
+ awsClientFactory = AwsClientFactories.from(properties);
+ catalogFileIO = initializeFileIO(properties);
+ }
initialize(
Review comment:
done. thanks.
--
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]