julianhyde commented on code in PR #3945:
URL: https://github.com/apache/calcite/pull/3945#discussion_r1769235062
##########
core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystem.java:
##########
@@ -62,6 +64,14 @@ public interface RelDataTypeSystem {
/** Returns the maximum precision of a NUMERIC or DECIMAL type. */
int getMaxNumericPrecision();
+ /** Returns the minimum scale of a NUMERIC or DECIMAL type. */
+ int getMinNumericScale();
Review Comment:
We should be explicit in the javadoc.
`getMaxScale(SqlTypeName)` seems to return `RelDataType.SCALE_NOT_SPECIFIED`
(Integer.MIN_VALUE) for any data type that does not support scale. Can you
amend its javadoc to state this?
The javadoc for `getMinScale(SqlTypeName)` should state its behavior for
types that do not support scale. I propose `Integer.MAX_VALUE`.
The javadoc for `getMinScale(SqlTypeName)` should also say that the default
type system returns 0 for `DECIMAL` and interval types. I know it's an
interface, but interfaces can and should say what the default or typical
behavior is.
I guess you should change `supportsNegativeScale()` to
`supportsNegativeScale(SqlTypeName)`, and remove `getMinNumericScale()`.
--
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]