-
Notifications
You must be signed in to change notification settings - Fork 305
feat(catalog): Implement update_table for GlueCatalog #1584
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
@@ -367,3 +368,69 @@ async fn test_list_namespace() -> Result<()> { | |||
|
|||
Ok(()) | |||
} | |||
|
|||
#[tokio::test] | |||
async fn test_update_table() -> Result<()> { |
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 there be tests for non-happy paths?
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 this is a good point, but I didn't test conflicts, because currently it's tricky to forge conflicts that are non-retryable without more complicated transaction actions like overwrite or rewrite
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.
there isn't a way to mock the response?
crates/catalog/glue/src/catalog.rs
Outdated
.with_retryable(true), | ||
_ => Error::new( | ||
ErrorKind::Unexpected, | ||
"Operation failed for hitting aws sdk error", |
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.
include table name here for completeness?
crates/catalog/glue/src/catalog.rs
Outdated
.with_retryable(true), | ||
_ => Error::new( | ||
ErrorKind::Unexpected, | ||
"Operation failed for hitting aws sdk error", |
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.
"Operation failed for hitting aws sdk error", | |
"Operation failed for hitting AWS SDK error", |
nit
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 the current convention is to use lower case for aws sdk-related messaged across glue and s3table's implementations, and this should be fixed in a separate PR if needed
"Operation failed for hitting aws sdk error", | ||
), | ||
} | ||
.with_source(anyhow!("aws sdk error: {:?}", error)) |
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.
.with_source(anyhow!("aws sdk error: {:?}", error)) | |
.with_source(anyhow!("AWS SDK error: {:?}", error)) |
nit
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 @CTTY for this pr!
## Which issue does this PR close? - Addresses the Glue part of apache#1389 ## What changes are included in this PR? - Implemented `update_table` for `GlueCatalog` - Added test for `GlueCatalog::update_table` - Fixed exception type in `RestCatalog` - Fixed a typo in `ErrorKind` ## Are these changes tested? added a test
Which issue does this PR close?
What changes are included in this PR?
update_table
forGlueCatalog
GlueCatalog::update_table
RestCatalog
ErrorKind
Are these changes tested?
added a test