Skip to content

Commit

Permalink
[C++] Use custom endpoint for s3 using AWS_ENDPOINT
Browse files Browse the repository at this point in the history
  • Loading branch information
yiwei.wang committed Jul 20, 2023
1 parent f9d8edd commit 7e0db12
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpp/src/arrow/filesystem/s3fs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ using internal::ToAwsString;
using internal::ToURLEncodedAwsString;

static const char kSep = '/';
constexpr char kDefaultEndpointEnvVar[] = "AWS_ENDPOINT";

// -----------------------------------------------------------------------
// S3ProxyOptions implementation
Expand Down Expand Up @@ -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();
}

bool region_set = false;
for (const auto& kv : options_map) {
Expand Down

0 comments on commit 7e0db12

Please sign in to comment.