Skip to content

feat: build and read GUID vectors in bulk - #18

Merged
vbanas merged 1 commit into
masterfrom
feat/guid-vector
Oct 6, 2026
Merged

vbanas merged 1 commit into
masterfrom
feat/guid-vector

Conversation

@vbanas

@vbanas vbanas commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

A GUID vector could be read one boxed atom at a time, and built only the same way: VecElem covered the numeric types, so neither Value::vec nor as_slice took a GUID, and push and set refused one. A caller with a column of 16-byte keys had no bulk path in either direction.

The core stores a GUID vector as contiguous 16-byte cells, and ray_vec_from_raw already takes RAY_GUID: it copies the cells and its null scan raises HAS_NULLS for an all-zero one. So [u8; 16] becomes a VecElem mapped to RAY_GUID, and the generic paths take a GUID column as they take an i64 one: Value::vec builds it with one memcpy, as_slice::<[u8; 16]>() borrows it without copying, and push and set are type-checked against it. Value::guid_vec and Value::guid_slice name the two bulk paths. Boxed reads already handled RAY_GUID, so get, iter and to_vec::<Option>() see the null as None.

Four tests in tests/containers.rs: the build and the zero-copy slice (the empty vector and type mismatches included), nulls from construction and boxed access, push/set/set_null, and a vector built from bytes formatting as the engine's own from the same text and surviving ser/de. The vector and GUID pages say how. cargo test --workspace passes on the release flavour and on the debug one with RAY_DFD=1; clippy -D warnings and fmt are clean.

A GUID vector could be read one boxed atom at a time, and built only
the same way: VecElem covered the numeric types, so neither Value::vec
nor as_slice took a GUID, and push and set refused one. A caller with a
column of 16-byte keys had no bulk path in either direction.

The core stores a GUID vector as contiguous 16-byte cells, and
ray_vec_from_raw already takes RAY_GUID: it copies the cells and its
null scan raises HAS_NULLS for an all-zero one. So [u8; 16] becomes a
VecElem mapped to RAY_GUID, and the generic paths take a GUID column
as they take an i64 one: Value::vec builds it with one memcpy,
as_slice::<[u8; 16]>() borrows it without copying, and push and set
are type-checked against it. Value::guid_vec and Value::guid_slice
name the two bulk paths. Boxed reads already handled RAY_GUID, so
get, iter and to_vec::<Option<Guid>>() see the null as None.

Four tests in tests/containers.rs: the build and the zero-copy slice
(the empty vector and type mismatches included), nulls from
construction and boxed access, push/set/set_null, and a vector built
from bytes formatting as the engine's own from the same text and
surviving ser/de. The vector and GUID pages say how. cargo test
--workspace passes on the release flavour and on the debug one with
RAY_DFD=1; clippy -D warnings and fmt are clean.
@vbanas
vbanas merged commit 31c25ad into master Oct 6, 2026
2 checks passed
@vbanas
vbanas deleted the feat/guid-vector branch October 6, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant