mbudiu-vmw commented on code in PR #3156:
URL: https://github.com/apache/calcite/pull/3156#discussion_r1169233493
##########
core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java:
##########
@@ -1776,8 +1776,9 @@ public static boolean isAtomic(RelDataType type) {
* type system. */
public static RelDataType getMaxPrecisionScaleDecimal(RelDataTypeFactory
factory) {
int maxPrecision = factory.getTypeSystem().getMaxNumericPrecision();
+ int maxScale = factory.getTypeSystem().getMaxNumericScale();
// scale should not greater than precision.
- int scale = maxPrecision / 2;
+ int scale = Math.min(maxPrecision / 2, maxScale);
Review Comment:
Personally I think that the choice of maxPrecision/2 is rather arbitrary,
but I didn't want to change too many things at once. This used to be maxScale,
and that should always be smaller than maxPrecision.
--
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]