MCPcopy Create free account
hub / github.com/apache/arrow-rs / binary_array_value

Function binary_array_value

parquet-variant-compute/src/variant_array.rs:45–52  ·  view source on GitHub ↗

Returns the raw bytes at the given index from a binary-like array, return `None` if the array isn't binary-like.

(array: &dyn Array, index: usize)

Source from the content-addressed store, hash-verified

43
44/// Returns the raw bytes at the given index from a binary-like array, return `None` if the array isn't binary-like.
45pub(crate) fn binary_array_value(array: &dyn Array, index: usize) -> Option<&[u8]> {
46 match array.data_type() {
47 DataType::Binary => Some(array.as_binary::<i32>().value(index)),
48 DataType::LargeBinary => Some(array.as_binary::<i64>().value(index)),
49 DataType::BinaryView => Some(array.as_binary_view().value(index)),
50 _ => None,
51 }
52}
53
54/// Returns a [`Variant`] from a `metadata` and `value` byte arrays, returns `None`
55/// if one of them is of invalid type.

Callers 5

assert_list_structureFunction · 0.85
variant_from_arrays_atFunction · 0.85
unshred_variantFunction · 0.85
append_rowMethod · 0.85

Calls 3

as_binary_viewMethod · 0.80
data_typeMethod · 0.45
valueMethod · 0.45

Tested by 1