-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support datafusion-cli access to public S3 buckets that do not require authentication #16300
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
Conversation
| builder = builder.with_credentials(credentials); | ||
| } else { | ||
| debug!("No credentials found, defaulting to skip signature "); | ||
| builder = builder.with_skip_signature(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this changes the default so we don't try and create a signature if no credentials can be extracted
| "allow_http" => { | ||
| self.allow_http.set(rem, value)?; | ||
| } | ||
| "skip_signature" | "nosign" => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is support for passing through skip_signature
| ) LOCATION '{location}'" | ||
| ); | ||
|
|
||
| let ctx = SessionContext::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this with whitespace blind diff https://github.com/apache/datafusion/pull/16300/files?w=1
makes it easier to see what is happening
Specifically, I just refactored the parsing / table_options extraction into a separate function to reduce repetition.
Otherwise the existing tests are the same
blaginin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌🏻
datafusion-cli/src/object_storage.rs
Outdated
| // we can call `provide_credentials` here. | ||
| let credentials = match credentials.provide_credentials().await { | ||
| Ok(_) => Some(credentials), | ||
| Err(e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: does it make sense to expect specific errors? For example, for CredentialsError::InvalidConfiguration or InvalidConfiguration::ProviderTimedOut, we probably still want to raise since those mean the creds could be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a great idea -- fixed in 37d1132
Co-authored-by: Dmitrii Blaginin <[email protected]>
|
Thanks @blaginin ! |
|
There appears to be some problem with this code in PR:
|
Which issue does this PR close?
datafusion-cliaccess to public S3 buckets that do not require authentication #16299Rationale for this change
I want to be able to access public s3 buckets without providing (valid) s3 credentials
What changes are included in this PR?
skip_signatureoption todatafusion-cliCREATE EXTERNAL TABLEskip_signaturewhen other credentials are not providedBefore this PR:
After this PR:
Are these changes tested?
Yes, new unit tests are added and I tested it manually
For example, if you provide credentials, they take precidence over the signature:
But you can override this with
SKIP_SIGNATUREAre there any user-facing changes?
Easier to use
datafusion-cli