public static DecimalType findRoundDecimalType(int precision, int scale, int round) {
        if (round >= scale) {
            return new DecimalType(false, precision, scale);
        }
        if (round < 0) {
            return new DecimalType(
                    false, Math.min(DecimalType.MAX_PRECISION, 1 + precision - scale), 0);
        }
        // 0 <= r < s
        // NOTE: rounding may increase the digits by 1, therefore we need +1 on precisions.
        return new DecimalType(false, 1 + precision - scale + round, round);
    }
@Test
    void testFindRoundingDecimalType() {
        assertThat(LogicalTypeMerging.findRoundDecimalType(32, 8, 5)).hasPrecisionAndScale(30, 5);
        assertThat(LogicalTypeMerging.findRoundDecimalType(32, 8, 10)).hasPrecisionAndScale(32, 8);
        assertThat(LogicalTypeMerging.findRoundDecimalType(30, 20, 18))
                .hasPrecisionAndScale(29, 18);
        assertThat(LogicalTypeMerging.findRoundDecimalType(10, 10, 2)).hasPrecisionAndScale(3, 2);
    }