org.apache.spark.sql.types

Decimal

final class Decimal extends Ordered[Decimal] with Serializable

A mutable implementation of BigDecimal that can hold a Long if values are small enough.

The semantics of the fields are as follows: - _precision and _scale represent the SQL precision and scale we are looking for - If decimalVal is set, it represents the whole decimal value - Otherwise, the decimal value is longVal / (10 ** _scale)

Linear Supertypes
Serializable, Serializable, Ordered[Decimal], Comparable[Decimal], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Decimal
  2. Serializable
  3. Serializable
  4. Ordered
  5. Comparable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Decimal()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def %(that: Decimal): Decimal

  5. def *(that: Decimal): Decimal

  6. def +(that: Decimal): Decimal

  7. def -(that: Decimal): Decimal

  8. def /(that: Decimal): Decimal

  9. def <(that: Decimal): Boolean

    Definition Classes
    Ordered
  10. def <=(that: Decimal): Boolean

    Definition Classes
    Ordered
  11. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  13. def >(that: Decimal): Boolean

    Definition Classes
    Ordered
  14. def >=(that: Decimal): Boolean

    Definition Classes
    Ordered
  15. def abs: Decimal

  16. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  17. def ceil: Decimal

  18. def changePrecision(precision: Int, scale: Int, mode: Int): Boolean

  19. def changePrecision(precision: Int, scale: Int): Boolean

    Update precision and scale while keeping our value the same, and return true if successful.

    Update precision and scale while keeping our value the same, and return true if successful.

    returns

    true if successful, false if overflow would occur

  20. def clone(): Decimal

    Definition Classes
    Decimal → AnyRef
  21. def compare(other: Decimal): Int

    Definition Classes
    Decimal → Ordered
  22. def compareTo(that: Decimal): Int

    Definition Classes
    Ordered → Comparable
  23. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def equals(other: Any): Boolean

    Definition Classes
    Decimal → AnyRef → Any
  25. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def floor: Decimal

  27. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  28. def hashCode(): Int

    Definition Classes
    Decimal → AnyRef → Any
  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. def isZero: Boolean

  31. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  32. final def notify(): Unit

    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  34. def precision: Int

  35. def remainder(that: Decimal): Decimal

  36. def scale: Int

  37. def set(decimal: Decimal): Decimal

    Set this Decimal to the given Decimal value.

  38. def set(bigintval: BigInteger): Decimal

    Set this Decimal to the given BigInteger value.

    Set this Decimal to the given BigInteger value. Will have precision 38 and scale 0.

  39. def set(decimal: BigDecimal): Decimal

    Set this Decimal to the given BigDecimal value, inheriting its precision and scale.

  40. def set(decimal: BigDecimal, precision: Int, scale: Int): Decimal

    Set this Decimal to the given BigDecimal value, with a given precision and scale.

  41. def set(unscaled: Long, precision: Int, scale: Int): Decimal

    Set this Decimal to the given unscaled Long, with a given precision and scale.

  42. def set(intVal: Int): Decimal

    Set this Decimal to the given Int.

    Set this Decimal to the given Int. Will have precision 10 and scale 0.

  43. def set(longVal: Long): Decimal

    Set this Decimal to the given Long.

    Set this Decimal to the given Long. Will have precision 20 and scale 0.

  44. def setOrNull(unscaled: Long, precision: Int, scale: Int): Decimal

    Set this Decimal to the given unscaled Long, with a given precision and scale, and return it, or return null if it cannot be set due to overflow.

  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  46. def toBigDecimal: BigDecimal

  47. def toByte: Byte

  48. def toDebugString: String

    Annotations
    @DeveloperApi()
  49. def toDouble: Double

  50. def toFloat: Float

  51. def toInt: Int

  52. def toJavaBigDecimal: BigDecimal

  53. def toJavaBigInteger: BigInteger

  54. def toLong: Long

  55. def toScalaBigInt: BigInt

  56. def toShort: Short

  57. def toString(): String

    Definition Classes
    Decimal → AnyRef → Any
  58. def toUnscaledLong: Long

  59. def unary_-: Decimal

  60. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Ordered[Decimal]

Inherited from Comparable[Decimal]

Inherited from AnyRef

Inherited from Any

Ungrouped