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

Fix S3 query canonicalization (#2800) #2801

Merged
merged 2 commits into from Sep 29, 2022

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Sep 28, 2022

Which issue does this PR close?

Closes #2800
Contains tests for #2799

Rationale for this change

I was lazy when implementing query canonicalization, and figured we could just use the query from the URL provided they were in the correct order. Sadly this is not the case as AWS has specific requirements for percent encoding.

What changes are included in this PR?

Implements request canonicalisation as per the spec

Are there any user-facing changes?

No

@github-actions github-actions bot added the object-store Object Store Interface label Sep 28, 2022
Comment on lines 705 to 717
let path = Path::parse("foo bar/I contain spaces.parquet").unwrap();
storage.put(&path, Bytes::from(vec![0, 1])).await.unwrap();
storage.head(&path).await.unwrap();
let files = flatten_list_stream(storage, Some(&Path::from("foo bar")))
.await
.unwrap();
assert_eq!(files, vec![path.clone()]);
storage.delete(&path).await.unwrap();

let files = flatten_list_stream(storage, Some(&Path::from("foo bar")))
.await
.unwrap();
assert!(files.is_empty(), "{:?}", files);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds an explicit test of paths containing spaces, FYI @andygrove

@tustvold
Copy link
Contributor Author

tustvold commented Sep 28, 2022

Looks like there are more yaks to shave 😭

Edit: So it would appear that both emulators don't handle this correctly... I guess this is why they all say not to stick spaces in paths, everything is broken 😆 I need to get on with some other stuff, but I will come back to this and file upstream tickets for this

@tustvold tustvold marked this pull request as ready for review September 28, 2022 17:11
@tustvold
Copy link
Contributor Author

I opted to suppress the broken emulators, instead of working around the issue, as they are bugs in the emulators. Running against the real services behaves correctly.

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tustvold

@tustvold tustvold merged commit da8f742 into apache:master Sep 29, 2022
@ursabot
Copy link

ursabot commented Sep 29, 2022

Benchmark runs are scheduled for baseline = f845d6e and contender = da8f742. da8f742 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object-store Object Store Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

S3 Signature Error Performing List With Prefix Containing Spaces
3 participants