NobiGo commented on code in PR #3945:
URL: https://github.com/apache/calcite/pull/3945#discussion_r1768928916
##########
core/src/test/java/org/apache/calcite/test/CustomRelDataTypeSystem.java:
##########
@@ -23,18 +23,42 @@
/**
* Custom type system only for Quidem test.
- *
- * <p> Specify the rounding behaviour. In the default implementation,
- * the rounding mode is {@link RoundingMode#DOWN}, but here is {@link
RoundingMode#HALF_UP}
- *
- * <p>The default implementation is {@link #DEFAULT}.
*/
-public class CustomRelDataTypeSystem extends RelDataTypeSystemImpl {
-
- public static final RelDataTypeSystem ROUNDING_MODE_HALF_UP = new
CustomRelDataTypeSystem();
+public final class CustomRelDataTypeSystem {
- @Override public RoundingMode roundingMode() {
- return RoundingMode.HALF_UP;
+ private CustomRelDataTypeSystem() {
}
+
+ /**
+ * Specify the rounding behaviour. In the default implementation,
+ * the rounding mode is {@link RoundingMode#DOWN}, but here is {@link
RoundingMode#HALF_UP}.
+ */
+ public static final RelDataTypeSystem ROUNDING_MODE_HALF_UP = new
RelDataTypeSystemImpl() {
+ @Override public RoundingMode roundingMode() {
+ return RoundingMode.HALF_UP;
+ }
+ };
+
+ /**
+ * Supports negative scale and rounding mode is {@link RoundingMode#DOWN}.
+ */
+ public static final RelDataTypeSystem NEGATIVE_SCALE = new
RelDataTypeSystemImpl() {
+ @Override public int getMinNumericScale() {
Review Comment:
Yes. Because In PostgreSQL this value is -1000. So I set -1000.
[1] https://www.postgresql.org/docs/current/datatype-numeric.html
--
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]