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

Function expect_buffer_layout

arrow-select/src/coalesce.rs:1207–1221  ·  view source on GitHub ↗

Asserts that the buffer layout of the specified StringViewArray matches the expected layout

(array: &StringViewArray, expected: Vec<ExpectedLayout>)

Source from the content-addressed store, hash-verified

1205
1206 /// Asserts that the buffer layout of the specified StringViewArray matches the expected layout
1207 fn expect_buffer_layout(array: &StringViewArray, expected: Vec<ExpectedLayout>) {
1208 let actual = array
1209 .data_buffers()
1210 .iter()
1211 .map(|b| ExpectedLayout {
1212 len: b.len(),
1213 capacity: b.capacity(),
1214 })
1215 .collect::<Vec<_>>();
1216
1217 assert_eq!(
1218 actual, expected,
1219 "Expected buffer layout {expected:#?} but got {actual:#?}"
1220 );
1221 }
1222
1223 /// Test for [`BatchCoalescer`]
1224 ///

Calls 4

data_buffersMethod · 0.80
iterMethod · 0.45
lenMethod · 0.45
capacityMethod · 0.45