ZhangHuiGui commented on code in PR #40434:
URL: https://github.com/apache/arrow/pull/40434#discussion_r1525896957
##########
cpp/src/gandiva/decimal_type_util.cc:
##########
@@ -29,8 +29,11 @@ constexpr int32_t DecimalTypeUtil::kMinAdjustedScale;
}
// Implementation of decimal rules.
+// In addition to having a precision beyond 38, it is compatible with
+// **Redshift's decimal promotion rules** if enable use_redshift_rules.
Review Comment:
Yes, done.
##########
cpp/src/gandiva/decimal_type_util.cc:
##########
@@ -59,7 +62,8 @@ Status DecimalTypeUtil::GetResultType(Op op, const
Decimal128TypeVector& in_type
break;
case kOpDivide:
- result_scale = std::max(kMinAdjustedScale, s1 + p2 + 1);
+ result_scale = use_redshift_rules ? std::max(4, s1 + p2 - s2 + 1)
Review Comment:
done
--
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]