apache / apache/datafusion-comet

virtual_hosted_style_request bad calculation

Open
#2,802 0 comments 0 reactions 0 assignees View on GitHub
bug priority:medium
Dominant language
Scala
Stars
1.3k
Forks
373
Avg merge
2d 6h
Merged PRs (30d)
190

Description

### Describe the bug

while setting the connection to S3 in (native/core/src/parquet/objectstore/s3.rs)
a mistake is being made in calculating `virtual_hosted_style_request`
which causes the connection to use a combination of path style and virtual hosted style.

```
virtual_hosted_style_request = path_style.to_lowercase() == "true";
s3_configs.insert(
AmazonS3ConfigKey::VirtualHostedStyleRequest,
virtual_hosted_style_request.to_string(),
);
```

```
if virtual_hosted_style_request {
if endpoint.ends_with("/") {
Some(format!("{endpoint}{bucket}"))
} else {
Some(format!("{endpoint}/{bucket}"))
}
} else {
Some(endpoint) // Avoid extra to_string() call since endpoint is already a String
}
```

### Steps to reproduce

_No response_

### Expected behavior

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.