Search in sources :

Example 1 with JexlASTHelper

use of datawave.query.jexl.JexlASTHelper in project datawave by NationalSecurityAgency.

the class NoExpansionFunctionVisitor method visit.

@Override
public Object visit(ASTFunctionNode node, Object data) {
    FunctionJexlNodeVisitor visitor = new FunctionJexlNodeVisitor();
    node.jjtAccept(visitor, null);
    if (visitor.namespace().equals("filter") && visitor.name().equalsIgnoreCase(EvaluationPhaseFilterFunctionsDescriptor.NO_EXPANSION)) {
        noExpansionFields.addAll(visitor.args().stream().map(JexlASTHelper::getIdentifier).collect(Collectors.toSet()));
        // prune this query node by returning null
        return null;
    }
    return copy(node);
}
Also used : JexlASTHelper(datawave.query.jexl.JexlASTHelper) FunctionJexlNodeVisitor(datawave.query.jexl.functions.FunctionJexlNodeVisitor)

Aggregations

JexlASTHelper (datawave.query.jexl.JexlASTHelper)1 FunctionJexlNodeVisitor (datawave.query.jexl.functions.FunctionJexlNodeVisitor)1