liukun4515 commented on code in PR #4400:
URL: https://github.com/apache/arrow-datafusion/pull/4400#discussion_r1035493777


##########
datafusion/sql/src/utils.rs:
##########
@@ -522,9 +522,12 @@ pub(crate) fn make_decimal_type(
     };
 
     // Arrow decimal is i128 meaning 38 maximum decimal digits
-    if precision == 0 || precision > DECIMAL128_MAX_PRECISION || scale > 
precision {
+    if precision == 0
+        || precision > DECIMAL128_MAX_PRECISION
+        || scale.unsigned_abs() > precision
+    {
         Err(DataFusionError::Internal(format!(
-            "Decimal(precision = {}, scale = {}) should satisty `0 < precision 
<= 38`, and `scale <= precision`.",
+            "Decimal(precision = {}, scale = {}) should satisfy `-38 < 
precision <= 38`, and `scale <= precision`.",

Review Comment:
   the same issue.



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