MCPcopy Create free account
hub / github.com/apache/datafusion / batches_to_vec

Function batches_to_vec

test-utils/src/lib.rs:37–45  ·  view source on GitHub ↗

Extracts the i32 values from the set of batches and returns them as a single Vec

(batches: &[RecordBatch])

Source from the content-addressed store, hash-verified

35
36/// Extracts the i32 values from the set of batches and returns them as a single Vec
37pub fn batches_to_vec(batches: &[RecordBatch]) -> Vec<Option<i32>> {
38 batches
39 .iter()
40 .flat_map(|batch| {
41 assert_eq!(batch.num_columns(), 1);
42 as_int32_array(batch.column(0)).unwrap().iter()
43 })
44 .collect()
45}
46
47/// extract i32 values from batches and sort them
48pub fn partitions_to_sorted_vec(partitions: &[Vec<RecordBatch>]) -> Vec<Option<i32>> {

Callers 5

partitions_to_sorted_vecFunction · 0.85
test_sort_10k_memFunction · 0.85
test_sort_100k_memFunction · 0.85
test_sort_unlimited_memFunction · 0.85
run_merge_testFunction · 0.85

Calls 4

as_int32_arrayFunction · 0.85
collectMethod · 0.80
columnMethod · 0.80
iterMethod · 0.45

Tested by 4

test_sort_10k_memFunction · 0.68
test_sort_100k_memFunction · 0.68
test_sort_unlimited_memFunction · 0.68
run_merge_testFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…