Search in sources :

Example 1 with Clause

use of com.yahoo.bullet.parsing.Clause in project bullet-core by yahoo.

the class FilterOperations method performRelational.

private static boolean performRelational(BulletRecord record, FilterClause clause) {
    Clause.Operation operator = clause.getOperation();
    if (isEmpty(clause.getValues())) {
        return true;
    }
    TypedObject object = extractTypedObject(clause.getField(), record);
    if (operator == Clause.Operation.REGEX_LIKE) {
        return REGEX_LIKE.compare(object, clause.getPatterns().stream());
    }
    return COMPARATORS.get(operator).compare(object, cast(object, clause.getValues()));
}
Also used : TypedObject(com.yahoo.bullet.typesystem.TypedObject) Utilities.extractTypedObject(com.yahoo.bullet.common.Utilities.extractTypedObject) FilterClause(com.yahoo.bullet.parsing.FilterClause) LogicalClause(com.yahoo.bullet.parsing.LogicalClause) Clause(com.yahoo.bullet.parsing.Clause)

Aggregations

Utilities.extractTypedObject (com.yahoo.bullet.common.Utilities.extractTypedObject)1 Clause (com.yahoo.bullet.parsing.Clause)1 FilterClause (com.yahoo.bullet.parsing.FilterClause)1 LogicalClause (com.yahoo.bullet.parsing.LogicalClause)1 TypedObject (com.yahoo.bullet.typesystem.TypedObject)1