This PR expands the existing DataChunk interface with GetValue. I've moved all the scanning functionality out of rows.go and into the respective getter functions. The getter function matches the fnGetVectorValue type: type fnGetVectorValue func(vec *vector, rowIdx C.idx_t) any. During data chunk initialization, we now initialize both the setter and getter functions.
A possible optimization for multiple (same result) data chunks is to reuse the existing initialized vectors and change the duckdb vector and data. Even without that optimization, this PR should speed up scanning. I've run the BenchmarkTypes benchmark both on main and this PR (locally).
This PR expands the existing
DataChunk
interface withGetValue
. I've moved all the scanning functionality out ofrows.go
and into the respective getter functions. The getter function matches thefnGetVectorValue
type:type fnGetVectorValue func(vec *vector, rowIdx C.idx_t) any.
During data chunk initialization, we now initialize both the setter and getter functions.A possible optimization for multiple (same result) data chunks is to reuse the existing initialized vectors and change the duckdb vector and data. Even without that optimization, this PR should speed up scanning. I've run the
BenchmarkTypes
benchmark both onmain
and this PR (locally).