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

Function make_partition

datafusion/datasource/src/mod.rs:630–638  ·  view source on GitHub ↗

Return a RecordBatch with a single Int32 array with values (0..sz) in a field named "i"

(sz: i32)

Source from the content-addressed store, hash-verified

628
629 /// Return a RecordBatch with a single Int32 array with values (0..sz) in a field named "i"
630 pub fn make_partition(sz: i32) -> RecordBatch {
631 let seq_start = 0;
632 let seq_end = sz;
633 let values = (seq_start..seq_end).collect::<Vec<_>>();
634 let schema = Arc::new(Schema::new(vec![Field::new("i", DataType::Int32, true)]));
635 let arr = Arc::new(Int32Array::from(values));
636
637 RecordBatch::try_new(schema, vec![arr as ArrayRef]).unwrap()
638 }
639
640 /// Get the schema for the aggregate_test_* csv files
641 pub fn aggr_test_schema() -> SchemaRef {

Callers 4

exec_with_limitFunction · 0.70
new_exec_with_batchesFunction · 0.70

Calls 1

newFunction · 0.85

Tested by 3

new_exec_with_batchesFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…