fetchValue gets the value for a given UID.
(uid uint64, attr string, langs []string, scalar types.TypeID, readTs uint64)
| 822 | |
| 823 | // fetchValue gets the value for a given UID. |
| 824 | func fetchValue(uid uint64, attr string, langs []string, scalar types.TypeID, |
| 825 | readTs uint64) (types.Val, error) { |
| 826 | // Don't put the values in memory |
| 827 | pl, err := posting.GetNoStore(x.DataKey(attr, uid), readTs) |
| 828 | if err != nil { |
| 829 | return types.Val{}, err |
| 830 | } |
| 831 | |
| 832 | src, err := pl.ValueFor(readTs, langs) |
| 833 | |
| 834 | if err != nil { |
| 835 | return types.Val{}, err |
| 836 | } |
| 837 | dst, err := types.Convert(src, scalar) |
| 838 | if err != nil { |
| 839 | return types.Val{}, err |
| 840 | } |
| 841 | |
| 842 | return dst, nil |
| 843 | } |
no test coverage detected