HiveDecimalWritable (Hive Storage API 2.1.1-pre-orc API)
Date: 2016-10-19

org.apache.hadoop.hive.serde2.io

## Class HiveDecimalWritable

- java.lang.Object
- - org.apache.hadoop.hive.serde2.io.HiveDecimalWritable

- All Implemented Interfaces:
    Comparable<HiveDecimalWritable>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<HiveDecimalWritable>

      public class HiveDecimalWritable
      extends Object
      implements org.apache.hadoop.io.WritableComparable<HiveDecimalWritable>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HiveDecimalWritable()`
    `HiveDecimalWritable(byte[] bytes, int scale)`
    `HiveDecimalWritable(HiveDecimal value)`
    `HiveDecimalWritable(HiveDecimalWritable writable)`
    `HiveDecimalWritable(long value)`
    `HiveDecimalWritable(String value)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(HiveDecimalWritable that)`
    `static HiveDecimalWritable` | `enforcePrecisionScale(HiveDecimalWritable writable, int precision, int scale)`
    `boolean` | `equals(Object other)`
    `HiveDecimal` | `getHiveDecimal()`
    `HiveDecimal` | `getHiveDecimal(int maxPrecision, int maxScale)` Get a HiveDecimal instance from the writable and constraint it with maximum precision/scale.
    `byte[]` | `getInternalStorage()`
    `int` | `getScale()`
    `int` | `hashCode()`
    `void` | `readFields(DataInput in)`
    `void` | `set(byte[] bytes, int scale)`
    `void` | `set(HiveDecimal value)`
    `void` | `set(HiveDecimal value, int maxPrecision, int maxScale)`
    `void` | `set(HiveDecimalWritable writable)`
    `String` | `toString()`
    `void` | `write(DataOutput out)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### HiveDecimalWritable

          public HiveDecimalWritable()

    - #### HiveDecimalWritable

          public HiveDecimalWritable(String value)

    - #### HiveDecimalWritable

          public HiveDecimalWritable(byte[] bytes,
                                     int scale)

    - #### HiveDecimalWritable

          public HiveDecimalWritable(HiveDecimalWritable writable)

    - #### HiveDecimalWritable

          public HiveDecimalWritable(HiveDecimal value)

    - #### HiveDecimalWritable

          public HiveDecimalWritable(long value)

  - ### Method Detail

    - #### set

          public void set(HiveDecimal value)

    - #### set

          public void set(HiveDecimal value,
                          int maxPrecision,
                          int maxScale)

    - #### set

          public void set(HiveDecimalWritable writable)

    - #### set

          public void set(byte[] bytes,
                          int scale)

    - #### getHiveDecimal

          public HiveDecimal getHiveDecimal()

    - #### getHiveDecimal

          public HiveDecimal getHiveDecimal(int maxPrecision,
                                            int maxScale)

      Get a HiveDecimal instance from the writable and constraint it with maximum precision/scale.
      Parameters:
        `maxPrecision` - maximum precision
        `maxScale` - maximum scale
      Returns:
        HiveDecimal instance

    - #### readFields

          public void readFields(DataInput in)
                          throws IOException

      Specified by:
        `readFields` in interface `org.apache.hadoop.io.Writable`
      Throws:
        `IOException`

    - #### write

          public void write(DataOutput out)
                     throws IOException

      Specified by:
        `write` in interface `org.apache.hadoop.io.Writable`
      Throws:
        `IOException`

    - #### compareTo

          public int compareTo(HiveDecimalWritable that)

      Specified by:
        `compareTo` in interface `Comparable<HiveDecimalWritable>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getInternalStorage

          public byte[] getInternalStorage()

    - #### getScale

          public int getScale()

    - #### enforcePrecisionScale

          public static HiveDecimalWritable enforcePrecisionScale(HiveDecimalWritable writable,
                                                                  int precision,
                                                                  int scale)

Copyright © 2016 The Apache Software Foundation. All rights reserved.