Switched to 0-based numbering for sparsevec on-disk format

This commit is contained in:
Andrew Kane
2024-04-24 12:51:24 -07:00
parent 4d21eea6f1
commit 78e5bcf229
4 changed files with 20 additions and 15 deletions

View File

@@ -1206,7 +1206,7 @@ sparsevec_to_halfvec(PG_FUNCTION_ARGS)
result = InitHalfVector(dim);
for (int i = 0; i < svec->nnz; i++)
result->x[svec->indices[i] - 1] = Float4ToHalf(values[i]);
result->x[svec->indices[i]] = Float4ToHalf(values[i]);
PG_RETURN_POINTER(result);
}