(srcFunc *pb.SrcFunction)
| 228 | ) |
| 229 | |
| 230 | func 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 | |
| 245 | func parseFuncTypeHelper(name string) (FuncType, string) { |
| 246 | if len(name) == 0 { |
no test coverage detected