Class DecimalType

Object
io.delta.kernel.types.DataType
io.delta.kernel.types.DecimalType

@Evolving public final class DecimalType extends DataType
The data type representing java.math.BigDecimal values. A Decimal that must have fixed precision (the maximum number of digits) and scale (the number of digits on right side of dot).

The precision can be up to 38, scale can also be up to 38 (less or equal to precision).

The default precision and scale is (10, 0).

Since:
3.0.0
  • Field Details

    • USER_DEFAULT

      public static final DecimalType USER_DEFAULT
  • Constructor Details

    • DecimalType

      public DecimalType(int precision, int scale)
  • Method Details

    • getPrecision

      public int getPrecision()
      Returns:
      the maximum number of digits of the decimal
    • getScale

      public int getScale()
      Returns:
      the number of digits on the right side of the decimal point (dot)
    • toJson

      public String toJson()
      Description copied from class: DataType
      Convert the data type to Delta protocol specified serialization format.
      Specified by:
      toJson in class DataType
      Returns:
      Data type serialized in JSON format.
    • toString

      public String toString()
      Specified by:
      toString in class DataType
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in class DataType
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class DataType