Skip to content

Commit

Permalink
ran again
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshil goel committed Aug 13, 2024
1 parent 277aa43 commit ab15508
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 1 addition & 2 deletions posting/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,8 @@ func (r *rebuilder) RunWithoutTemp(ctx context.Context) error {
stream := pstore.NewStreamAt(r.startTs)
stream.LogPrefix = fmt.Sprintf("Rebuilding index for predicate %s (1/2):", r.attr)
stream.Prefix = r.prefix
stream.NumGo = 16
stream.NumGo = 8
txn := NewTxn(r.startTs)
txn.cache.plists = make(map[string]*List, 2000000)
stream.KeyToList = func(key []byte, it *badger.Iterator) (*bpb.KVList, error) {
// We should return quickly if the context is no longer valid.
select {
Expand Down
2 changes: 1 addition & 1 deletion posting/lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (vc *viLocalCache) GetValueFromPostingList(pl *List) (rval index.Value, rer
if value == nil {
return nil, nil
}
return value.Postings[0], nil
return value.Postings[0].Value, nil
}

func NewViLocalCache(delegate *LocalCache) *viLocalCache {
Expand Down
2 changes: 1 addition & 1 deletion posting/mvcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func (c *CachePL) Set(l *List, readTs uint64) {
}

func ShouldGoInCache(pk x.ParsedKey) bool {
return (!pk.IsData() && strings.HasSuffix(pk.Attr, "dgraph.type")) || strings.Contains(pk.Attr, "vect")
return (!pk.IsData() && strings.HasSuffix(pk.Attr, "dgraph.type"))
}

func getNew(key []byte, pstore *badger.DB, readTs uint64) (*List, error) {
Expand Down
2 changes: 1 addition & 1 deletion posting/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (vt *viTxn) GetValueFromPostingList(pl *List) (rval index.Value, rerr error
if value == nil {
return nil, nil
}
return value.Postings[0], nil
return value.Postings[0].Value, nil
}

func (vt *viTxn) AddMutation(ctx context.Context, key []byte, t *index.KeyValue) error {
Expand Down
6 changes: 6 additions & 0 deletions query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,12 @@ func (sg *SubGraph) transformVars(doneVars map[string]varValue, path []*SubGraph
mt.Const = val
continue
}

if val, ok := newMap[0]; ok && len(newMap) == 1 {
mt.Const = val
continue
}

mt.Val = newMap
}
return nil
Expand Down

0 comments on commit ab15508

Please sign in to comment.