MCPcopy
hub / github.com/dgraph-io/dgraph / parseFuncType

Function parseFuncType

worker/task.go:230–243  ·  view source on GitHub ↗
(srcFunc *pb.SrcFunction)

Source from the content-addressed store, hash-verified

228)
229
230func parseFuncType(srcFunc *pb.SrcFunction) (FuncType, string) {
231 if srcFunc == nil {
232 return notAFunction, ""
233 }
234 ftype, fname := parseFuncTypeHelper(srcFunc.Name)
235 if srcFunc.IsCount && ftype == compareAttrFn {
236 // gt(release_date, "1990") is 'CompareAttr' which
237 // takes advantage of indexed-attr
238 // gt(count(films), 0) is 'CompareScalar', we first do
239 // counting on attr, then compare the result as scalar with int
240 return compareScalarFn, fname
241 }
242 return ftype, fname
243}
244
245func parseFuncTypeHelper(name string) (FuncType, string) {
246 if len(name) == 0 {

Callers 1

parseSrcFnFunction · 0.85

Calls 1

parseFuncTypeHelperFunction · 0.85

Tested by

no test coverage detected