connectors/rocketmq-connect-doris/src/main/java/org/apache/rocketmq/connect/doris/sink/RecordValidator.java [47:76]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static RecordValidator create(DorisSinkConfig config) {
        RecordValidator requiresKey = requiresKey(config);
        RecordValidator requiresValue = requiresValue(config);

        RecordValidator keyValidator = NO_OP;
        RecordValidator valueValidator = NO_OP;
        switch (config.pkMode) {
            case RECORD_KEY:
                keyValidator = keyValidator.and(requiresKey);
                break;
            case RECORD_VALUE:
            case NONE:
                valueValidator = valueValidator.and(requiresValue);
                break;
            default:
                // no primary key is required
                break;
        }

        if (config.isDeleteEnabled()) {
            // When delete is enabled, we need a key
            keyValidator = keyValidator.and(requiresKey);
        } else {
            // When delete is disabled, we need non-tombstone values
            valueValidator = valueValidator.and(requiresValue);
        }

        // Compose the validator that may or may be NO_OP
        return keyValidator.and(valueValidator);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



connectors/rocketmq-connect-jdbc/src/main/java/org/apache/rocketmq/connect/jdbc/sink/RecordValidator.java [29:58]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static RecordValidator create(JdbcSinkConfig config) {
        RecordValidator requiresKey = requiresKey(config);
        RecordValidator requiresValue = requiresValue(config);

        RecordValidator keyValidator = NO_OP;
        RecordValidator valueValidator = NO_OP;
        switch (config.pkMode) {
            case RECORD_KEY:
                keyValidator = keyValidator.and(requiresKey);
                break;
            case RECORD_VALUE:
            case NONE:
                valueValidator = valueValidator.and(requiresValue);
                break;
            default:
                // no primary key is required
                break;
        }

        if (config.isDeleteEnabled()) {
            // When delete is enabled, we need a key
            keyValidator = keyValidator.and(requiresKey);
        } else {
            // When delete is disabled, we need non-tombstone values
            valueValidator = valueValidator.and(requiresValue);
        }

        // Compose the validator that may or may be NO_OP
        return keyValidator.and(valueValidator);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



