public static boolean canFail(LogicalType inputType, LogicalType targetType) {
        return Preconditions.checkNotNull(
                        resolve(inputType, targetType), "Cast rule cannot be resolved")
                .canFail(inputType, targetType);
    }
@Test
    void testCanFail() {
        assertThat(CastRuleProvider.canFail(TINYINT, INT)).isFalse();
        assertThat(CastRuleProvider.canFail(STRING_TYPE, TIME().getLogicalType())).isTrue();
        assertThat(CastRuleProvider.canFail(STRING_TYPE, STRING_TYPE)).isFalse();

        LogicalType inputType = ROW(TINYINT(), STRING()).getLogicalType();
        assertThat(CastRuleProvider.canFail(inputType, ROW(INT(), TIME()).getLogicalType()))
                .isTrue();
        assertThat(CastRuleProvider.canFail(inputType, ROW(INT(), STRING()).getLogicalType()))
                .isFalse();
    }