vortex_array/arrays/varbin/
mod.rs1mod array;
5pub use array::VarBinArrayExt;
6pub use array::VarBinData;
7pub use array::VarBinDataParts;
8pub use vtable::VarBinArray;
9
10pub(crate) mod compute;
11
12mod vtable;
13pub use vtable::VarBin;
14
15pub mod builder;
16
17mod accessor;
18
19use vortex_buffer::ByteBuffer;
20use vortex_error::VortexExpect;
21use vortex_error::vortex_err;
22
23use crate::dtype::DType;
24use crate::scalar::Scalar;
25
26pub fn varbin_scalar(value: ByteBuffer, dtype: &DType) -> Scalar {
27 if matches!(dtype, DType::Utf8(_)) {
28 Scalar::try_utf8(value, dtype.nullability())
29 .map_err(|err| vortex_err!("Failed to create scalar from utf8 buffer: {}", err))
30 .vortex_expect("UTF-8 scalar creation should succeed")
31 } else {
32 Scalar::binary(value, dtype.nullability())
33 }
34}
35
36#[cfg(test)]
37mod tests;