caicancai commented on code in PR #3919:
URL: https://github.com/apache/calcite/pull/3919#discussion_r1720868477
##########
core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystem.java:
##########
@@ -297,6 +297,7 @@ default boolean
shouldUseDoubleMultiplication(RelDataTypeFactory typeFactory,
int six = Math.min(6, getMaxNumericScale());
int d = p1 - s1 + s2;
int scale = Math.max(six, s1 + p2 + 1);
+ scale = Math.min(scale, getMaxNumericScale());
Review Comment:
I don't quite understand the rules, but I see some paradoxes.
Assume the following scenario.
```
six = Math.min(6, getMaxNumericScale()) = getMaxNumericScale()
scale = Math.max(six, s1 + p2 + 1) = six = getMaxNumericScale()
scale = Math.min(scale, getMaxNumericScale()) = getMaxNumericScale()
```
Is this a repeated judgment?
So remove six = Math.min(6, getMaxNumericScale()) ?
--
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]