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

Function length_offsets_binary

arrow-string/src/length.rs:512–521  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

510
511 #[test]
512 fn length_offsets_binary() {
513 let value: Vec<Option<&[u8]>> = vec![Some(b"hello"), Some(b" "), Some(&[0xff, 0xf8]), None];
514 let a = BinaryArray::from(value);
515 let b = a.slice(1, 3);
516 let result = length(&b).unwrap();
517 let result: &Int32Array = result.as_primitive();
518
519 let expected = Int32Array::from(vec![Some(1), Some(2), None]);
520 assert_eq!(&expected, result);
521 }
522
523 fn bit_length_cases() -> Vec<(Vec<&'static str>, usize, Vec<i32>)> {
524 // a large array

Callers

nothing calls this directly

Calls 3

lengthFunction · 0.85
as_primitiveMethod · 0.80
sliceMethod · 0.45

Tested by

no test coverage detected