From: jkatz (@jkatz) <noreply+jkatz@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] PR #604: Add direct array to/from sparsevec casts
Date: Tue, 25 Jun 2024 03:13:21 +0000
Message-ID: <gh-pgvector-pgvector-604-c2187879869@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-604@github.com>
References: <gh-pgvector-pgvector-604@github.com>
Going to address a few of the general notes:
> Decide whether to support arrays containing NULLs to sparsevec casts (drop corresponding commit if not supporting)
By definition, a vector can't contain NULL attributes, so I don't think we should support this.
> Decide whether to simplify (at the cost of performance, or otherwise) the generic array to float4 conversion code
I'm aligned with simplification only if it doesn't impact correctness or performance.
> Decide whether sparsevec->array casts should contain zero values (current approach) or NULLs in place of sparsevecs empty slots in the returned ARRAY
I think it's on the user to decide how they want to treat this case - we can't assume that a `NULL` is meant to be `0`. A `NULL` means we don't know what value should be present.