MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / removeFilters

Function removeFilters

edgraph/access.go:1382–1404  ·  view source on GitHub ↗
(f *dql.FilterTree, blockedPreds map[string]struct{})

Source from the content-addressed store, hash-verified

1380}
1381
1382func removeFilters(f *dql.FilterTree, blockedPreds map[string]struct{}) *dql.FilterTree {
1383 if f == nil {
1384 return nil
1385 }
1386 if f.Func != nil && len(f.Func.Attr) > 0 {
1387 if _, ok := blockedPreds[f.Func.Attr]; ok {
1388 return nil
1389 }
1390 }
1391
1392 filteredChildren := f.Child[:0]
1393 for _, ch := range f.Child {
1394 child := removeFilters(ch, blockedPreds)
1395 if child != nil {
1396 filteredChildren = append(filteredChildren, child)
1397 }
1398 }
1399 if len(filteredChildren) != len(f.Child) && (f.Op == "AND" || f.Op == "NOT") {
1400 return nil
1401 }
1402 f.Child = filteredChildren
1403 return f
1404}
1405
1406func removeGroupBy(gbAttrs []dql.GroupByAttr,
1407 blockedPreds map[string]struct{}) []dql.GroupByAttr {

Callers 1

removePredsFromQueryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…