Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions vortex-row/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,19 @@ fn execute_row_encode(
Validity::NonNullable,
)
.into_array();
Ok(
ListViewArray::try_new(elements, offsets_arr, sizes_arr, Validity::NonNullable)?
.into_array(),
)
// SAFETY: The encoder constructs `elements`, `offsets_arr`, and `sizes_arr` itself.
// - `elements` is a `PrimitiveArray<u8>` of length `total_bytes`.
// - `offsets[i]` is `i * fixed_per_row + var_prefix[i]`, monotonically increasing,
// each value in `0..total_bytes`.
// - `sizes[i]` is the per-row size; `offsets[i] + sizes[i] <= total_bytes` by
// construction of the buffer.
// - Each row's slice is disjoint from every other row's slice.
// The constructor's `validate` re-walks every row to verify these invariants; we know
// they hold by construction, so we skip that walk.
Ok(unsafe {
ListViewArray::new_unchecked(elements, offsets_arr, sizes_arr, Validity::NonNullable)
}
.into_array())
}

/// Dispatch a single column's encoding into the shared `out` buffer.
Expand Down
Loading