yma11 commented on code in PR #8123:
URL: https://github.com/apache/incubator-gluten/pull/8123#discussion_r1899531573
##########
cpp/velox/utils/ConfigExtractor.cc:
##########
@@ -62,76 +51,99 @@ std::shared_ptr<facebook::velox::config::ConfigBase>
getHiveConfig(
std::unordered_map<std::string, std::string> hiveConfMap;
#ifdef ENABLE_S3
- std::string awsAccessKey =
conf->get<std::string>("spark.hadoop.fs.s3a.access.key", "");
- std::string awsSecretKey =
conf->get<std::string>("spark.hadoop.fs.s3a.secret.key", "");
- std::string awsEndpoint =
conf->get<std::string>("spark.hadoop.fs.s3a.endpoint", "");
- bool sslEnabled =
conf->get<bool>("spark.hadoop.fs.s3a.connection.ssl.enabled", false);
- bool pathStyleAccess =
conf->get<bool>("spark.hadoop.fs.s3a.path.style.access", false);
- bool useInstanceCredentials =
conf->get<bool>("spark.hadoop.fs.s3a.use.instance.credentials", false);
- std::string iamRole = conf->get<std::string>("spark.hadoop.fs.s3a.iam.role",
"");
- std::string iamRoleSessionName =
conf->get<std::string>("spark.hadoop.fs.s3a.iam.role.session.name", "");
- std::string retryMaxAttempts =
conf->get<std::string>("spark.hadoop.fs.s3a.retry.limit", "20");
- std::string retryMode = conf->get<std::string>(kVeloxS3RetryMode,
kVeloxS3RetryModeDefault);
- std::string maxConnections =
conf->get<std::string>("spark.hadoop.fs.s3a.connection.maximum", "15");
- std::string connectTimeout = conf->get<std::string>(kVeloxS3ConnectTimeout,
kVeloxS3ConnectTimeoutDefault);
-
- std::string awsSdkLogLevel = conf->get<std::string>(kVeloxAwsSdkLogLevel,
kVeloxAwsSdkLogLevelDefault);
-
- const char* envAwsAccessKey = std::getenv("AWS_ACCESS_KEY_ID");
- if (envAwsAccessKey != nullptr) {
- awsAccessKey = std::string(envAwsAccessKey);
- }
- const char* envAwsSecretKey = std::getenv("AWS_SECRET_ACCESS_KEY");
- if (envAwsSecretKey != nullptr) {
- awsSecretKey = std::string(envAwsSecretKey);
- }
- const char* envAwsEndpoint = std::getenv("AWS_ENDPOINT");
- if (envAwsEndpoint != nullptr) {
- awsEndpoint = std::string(envAwsEndpoint);
- }
- const char* envRetryMaxAttempts = std::getenv("AWS_MAX_ATTEMPTS");
- if (envRetryMaxAttempts != nullptr) {
- retryMaxAttempts = std::string(envRetryMaxAttempts);
- }
- const char* envRetryMode = std::getenv("AWS_RETRY_MODE");
- if (envRetryMode != nullptr) {
- retryMode = std::string(envRetryMode);
- }
-
- if (useInstanceCredentials) {
- hiveConfMap[facebook::velox::filesystems::S3Config::baseConfigKey(
-
facebook::velox::filesystems::S3Config::Keys::kUseInstanceCredentials)] =
"true";
- } else if (!iamRole.empty()) {
- hiveConfMap[facebook::velox::filesystems::S3Config::baseConfigKey(
- facebook::velox::filesystems::S3Config::Keys::kIamRole)] = iamRole;
- if (!iamRoleSessionName.empty()) {
- hiveConfMap[facebook::velox::filesystems::S3Config::baseConfigKey(
- facebook::velox::filesystems::S3Config::Keys::kIamRoleSessionName)]
= iamRoleSessionName;
+ using namespace facebook::velox::filesystems;
+ std::string_view kSparkHadoopPrefix = "spark.hadoop.fs.s3a.";
+ std::string_view kSparkHadoopBucketPrefix = "spark.hadoop.fs.s3a.bucket.";
+
+ // Log granularity of AWS C++ SDK
+ const std::string kVeloxAwsSdkLogLevel = "spark.gluten.velox.awsSdkLogLevel";
+ const std::string kVeloxAwsSdkLogLevelDefault = "FATAL";
+
+ const std::unordered_map<S3Config::Keys, std::pair<std::string,
std::optional<std::string>>> sparkSuffixes = {
+ {S3Config::Keys::kAccessKey, std::make_pair("access.key", std::nullopt)},
+ {S3Config::Keys::kSecretKey, std::make_pair("secret.key", std::nullopt)},
+ {S3Config::Keys::kEndpoint, std::make_pair("endpoint", std::nullopt)},
+ {S3Config::Keys::kSSLEnabled, std::make_pair("connection.ssl.enabled",
"false")},
+ {S3Config::Keys::kPathStyleAccess, std::make_pair("path.style.access",
"false")},
+ {S3Config::Keys::kMaxAttempts, std::make_pair("retry.limit",
std::nullopt)},
+ {S3Config::Keys::kRetryMode, std::make_pair("retry.mode", "legacy")},
+ {S3Config::Keys::kMaxConnections, std::make_pair("connection.maximum",
"15")},
+ {S3Config::Keys::kConnectTimeout, std::make_pair("connect-timeout",
"200s")},
Review Comment:
still a typo as expected `connection.timeout`?
--
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]