Search in sources :

Example 1 with NotInPredicate

use of com.linkedin.pinot.core.common.predicate.NotInPredicate in project pinot by linkedin.

the class Predicate method newPredicate.

public static Predicate newPredicate(FilterQueryTree filterQueryTree) {
    assert (filterQueryTree.getChildren() == null) || filterQueryTree.getChildren().isEmpty();
    final FilterOperator filterType = filterQueryTree.getOperator();
    final String column = filterQueryTree.getColumn();
    final List<String> value = filterQueryTree.getValue();
    Predicate predicate = null;
    switch(filterType) {
        case EQUALITY:
            predicate = new EqPredicate(column, value);
            break;
        case RANGE:
            predicate = new RangePredicate(column, value);
            break;
        case REGEX:
            predicate = new RegexPredicate(column, value);
            break;
        case NOT:
            predicate = new NEqPredicate(column, value);
            break;
        case NOT_IN:
            predicate = new NotInPredicate(column, value);
            break;
        case IN:
            predicate = new InPredicate(column, value);
            break;
        default:
            throw new UnsupportedOperationException("Unsupported filterType:" + filterType);
    }
    return predicate;
}
Also used : FilterOperator(com.linkedin.pinot.common.request.FilterOperator) RangePredicate(com.linkedin.pinot.core.common.predicate.RangePredicate) NEqPredicate(com.linkedin.pinot.core.common.predicate.NEqPredicate) RegexPredicate(com.linkedin.pinot.core.common.predicate.RegexPredicate) NEqPredicate(com.linkedin.pinot.core.common.predicate.NEqPredicate) EqPredicate(com.linkedin.pinot.core.common.predicate.EqPredicate) InPredicate(com.linkedin.pinot.core.common.predicate.InPredicate) NotInPredicate(com.linkedin.pinot.core.common.predicate.NotInPredicate) RegexPredicate(com.linkedin.pinot.core.common.predicate.RegexPredicate) RangePredicate(com.linkedin.pinot.core.common.predicate.RangePredicate) NEqPredicate(com.linkedin.pinot.core.common.predicate.NEqPredicate) InPredicate(com.linkedin.pinot.core.common.predicate.InPredicate) EqPredicate(com.linkedin.pinot.core.common.predicate.EqPredicate) NotInPredicate(com.linkedin.pinot.core.common.predicate.NotInPredicate) NotInPredicate(com.linkedin.pinot.core.common.predicate.NotInPredicate)

Aggregations

FilterOperator (com.linkedin.pinot.common.request.FilterOperator)1 EqPredicate (com.linkedin.pinot.core.common.predicate.EqPredicate)1 InPredicate (com.linkedin.pinot.core.common.predicate.InPredicate)1 NEqPredicate (com.linkedin.pinot.core.common.predicate.NEqPredicate)1 NotInPredicate (com.linkedin.pinot.core.common.predicate.NotInPredicate)1 RangePredicate (com.linkedin.pinot.core.common.predicate.RangePredicate)1 RegexPredicate (com.linkedin.pinot.core.common.predicate.RegexPredicate)1