Search in sources :

Example 1 with ConditionEvaluationException

use of com.hortonworks.streamline.streams.layout.component.rule.exception.ConditionEvaluationException in project streamline by hortonworks.

the class SqlScript method createValues.

private CorrelatedValues createValues(StreamlineEvent event) {
    Values values = new Values();
    for (Schema.Field field : stormSqlFields) {
        Object value;
        if (field == DUMMY_FIELD) {
            value = DUMMY_FIELD_VALUE;
        } else {
            value = event.get(field.getName());
            if (value == null) {
                throw new ConditionEvaluationException("Missing property " + field.getName());
            }
        }
        values.add(value);
    }
    return CorrelatedValues.of(Collections.singletonList(event), values);
}
Also used : Schema(com.hortonworks.registries.common.Schema) Values(com.hortonworks.streamline.streams.sql.runtime.Values) CorrelatedValues(com.hortonworks.streamline.streams.sql.runtime.CorrelatedValues) ConditionEvaluationException(com.hortonworks.streamline.streams.layout.component.rule.exception.ConditionEvaluationException)

Aggregations

Schema (com.hortonworks.registries.common.Schema)1 ConditionEvaluationException (com.hortonworks.streamline.streams.layout.component.rule.exception.ConditionEvaluationException)1 CorrelatedValues (com.hortonworks.streamline.streams.sql.runtime.CorrelatedValues)1 Values (com.hortonworks.streamline.streams.sql.runtime.Values)1