[Feature] Support pathStyleAccess for broker load (#14569)

Add a new broker config option `"fs.s3a.path.style.access"` to allow toggling the path style. The option value must either be "true" or "false". Default value is "false".

```
WITH BROKER "broker1"
(
  "fs.s3a.access.key" = "myaccesskey",
  "fs.s3a.secret.key" = "mysecretkey",
  "fs.s3a.endpoint" = "host.testcontainers.internal:49651"
  "fs.s3a.path.style.access" = "true"
)
```
This commit is contained in:
Jiacheng Yang 2022-12-04 12:20:58 -08:00 committed by GitHub
parent a5d95acdba
commit 9f804e518a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,7 @@ public class FileSystemManager {
private static final String FS_S3A_ACCESS_KEY = "fs.s3a.access.key";
private static final String FS_S3A_SECRET_KEY = "fs.s3a.secret.key";
private static final String FS_S3A_ENDPOINT = "fs.s3a.endpoint";
private static final String FS_S3A_PATH_STYLE_ACCESS = "fs.s3a.path.style.access";
// This property is used like 'fs.hdfs.impl.disable.cache'
private static final String FS_S3A_IMPL_DISABLE_CACHE = "fs.s3a.impl.disable.cache";
private static final String FS_S3A_CONNECTION_SSL_ENABLED = "fs.s3a.connection.ssl.enabled";
@ -450,6 +451,7 @@ public class FileSystemManager {
String accessKey = properties.getOrDefault(FS_S3A_ACCESS_KEY, "");
String secretKey = properties.getOrDefault(FS_S3A_SECRET_KEY, "");
String endpoint = properties.getOrDefault(FS_S3A_ENDPOINT, "");
String pathStyleAccess = properties.getOrDefault(FS_S3A_PATH_STYLE_ACCESS, "false");
String disableCache = properties.getOrDefault(FS_S3A_IMPL_DISABLE_CACHE, "true");
String connectionSSLEnabled = properties.getOrDefault(FS_S3A_CONNECTION_SSL_ENABLED, "true");
String awsCredProvider = properties.getOrDefault(FS_S3A_AWS_CRED_PROVIDER, null);
@ -479,6 +481,7 @@ public class FileSystemManager {
conf.set(FS_S3A_ACCESS_KEY, accessKey);
conf.set(FS_S3A_SECRET_KEY, secretKey);
conf.set(FS_S3A_ENDPOINT, endpoint);
conf.set(FS_S3A_PATH_STYLE_ACCESS, pathStyleAccess);
conf.set(FS_S3A_IMPL_DISABLE_CACHE, disableCache);
conf.set(FS_S3A_CONNECTION_SSL_ENABLED, connectionSSLEnabled);
if (awsCredProvider != null) {