Class/Object

org.apache.spark.sql.types

Decimal

Related Docs: object Decimal | package types

Permalink

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)

Annotations
@Unstable()
Source
Decimal.scala
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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Decimal()

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
  4. def *(that: Decimal): Decimal

    Permalink
  5. def +(that: Decimal): Decimal

    Permalink
  6. def -(that: Decimal): Decimal

    Permalink
  7. def /(that: Decimal): Decimal

    Permalink
  8. def <(that: Decimal): Boolean

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

    Permalink
    Definition Classes
    Ordered
  10. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def >(that: Decimal): Boolean

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

    Permalink
    Definition Classes
    Ordered
  13. def abs: Decimal

    Permalink
  14. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  15. def ceil: Decimal

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

    Permalink
  17. def changePrecision(precision: Int, scale: Int): Boolean

    Permalink

    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

  18. def clone(): Decimal

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

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

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

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

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

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

    Permalink
  25. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  28. def isZero: Boolean

    Permalink
  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. def precision: Int

    Permalink
  33. def remainder(that: Decimal): Decimal

    Permalink
  34. def scale: Int

    Permalink
  35. def set(decimal: Decimal): Decimal

    Permalink

    Set this Decimal to the given Decimal value.

  36. def set(bigintval: BigInteger): Decimal

    Permalink

    Set this Decimal to the given BigInteger value.

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

  37. def set(decimal: BigDecimal): Decimal

    Permalink

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

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

    Permalink

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

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

    Permalink

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

  40. def set(intVal: Int): Decimal

    Permalink

    Set this Decimal to the given Int.

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

  41. def set(longVal: Long): Decimal

    Permalink

    Set this Decimal to the given Long.

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

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

    Permalink

    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.

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

    Permalink
    Definition Classes
    AnyRef
  44. def toBigDecimal: BigDecimal

    Permalink
  45. def toByte: Byte

    Permalink
  46. def toDebugString: String

    Permalink
  47. def toDouble: Double

    Permalink
  48. def toFloat: Float

    Permalink
  49. def toInt: Int

    Permalink
  50. def toJavaBigDecimal: BigDecimal

    Permalink
  51. def toJavaBigInteger: BigInteger

    Permalink
  52. def toLong: Long

    Permalink
  53. def toScalaBigInt: BigInt

    Permalink
  54. def toShort: Short

    Permalink
  55. def toString(): String

    Permalink
    Definition Classes
    Decimal → AnyRef → Any
  56. def toUnscaledLong: Long

    Permalink
  57. def unary_-: Decimal

    Permalink
  58. final def wait(): Unit

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

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

    Permalink
    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