use of datawave.query.iterator.builder.IndexFilterIteratorBuilder in project datawave by NationalSecurityAgency.
the class IteratorBuildingVisitor method ivarateFilter.
/**
* Build the iterator stack using the filter ivarator (field index caching filter iterator)
*
* @param rootNode
* the node that was processed to generated this builder
* @param sourceNode
* the source node derived from the root
* @param data
*/
public void ivarateFilter(JexlNode rootNode, JexlNode sourceNode, Object data, List<ASTFunctionNode> functionNodes) throws IOException {
IndexFilterIteratorBuilder builder = new IndexFilterIteratorBuilder();
builder.negateAsNeeded(data);
// hence the "IndexAgnostic" method can be used here
if (sourceNode instanceof ASTAndNode) {
LiteralRange range = JexlASTHelper.findRange().recursively().getRange(sourceNode);
if (range == null) {
QueryException qe = new QueryException(DatawaveErrorCode.MULTIPLE_RANGES_IN_EXPRESSION);
throw new DatawaveFatalQueryException(qe);
}
builder.setRangeAndFunction(range, new FunctionFilter(functionNodes));
} else {
QueryException qe = new QueryException(DatawaveErrorCode.UNEXPECTED_SOURCE_NODE, MessageFormat.format("{0}", "ASTFunctionNode"));
throw new DatawaveFatalQueryException(qe);
}
ivarate(builder, rootNode, sourceNode, data);
}
Aggregations