Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support full paths instead of only file-names in sidecar actions's path field #675

Open
sebastiantia opened this issue Feb 3, 2025 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@sebastiantia
Copy link
Collaborator

Please describe why this is necessary.

Currently, the path field in sidecar actions only supports file names (without the scheme or parent directories). This limitation prevents the use of full URIs in the path, which implementations of delta may choose to use based on the PROTOCOL.

This change is necessary to support tables that have the v2Checkpoint reader/writer feature enabled with sidecar action path's that use file paths instead of the file name.

Describe the functionality you are proposing.

Parse the sidecar action path field (which may be a full file-path) for the file name as all sidecars should live in _delta_log/_sidecar.

Include tests.

Additional context

No response

@scovich
Copy link
Collaborator

scovich commented Feb 4, 2025

Wouldn't this be as simple as unconditionally calling Url::join, with the sidecar directory as the base and the sidecar.path as the input?

An absolute URL (with a scheme) as input replaces the whole base URL (even the scheme).

(seems like we anyway have to do that at some point, if we actually want to read the sidecar file??)

@OussamaSaoudi
Copy link
Collaborator

@scovich nice find! I was just able to verify it:

    let base = Url::parse("https://bucket-name.com/path/to/file/").unwrap();
    let url = "https://bucket-name.com/path/to/file/_sidecar/14567842.parquet";
    println!("{:?}", base.join(url).unwrap().to_string());

prints

https://bucket-name.com/path/to/file/_sidecar/14567842.parquet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants