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

Function test_take_slice_string

arrow-select/src/take.rs:1747–1754  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1745
1746 #[test]
1747 fn test_take_slice_string() {
1748 let strings = StringArray::from(vec![Some("hello"), None, Some("world"), None, Some("hi")]);
1749 let indices = Int32Array::from(vec![Some(0), Some(1), None, Some(0), Some(2)]);
1750 let indices_slice = indices.slice(1, 4);
1751 let expected = StringArray::from(vec![None, None, Some("hello"), Some("world")]);
1752 let result = take(&strings, &indices_slice, None).unwrap();
1753 assert_eq!(result.as_ref(), &expected);
1754 }
1755
1756 /// Take from a *sliced* byte array, i.e. one whose value offsets do not
1757 /// start at zero. This exercises copying byte data out of an array with a

Callers

nothing calls this directly

Calls 2

takeFunction · 0.85
sliceMethod · 0.45

Tested by

no test coverage detected