code: private static BigDecimal convertBinaryToDecimal(Binary value, int precision, int scale)
    {
      // based on parquet-mr pig conversion which is based on spark conversion... yo dawg?
      if (precision <= 18) {
        ByteBuffer buffer = value.toByteBuffer();
        byte[] bytes = buffer.array();
        int start = buffer.arrayOffset() + buffer.position();
        int end = buffer.arrayOffset() + buffer.limit();
        long unscaled = 0L;
        int i = start;
        while (i < end) {
          unscaled = (unscaled << 8 | bytes[i] & 0xff);
          i++;
        }
        int bits = 8 * (end - start);
        long unscaledNew = (unscaled << (64 - bits)) >> (64 - bits);
        if (unscaledNew <= -Math.pow(10, 18) || unscaledNew >= Math.pow(10, 18)) {
          return new BigDecimal(unscaledNew);
        } else {
          return BigDecimal.valueOf(unscaledNew / Math.pow(10, scale));
        }
      } else {
        return new BigDecimal(new BigInteger(value.getBytes()), scale);
      }
    }
docs: convert parquet binary decimal to BigDecimal, lifted from
  https://github.com/apache/parquet-mr/blob/master/parquet-pig/src/main/java/org/apache/parquet/pig/convert/DecimalUtils.java#L38