-
Notifications
You must be signed in to change notification settings - Fork 159
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
feat: Bump hive_metastore to use pure rust thrift impl volo
#174
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,13 +15,28 @@ | |
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
use anyhow::anyhow; | ||
use iceberg::{Error, ErrorKind}; | ||
use std::fmt::Debug; | ||
use std::io; | ||
|
||
/// Format a thrift error into iceberg error. | ||
pub fn from_thrift_error(error: thrift::Error) -> Error { | ||
pub fn from_thrift_error<T>(error: volo_thrift::error::ResponseError<T>) -> Error | ||
where | ||
T: Debug, | ||
{ | ||
Error::new( | ||
ErrorKind::Unexpected, | ||
"operation failed for hitting thrift error".to_string(), | ||
) | ||
.with_source(anyhow!("thrift error: {:?}", error)) | ||
} | ||
|
||
/// Format an io error into iceberg error. | ||
pub fn from_io_error(error: io::Error) -> Error { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if moving to core and making it a public API is a good idea. What if we address this once we have the same |
||
Error::new( | ||
ErrorKind::Unexpected, | ||
"operation failed for hitting io error".to_string(), | ||
) | ||
.with_source(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.
Maybe it's better to make this a config?
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 agree we should make this setting available to users, though I believe it's a lower priority. I've created an issue at #188 to keep track of this.