presto-spi/src/main/java/io/prestosql/spi/type/DecimalType.java/DecimalType/validatePrecisionScale
class DecimalType:    void validatePrecisionScale(int precision, int scale, int maxPrecision)
    {
        if (precision <= 0 || precision > maxPrecision) {
            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "DECIMAL precision must be in range [1, " + MAX_PRECISION + "]");
        }

        if (scale < 0 || scale > precision) {
            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "DECIMAL scale must be in range [0, precision]");
        }
    }