Package org.apache.calcite.test
Class CustomTypeSystems
java.lang.Object
org.apache.calcite.test.CustomTypeSystems
Custom implementations of
RelDataTypeSystem for testing.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RelDataTypeSystemType system that supports negative scale and has rounding modeRoundingMode.DOWN.static final RelDataTypeSystemType system that supports negative scale and has rounding modeRoundingMode.HALF_UP.static final RelDataTypeSystemType system with rounding behaviorRoundingMode.HALF_UP.static final RelDataTypeSystemType system that similar to Spark. -
Method Summary
Modifier and TypeMethodDescriptionstatic RelDataTypeSystemwithMaxPrecision(RelDataTypeSystem typeSystem, Function<SqlTypeName, Integer> maxPrecision) Decorates a type system so thatRelDataTypeSystem.getMaxPrecision(SqlTypeName)returns a given value.static RelDataTypeSystemwithMaxScale(RelDataTypeSystem typeSystem, Function<SqlTypeName, Integer> maxScale) Decorates a type system so thatRelDataTypeSystem.getMaxScale(SqlTypeName)returns a given value.static RelDataTypeSystemwithMinScale(RelDataTypeSystem typeSystem, Function<SqlTypeName, Integer> minNumericScale) Decorates a type system so thatRelDataTypeSystem.getMinScale(SqlTypeName)returns a given value.static RelDataTypeSystemwithRoundingMode(RelDataTypeSystem typeSystem, RoundingMode roundingMode) Decorates a type system so thatRelDataTypeSystem.roundingMode()returns a given value.
-
Field Details
-
ROUNDING_MODE_HALF_UP
Type system with rounding behaviorRoundingMode.HALF_UP. (The default implementation isRoundingMode.DOWN.) -
NEGATIVE_SCALE
Type system that supports negative scale and has rounding modeRoundingMode.DOWN. -
NEGATIVE_SCALE_ROUNDING_MODE_HALF_UP
Type system that supports negative scale and has rounding modeRoundingMode.HALF_UP. -
SPARK_TYPE_SYSTEM
Type system that similar to Spark.
-
-
Method Details
-
withRoundingMode
public static RelDataTypeSystem withRoundingMode(RelDataTypeSystem typeSystem, RoundingMode roundingMode) Decorates a type system so thatRelDataTypeSystem.roundingMode()returns a given value. -
withMaxPrecision
public static RelDataTypeSystem withMaxPrecision(RelDataTypeSystem typeSystem, Function<SqlTypeName, Integer> maxPrecision) Decorates a type system so thatRelDataTypeSystem.getMaxPrecision(SqlTypeName)returns a given value. -
withMaxScale
public static RelDataTypeSystem withMaxScale(RelDataTypeSystem typeSystem, Function<SqlTypeName, Integer> maxScale) Decorates a type system so thatRelDataTypeSystem.getMaxScale(SqlTypeName)returns a given value. -
withMinScale
public static RelDataTypeSystem withMinScale(RelDataTypeSystem typeSystem, Function<SqlTypeName, Integer> minNumericScale) Decorates a type system so thatRelDataTypeSystem.getMinScale(SqlTypeName)returns a given value.
-