use of com.yahoo.searchlib.expression.BucketResultNode in project vespa by vespa-engine.
the class ExpressionConverter method toBucketList.
private ResultNodeVector toBucketList(PredefinedFunction fnc) {
ResultNodeVector ret = null;
for (int i = 0, len = fnc.getNumBuckets(); i < len; ++i) {
BucketResultNode bucket = toBucket(fnc.getBucket(i));
if (ret == null) {
if (bucket instanceof FloatBucketResultNode) {
ret = new FloatBucketResultNodeVector();
} else if (bucket instanceof IntegerBucketResultNode) {
ret = new IntegerBucketResultNodeVector();
} else if (bucket instanceof RawBucketResultNode) {
ret = new RawBucketResultNodeVector();
} else {
ret = new StringBucketResultNodeVector();
}
}
ret.add(bucket);
}
return ret;
}
use of com.yahoo.searchlib.expression.BucketResultNode in project vespa by vespa-engine.
the class Grouping method unifyNull.
public void unifyNull() {
class FindGroup implements ObjectPredicate {
@Override
public boolean check(Object obj) {
return obj instanceof Group;
}
}
class UnifyNullGroupId implements ObjectOperation {
@Override
public void execute(Object obj) {
Group group = (Group) obj;
ResultNode id = group.getId();
if (id instanceof BucketResultNode && ((BucketResultNode) id).empty()) {
group.setId(new NullResultNode());
}
}
}
selectMembers(new FindGroup(), new UnifyNullGroupId());
}
Aggregations