-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support http s3 endpoints in datafusion-cli via CREATE EXTERNAL TABLE
#10080
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
e96add1 to
733b593
Compare
| secret_access_key, | ||
| session_token, | ||
| region, | ||
| endpoint, |
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.
One bug was that endpoint was not read here so I changes this to destructure the object so the compiler can check we don't forget fields
| } | ||
| _ => { | ||
| return internal_err!("Config value \"{}\" not found on AwsOptions", rem); | ||
| return config_err!("Config value \"{}\" not found on AwsOptions", rem); |
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.
drive by cleanup -- this is not an internal error
|
Whoops -- closed by accident |
| pub region: Option<String>, | ||
| /// OSS or COS Endpoint | ||
| pub endpoint: Option<String>, | ||
| /// Allow HTTP (otherwise will always use https) |
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.
BTW I found the reworked configuration option system that @metesynnada added in #9382 really nice to work with ❤️
CREATE EXTERNAL TABLE
metesynnada
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.
LGTM!
andygrove
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.
LGTM. Thanks @alamb
| .await | ||
| .unwrap_err(); | ||
|
|
||
| assert_eq!(err.to_string(), "Invalid or Unsupported Configuration: Invalid endpoint: http://endpoint33. HTTP is not allowed for S3 endpoints. To allow HTTP, set 'aws.allow_http' to 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.
should we also test with aws.allow_http enabled?
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.
I think I added that test below (demonstrate it doesn't error)
| return config_err!( | ||
| "Invalid endpoint: {endpoint}. \ | ||
| HTTP is not allowed for S3 endpoints. \ | ||
| To allow HTTP, set 'aws.allow_http' to 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.
❤️
|
Thanks everyone for the reviews ❤️ |
Which issue does this PR close?
closes #10072
Rationale for this change
See #10072
Basically I want to be able to do:
What changes are included in this PR?
Are these changes tested?
aws.endpointas a config optionAre there any user-facing changes?
Can use http endpoints now