public void divideDestructive(Decimal128 right, short newScale) {
    HiveDecimal rightHD = HiveDecimal.create(right.toBigDecimal());
    HiveDecimal thisHD = HiveDecimal.create(this.toBigDecimal());
    HiveDecimal result = thisHD.divide(rightHD);

    /* If the result is null, throw an exception. This can be caught
     * by calling code in the vectorized code path and made to yield
     * a SQL NULL value.
     */
    if (result == null) {
      throw new ArithmeticException("null divide result");
    }
    this.update(result.bigDecimalValue().toPlainString(), newScale);
    this.unscaledValue.throwIfExceedsTenToThirtyEight();
  }
Divide the target object by right, and scale the result to newScale.

This uses HiveDecimal to get a correct answer with the same rounding
behavior as HiveDecimal, but it is expensive.

In the future, a native implementation could be faster.
common/src/java/org/apache/hadoop/hive/common/type/Decimal128.java