Module builders

Source
Expand description

Builders for Vortex arrays.

Every logical type in Vortex has a canonical (uncompressed) in-memory encoding. This module provides pre-allocated builders to construct new canonical arrays.

§Example:

use vortex_array::builders::{builder_with_capacity, ArrayBuilderExt};
use vortex_dtype::{DType, Nullability};

// Create a new builder for string data.
let mut builder = builder_with_capacity(&DType::Utf8(Nullability::NonNullable), 4);

builder.append_scalar(&"a".into()).unwrap();
builder.append_scalar(&"b".into()).unwrap();
builder.append_scalar(&"c".into()).unwrap();
builder.append_scalar(&"d".into()).unwrap();

let strings = builder.finish();

assert_eq!(strings.scalar_at(0).unwrap(), "a".into());
assert_eq!(strings.scalar_at(1).unwrap(), "b".into());
assert_eq!(strings.scalar_at(2).unwrap(), "c".into());
assert_eq!(strings.scalar_at(3).unwrap(), "d".into());

Structs§

BoolBuilder
DecimalBuilder
An ArrayBuilder for Decimal typed arrays.
ExtensionBuilder
ListBuilder
NullBuilder
PrimitiveBuilder
Builder for PrimitiveArray.
StructBuilder
UninitRange
VarBinViewBuilder

Traits§

ArrayBuilder
ArrayBuilderExt

Functions§

builder_with_capacity
Construct a new canonical builder for the given DType.