kou commented on code in PR #36791:
URL: https://github.com/apache/arrow/pull/36791#discussion_r1269917168
##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -337,6 +338,10 @@ Result<S3Options> S3Options::FromUri(const Uri& uri,
std::string* out_path) {
} else {
options.ConfigureDefaultCredentials();
}
+ auto endpoint_env = arrow::internal::GetEnvVar(kDefaultEndpointEnvVar);
+ if(endpoint_env.ok()) {
Review Comment:
```suggestion
if (endpoint_env.ok()) {
```
##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -127,6 +127,7 @@ using internal::ToAwsString;
using internal::ToURLEncodedAwsString;
static const char kSep = '/';
+constexpr char kDefaultEndpointEnvVar[] = "AWS_ENDPOINT";
Review Comment:
How about using `AWS_ENDPOINT_URL` instead of `AWS_ENDPOINT` because
aws-sdk-cpp will support `AWS_ENDPOINT_URL`
https://github.com/aws/aws-sdk-cpp/issues/2587 ?
(How about accepting `AWS_ENDPOINT_URL` in arrow-rs too?)
##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -127,6 +127,7 @@ using internal::ToAwsString;
using internal::ToURLEncodedAwsString;
static const char kSep = '/';
+constexpr char kDefaultEndpointEnvVar[] = "AWS_ENDPOINT";
Review Comment:
Could you use the same name for constant name?
For example, `kAwsEndpointEnvVar` for this case.
##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -337,6 +338,10 @@ Result<S3Options> S3Options::FromUri(const Uri& uri,
std::string* out_path) {
} else {
options.ConfigureDefaultCredentials();
}
+ auto endpoint_env = arrow::internal::GetEnvVar(kDefaultEndpointEnvVar);
+ if(endpoint_env.ok()) {
+ options.endpoint_override = endpoint_env.MoveValueUnsafe();
Review Comment:
Can we simplify this?
```suggestion
options.endpoint_override = *endpoint_env;
```
--
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]