| 1220 | } |
| 1221 | |
| 1222 | func (qs *queryState) handleCompareScalarFunction(ctx context.Context, arg funcArgs) error { |
| 1223 | attr := arg.q.Attr |
| 1224 | if ok := schema.State().HasCount(ctx, attr); !ok { |
| 1225 | return errors.Errorf("Need @count directive in schema for attr: %s for fn: %s at root", |
| 1226 | x.ParseAttr(attr), arg.srcFn.fname) |
| 1227 | } |
| 1228 | counts := arg.srcFn.threshold |
| 1229 | cp := countParams{ |
| 1230 | fn: arg.srcFn.fname, |
| 1231 | counts: counts, |
| 1232 | attr: attr, |
| 1233 | gid: arg.gid, |
| 1234 | readTs: arg.q.ReadTs, |
| 1235 | reverse: arg.q.Reverse, |
| 1236 | } |
| 1237 | return qs.evaluate(cp, arg.out) |
| 1238 | } |
| 1239 | |
| 1240 | func (qs *queryState) handleRegexFunction(ctx context.Context, arg funcArgs) error { |
| 1241 | span := trace.SpanFromContext(ctx) |