liukun4515 commented on code in PR #2405:
URL: https://github.com/apache/arrow-rs/pull/2405#discussion_r943050808
##########
arrow/src/util/decimal.rs:
##########
@@ -114,17 +113,17 @@ impl<const BYTE_WIDTH: usize> BasicDecimal<BYTE_WIDTH> {
/// Creates a decimal value from precision, scale, and bytes.
///
/// Safety:
- /// This method doesn't check if the length of bytes is compatible with
this decimal.
+ /// This method doesn't check if the precision and scale are valid.
/// Use `try_new_from_bytes` for safe constructor.
- pub fn new(precision: usize, scale: usize, bytes: &[u8]) -> Self {
+ pub fn new(precision: usize, scale: usize, bytes: &[u8; BYTE_WIDTH]) ->
Self {
Review Comment:
From the discussion https://github.com/apache/arrow-rs/issues/2387, we have
not come to a consistent conclusion. It better not to change the API?
Do you agree that?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]