Skip to content

Commit 5d75250

Browse files
fix(core): fix TestLiveLoadAndExportRDFFormat test
1 parent 7893305 commit 5d75250

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

worker/export.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/hypermodeinc/dgraph/v25/enc"
3333
"github.com/hypermodeinc/dgraph/v25/posting"
3434
"github.com/hypermodeinc/dgraph/v25/protos/pb"
35+
"github.com/hypermodeinc/dgraph/v25/tok/hnsw"
3536
"github.com/hypermodeinc/dgraph/v25/types"
3637
"github.com/hypermodeinc/dgraph/v25/types/facets"
3738
"github.com/hypermodeinc/dgraph/v25/x"
@@ -821,6 +822,10 @@ func exportInternal(ctx context.Context, in *pb.ExportRequest, db *badger.DB,
821822
return false
822823
}
823824
}
825+
826+
if strings.Contains(pk.Attr, hnsw.VecKeyword) {
827+
return false
828+
}
824829
return pk.IsData()
825830
}
826831

worker/mutation.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"bytes"
1010
"context"
1111
"math"
12+
"strings"
1213
"sync"
1314
"sync/atomic"
1415
"time"
@@ -31,6 +32,7 @@ import (
3132
"github.com/hypermodeinc/dgraph/v25/posting"
3233
"github.com/hypermodeinc/dgraph/v25/protos/pb"
3334
"github.com/hypermodeinc/dgraph/v25/schema"
35+
"github.com/hypermodeinc/dgraph/v25/tok/hnsw"
3436
"github.com/hypermodeinc/dgraph/v25/types"
3537
"github.com/hypermodeinc/dgraph/v25/x"
3638
)
@@ -512,6 +514,10 @@ func ValidateAndConvert(edge *pb.DirectedEdge, su *pb.SchemaUpdate) error {
512514
return nil
513515
}
514516

517+
if strings.Contains(su.Predicate, hnsw.VecKeyword) {
518+
return errors.Errorf("Not allowed to insert mutations in vector index keys, edge: [%v]", edge)
519+
}
520+
515521
storageType := posting.TypeID(edge)
516522
schemaType := types.TypeID(su.ValueType)
517523

0 commit comments

Comments
 (0)