HaoYang670 commented on code in PR #2357:
URL: https://github.com/apache/arrow-rs/pull/2357#discussion_r940108132


##########
arrow/src/array/array_decimal.rs:
##########
@@ -253,11 +253,15 @@ pub trait BasicDecimalArray<T: BasicDecimal, U: 
From<ArrayData>>:
     /// Returns a Decimal array with the same data as self, with the
     /// specified precision.
     ///
+    /// If make sure that all values in this array are not out of 
ranges/bounds with the specified precision,
+    /// please set `need_validation` to `false, otherwise set to `true`.
+    ///
     /// Returns an Error if:
     /// 1. `precision` is larger than [`Self::MAX_PRECISION`]
     /// 2. `scale` is larger than [`Self::MAX_SCALE`];
     /// 3. `scale` is > `precision`
-    fn with_precision_and_scale(self, precision: usize, scale: usize) -> 
Result<U>
+    /// 4. `need_validation` is `true`, but some values are out of 
ranges/bounds
+    fn with_precision_and_scale(self, precision: usize, scale: usize, 
need_validation: bool) -> Result<U>

Review Comment:
   `need_validation` is somewhat confused to me.
   Do we need to check the precision, or check the scale?
   



-- 
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]

Reply via email to