Skip to content

virtual_hosted_style_request bad calculation #2802

@ahelmihudhud

Description

@ahelmihudhud

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions