Skip to content

Set correct posting list type while creating it in live loader. #5012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions dgraph/cmd/live/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func getTypeVal(val *api.Value) (types.Val, error) {
}

p1.Value = p1.Value.([]byte)
p1.Tid = p.Tid
return p1, nil
}

Expand Down Expand Up @@ -301,11 +302,7 @@ func (l *loader) conflictKeysForNQuad(nq *api.NQuad) ([]uint64, error) {
Tid: types.TypeID(de.GetValueType()),
Value: de.GetValue(),
}
// If the value type is not already set according to the schema, set it to string and
// then convert it to the type as declared in the schema.
if storageVal.Tid != pred.ValueType {
storageVal.Tid = types.StringID
}

schemaVal, err := types.Convert(storageVal, types.TypeID(pred.ValueType))
if err != nil {
errs = append(errs, err.Error())
Expand Down