capkurmagati commented on a change in pull request #1394:
URL: https://github.com/apache/arrow-datafusion/pull/1394#discussion_r762506883



##########
File path: datafusion/src/scalar.rs
##########
@@ -453,6 +477,26 @@ macro_rules! eq_array_primitive {
 }
 
 impl ScalarValue {
+    /// Create a decimal Scalar from value/precision and scale.
+    pub fn try_new_decimal128(
+        value: i128,
+        precision: usize,
+        scale: usize,
+    ) -> Result<Self> {
+        // make sure the precision and scale is valid
+        // TODO const the max precision and min scale

Review comment:
       Just to make sure I got this correctly.
   The spec doesn't say anything about the the precision/scale of `DECIMAL`, 
but we're implementing `DECIMAL128` here so 38 should be the max precision.
   After https://github.com/apache/arrow-rs/issues/131 is implemented, we can 
implement `DECIMAL256` type in datafusion and the max precision will be 76.




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