Changed indices to start at 1 for sparse vectors to match SQL

This commit is contained in:
Andrew Kane
2024-04-06 14:02:07 -07:00
parent aec853dc68
commit 4450029bdc
13 changed files with 83 additions and 81 deletions

View File

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