All Implemented Interfaces:
Serializable, scala.Equals, scala.Product

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).

Please use DataTypes.createDecimalType() to create a specific instance.

Since:
1.3.0
See Also:
  • Constructor Details

    • DecimalType

      public DecimalType(int precision, int scale)

    • DecimalType

      public DecimalType(int precision)

    • DecimalType

      public DecimalType()

  • Method Details

    • MAX_PRECISION

      public static int MAX_PRECISION()

    • MAX_SCALE

      public static int MAX_SCALE()

    • DEFAULT_SCALE

      public static int DEFAULT_SCALE()

    • SYSTEM_DEFAULT

    • USER_DEFAULT

    • MINIMUM_ADJUSTED_SCALE

      public static int MINIMUM_ADJUSTED_SCALE()

    • is32BitDecimalType

      public static boolean is32BitDecimalType(DataType dt)

      Returns if dt is a DecimalType that fits inside an int

      Parameters:
      dt - (undocumented)
      Returns:
      (undocumented)
    • is64BitDecimalType

      public static boolean is64BitDecimalType(DataType dt)

      Returns if dt is a DecimalType that fits inside a long

      Parameters:
      dt - (undocumented)
      Returns:
      (undocumented)
    • isByteArrayDecimalType

      public static boolean isByteArrayDecimalType(DataType dt)

      Returns if dt is a DecimalType that doesn't fit inside a long

      Parameters:
      dt - (undocumented)
      Returns:
      (undocumented)
    • unapply

      public static boolean unapply(DataType t)

    • precision

      public int precision()

    • scale

      public int scale()

    • typeName

      Description copied from class: DataType

      Name of the type used in JSON serialization.

      Overrides:
      typeName in class DataType
    • toString

      Overrides:
      toString in class Object
    • sql

      Overrides:
      sql in class DataType
    • defaultSize

      public int defaultSize()

      The default size of a value of the DecimalType is 8 bytes when precision is at most 18, and 16 bytes otherwise.

      Specified by:
      defaultSize in class DataType
      Returns:
      (undocumented)
    • simpleString

      public String simpleString()