use of com.linkedin.pinot.common.request.FilterOperator in project pinot by linkedin.
the class InPredicateAstNode method buildFilterQueryTree.
@Override
public FilterQueryTree buildFilterQueryTree() {
if (_identifier == null) {
throw new Pql2CompilationException("IN predicate has no identifier");
}
TreeSet<String> values = new TreeSet<>();
for (AstNode astNode : getChildren()) {
if (astNode instanceof LiteralAstNode) {
LiteralAstNode node = (LiteralAstNode) astNode;
values.add(node.getValueAsString());
}
}
String[] valueArray = values.toArray(new String[values.size()]);
FilterOperator filterOperator;
if (_isNotInClause) {
filterOperator = FilterOperator.NOT_IN;
} else {
filterOperator = FilterOperator.IN;
}
return new FilterQueryTree(_identifier, Collections.singletonList(StringUtil.join("\t\t", valueArray)), filterOperator, null);
}
Aggregations