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

Function test_binary_view

arrow-select/src/coalesce.rs:1180–1198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1178
1179 #[test]
1180 fn test_binary_view() {
1181 let values: Vec<Option<&[u8]>> = vec![
1182 Some(b"foo"),
1183 None,
1184 Some(b"A longer string that is more than 12 bytes"),
1185 ];
1186
1187 let binary_view =
1188 BinaryViewArray::from_iter(std::iter::repeat(values.iter()).flatten().take(1000));
1189 let batch =
1190 RecordBatch::try_from_iter(vec![("c0", Arc::new(binary_view) as ArrayRef)]).unwrap();
1191
1192 Test::new("coalesce_binary_view")
1193 .with_batch(batch.clone())
1194 .with_batch(batch.clone())
1195 .with_batch_size(512)
1196 .with_expected_output_sizes(vec![512, 512, 512, 464])
1197 .run();
1198 }
1199
1200 #[derive(Debug, Clone, PartialEq)]
1201 struct ExpectedLayout {

Callers

nothing calls this directly

Calls 9

flattenMethod · 0.80
with_batchMethod · 0.80
from_iterFunction · 0.50
takeMethod · 0.45
iterMethod · 0.45
runMethod · 0.45
with_batch_sizeMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected