public static long setSignBitLong(long val, boolean positive) {
    if (positive) {
      return val & FULLBITS_63;
    }
    return val | NEGATIVE_LONG_MASK;
  }
Turn on or off the highest bit of a long value.

@param val
         the value to modify
@param positive
         whether to turn off (positive) or on (negative).
@return unsigned long value
common/src/java/org/apache/hadoop/hive/common/type/SqlMathUtil.java