-
Notifications
You must be signed in to change notification settings - Fork 343
Support deserializing bytes #1820
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
base: main
Are you sure you want to change the base?
Conversation
|
I will review this tomorrow. |
mbutrovich
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.
Just one minor comment, but this otherwise looks good to me. Thank you @Fokko!
Thank you for the test cases too!
liurenjie1024
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.
Thanks @Fokko for this pr!
crates/iceberg/src/spec/values.rs
Outdated
| Type::decimal_required_bytes(*precision).map_err(|e| { | ||
| invalid_err_with_reason( | ||
| "bytes", | ||
| &format!("Invalid decimal precision: {}", 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.
I think this error message is reduntant and will hide error message from decimal_required_bytes
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.
Good one 👍
| )) | ||
| } | ||
| } | ||
| _ => Err(invalid_err("bytes")), |
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.
It would be better to include target type in the error message.
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 I'm missing it, but I think this is in line with the other branches, for example, list:
iceberg-rust/crates/iceberg/src/spec/values.rs
Line 2846 in 76d8e2d
| _ => Err(invalid_err("list")), |
This then gets formatted in a nice message:
iceberg-rust/crates/iceberg/src/spec/values.rs
Lines 2619 to 2626 in 76d8e2d
| let invalid_err = |v: &str| { | |
| Error::new( | |
| ErrorKind::DataInvalid, | |
| format!( | |
| "Unable to convert raw literal ({v}) fail convert to type {ty} for: type mismatch" | |
| ), | |
| ) | |
| }; |
Which issue does this PR close?
What changes are included in this PR?
Are these changes tested?