Package org.apache.sqoop.lib
Class BigDecimalSerializer
- java.lang.Object
-
- org.apache.sqoop.lib.BigDecimalSerializer
-
public final class BigDecimalSerializer extends java.lang.ObjectSerialize BigDecimal classes to/from DataInput and DataOutput objects. BigDecimal is comprised of a BigInteger with an integer 'scale' field. The BigDecimal/BigInteger can also return itself as a 'long' value. We serialize in one of two formats: First, check whether the BigInt can fit in a long: boolean b = BigIntegerPart > LONG_MAX || BigIntegerPart < LONG_MIN [int: scale][boolean: b == false][long: BigInt-part] [int: scale][boolean: b == true][string: BigInt-part.toString()] TODO(aaron): Get this to work with Hadoop's Serializations framework.
-
-
Field Summary
Fields Modifier and Type Field Description static java.math.BigIntegerLONG_MAX_AS_BIGINTstatic java.math.BigIntegerLONG_MIN_AS_BIGINT
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.math.BigDecimalreadFields(java.io.DataInput in)static voidwrite(java.math.BigDecimal d, java.io.DataOutput out)
-