Search in sources :

Example 1 with PredicateOptions

use of com.yahoo.search.predicate.optimization.PredicateOptions in project vespa by vespa-engine.

the class OptimizePredicateExpression method doExecute.

@Override
protected void doExecute(ExecutionContext ctx) {
    PredicateFieldValue predicate = ((PredicateFieldValue) ctx.getValue()).clone();
    IntegerFieldValue arity = (IntegerFieldValue) ctx.getVariable("arity");
    LongFieldValue lower_bound = (LongFieldValue) ctx.getVariable("lower_bound");
    LongFieldValue upper_bound = (LongFieldValue) ctx.getVariable("upper_bound");
    Long lower = lower_bound != null ? lower_bound.getLong() : null;
    Long upper = upper_bound != null ? upper_bound.getLong() : null;
    PredicateOptions options = new PredicateOptions(arity.getInteger(), lower, upper);
    predicate.setPredicate(optimizer.process(predicate.getPredicate(), options));
    ctx.setValue(predicate);
}
Also used : PredicateOptions(com.yahoo.search.predicate.optimization.PredicateOptions) IntegerFieldValue(com.yahoo.document.datatypes.IntegerFieldValue) PredicateFieldValue(com.yahoo.document.datatypes.PredicateFieldValue) LongFieldValue(com.yahoo.document.datatypes.LongFieldValue)

Aggregations

IntegerFieldValue (com.yahoo.document.datatypes.IntegerFieldValue)1 LongFieldValue (com.yahoo.document.datatypes.LongFieldValue)1 PredicateFieldValue (com.yahoo.document.datatypes.PredicateFieldValue)1 PredicateOptions (com.yahoo.search.predicate.optimization.PredicateOptions)1