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

Method make_sorted_input_batches

test-utils/src/string_gen.rs:46–57  ·  view source on GitHub ↗

Return a column sorted array of random strings, sorted by a if large is false, the array is a StringArray if large is true, the array is a LargeStringArray

(&mut self, large: bool)

Source from the content-addressed store, hash-verified

44 /// if large is false, the array is a StringArray
45 /// if large is true, the array is a LargeStringArray
46 pub fn make_sorted_input_batches(&mut self, large: bool) -> Vec<RecordBatch> {
47 let array = if large {
48 self.0.gen_data::<i32>()
49 } else {
50 self.0.gen_data::<i64>()
51 };
52
53 let array = arrow::compute::sort(&array, None).unwrap();
54
55 let batch = RecordBatch::try_from_iter(vec![("a", array)]).unwrap();
56 stagger_batch(batch)
57 }
58
59 /// Return a set of `BatchGenerator`s that cover a range of interesting
60 /// cases

Callers 1

group_by_string_testFunction · 0.80

Calls 2

sortFunction · 0.85
stagger_batchFunction · 0.85

Tested by 1

group_by_string_testFunction · 0.64