Struct lance::encodings::binary::BinaryDecoder
source · pub struct BinaryDecoder<'a, T: ByteArrayType> { /* private fields */ }
Expand description
Var-binary encoding decoder.
Implementations§
source§impl<'a, T: ByteArrayType> BinaryDecoder<'a, T>
impl<'a, T: ByteArrayType> BinaryDecoder<'a, T>
Var-length Binary Decoder
sourcepub fn new(
reader: &'a dyn ObjectReader,
position: usize,
length: usize,
nullable: bool
) -> Self
pub fn new(
reader: &'a dyn ObjectReader,
position: usize,
length: usize,
nullable: bool
) -> Self
Create a BinaryEncoder to decode one batch.
position
, file position where this batch starts.length
, the number of records in this batch.nullable
, whether this batch contains nullable value.
Example
use arrow_array::types::Utf8Type;
use object_store::path::Path;
use lance::io::ObjectStore;
use lance::encodings::binary::BinaryDecoder;
async {
let object_store = ObjectStore::new(":memory:").await.unwrap();
let path = Path::from("/data.lance");
let reader = object_store.open(&path).await.unwrap();
let string_decoder = BinaryDecoder::<Utf8Type>::new(reader.as_ref(), 100, 1024, true);
};