use of com.linkedin.pinot.core.common.predicate.RegexPredicate 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;
}
Aggregations