// Example: 0.00123
// Sign is 3 (bigger than 0)
// Factor is -2 (move decimal point 2 positions right)
// Digits are: 123
HiveDecimalObjectInspector boi = (HiveDecimalObjectInspector) poi;
HiveDecimal dec = boi.getPrimitiveJavaObject(o);
// get the sign of the big decimal
int sign = dec.compareTo(HiveDecimal.ZERO);
// we'll encode the absolute value (sign is separate)