Skip to content

Commit 8136e2c

Browse files
added filter for vector lengths
1 parent 747aa00 commit 8136e2c

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

posting/index.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ func (mp *MutationPipeline) ProcessSingle(ctx context.Context, pipeline *Predica
656656

657657
var oldVal *pb.Posting
658658
for edge := range pipeline.edges {
659+
//fmt.Println("EDGE", edge)
659660
if edge.Op != pb.DirectedEdge_DEL && !schemaExists {
660661
return errors.Errorf("runMutation: Unable to find schema for %s", edge.Attr)
661662
}

posting/lists.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,13 @@ func (lc *LocalCache) GetSinglePosting(key []byte) (*pb.PostingList, error) {
441441
return lc.readPostingListAt(key)
442442
}
443443

444-
pk, _ := x.Parse(key)
445-
446444
pl, err := getPostings()
447445
if err == badger.ErrKeyNotFound {
448-
fmt.Println("READING ", pk, nil)
446+
//fmt.Println("READING ", pk, nil)
449447
return nil, nil
450448
}
451449
if err != nil {
452-
fmt.Println("READING ", pk, err)
450+
//fmt.Println("READING ", pk, err)
453451
return nil, err
454452
}
455453

@@ -462,7 +460,7 @@ func (lc *LocalCache) GetSinglePosting(key []byte) (*pb.PostingList, error) {
462460
}
463461
}
464462
pl.Postings = pl.Postings[:idx]
465-
fmt.Println("READING ", pk, pl)
463+
//fmt.Println("READING ", pk, pl)
466464
return pl, nil
467465
}
468466

posting/oracle.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,22 @@ func SortAndDedupPostings(postings []*pb.Posting) []*pb.Posting {
7777
sort.Slice(postings, func(i, j int) bool {
7878
return postings[i].Uid < postings[j].Uid
7979
})
80+
return postings
8081

8182
// In-place filtering: keep only the last occurrence for each UID
82-
n := 0 // write index
83-
for i := 0; i < len(postings); {
84-
j := i + 1
85-
// Skip all postings with same UID
86-
for j < len(postings) && postings[j].Uid == postings[i].Uid {
87-
j++
88-
}
89-
// Keep only the last posting for this UID
90-
postings[n] = postings[j-1]
91-
n++
92-
i = j
93-
}
94-
return postings[:n]
83+
// n := 0 // write index
84+
// for i := 0; i < len(postings); {
85+
// j := i + 1
86+
// // Skip all postings with same UID
87+
// for j < len(postings) && postings[j].Uid == postings[i].Uid {
88+
// j++
89+
// }
90+
// // Keep only the last posting for this UID
91+
// postings[n] = postings[j-1]
92+
// n++
93+
// i = j
94+
// }
95+
// return postings[:n]
9596
}
9697

9798
func (txn *Txn) AddDelta(key string, pl pb.PostingList) (*pb.PostingList, error) {

0 commit comments

Comments
 (0)