cboettig commented on PR #33918:
URL: https://github.com/apache/arrow/pull/33918#issuecomment-1411487681

   Thanks for the discussion!  @amoeba I definitely agree with your point about 
higher-level function and breaking changes.  How is region guessing handled in 
arrow's other client interfaces (e.g. python?)  Is region resolution in the C++ 
level available with something other than FileSystem$from_uri?
   
   It seems to me that natural way forward here would be to access the region 
from a HEAD request, which seems to be the recommended mechanism at least on 
the REST API.  Doing this through the SDK is probably the preferable to a REST 
call, though I'm fuzzy on those details, maybe 
[this](https://sdk.amazonaws.com/cpp/api/LATEST/aws-cpp-sdk-s3/html/class_aws_1_1_s3_1_1_s3_request.html))
   
   
   
   ```r
   scheme = "https"
   endpoint_override = "s3.amazonaws.com"
   bucket = "ursa-labs-r-test"
   
   resp <- httr::HEAD(glue::glue("{scheme}://{endpoint_override}/{bucket}"))
   region <- resp$headers$`x-amz-bucket-region`
   ```
   
   It looks like the SDK is already built to handle those endpoint parameters 
appropriately (i.e. passed in, or inferred from a config file on env vars), 
which is obviously the right way to do it, not what I've sketched above.  Can 
you tell if there is a function in the AWS S3 C++ SDK that does this, just 
inspecting the bucket header to determine the region?


-- 
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]

Reply via email to