MCPcopy Create free account
hub / github.com/apache/datafusion / get_object_store_builder

Function get_object_store_builder

datafusion-cli/src/object_storage.rs:265–290  ·  view source on GitHub ↗
(
    url: &Url,
    aws_options: &AwsOptions,
    virtual_hosted_style_request: bool,
)

Source from the content-addressed store, hash-verified

263}
264
265fn get_object_store_builder(
266 url: &Url,
267 aws_options: &AwsOptions,
268 virtual_hosted_style_request: bool,
269) -> Result<AmazonS3Builder> {
270 let bucket_name = get_bucket_name(url)?;
271 let mut builder = AmazonS3Builder::from_env()
272 .with_virtual_hosted_style_request(virtual_hosted_style_request)
273 .with_bucket_name(bucket_name)
274 // oss/cos don't care about the "region" field
275 .with_region("do_not_care");
276
277 if let (Some(access_key_id), Some(secret_access_key)) =
278 (&aws_options.access_key_id, &aws_options.secret_access_key)
279 {
280 builder = builder
281 .with_access_key_id(access_key_id)
282 .with_secret_access_key(secret_access_key);
283 }
284
285 if let Some(endpoint) = &aws_options.endpoint {
286 builder = builder.with_endpoint(endpoint);
287 }
288
289 Ok(builder)
290}
291
292pub fn get_gcs_object_store_builder(
293 url: &Url,

Callers 2

Calls 2

get_bucket_nameFunction · 0.85
from_envFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…