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

Function table_with_sequence

datafusion/core/src/test/mod.rs:221–232  ·  view source on GitHub ↗

Return a new table provider that has a single Int32 column with values between `seq_start` and `seq_end`

(
    seq_start: i32,
    seq_end: i32,
)

Source from the content-addressed store, hash-verified

219/// Return a new table provider that has a single Int32 column with
220/// values between `seq_start` and `seq_end`
221pub fn table_with_sequence(
222 seq_start: i32,
223 seq_end: i32,
224) -> Result<Arc<dyn TableProvider>> {
225 let schema = Arc::new(Schema::new(vec![Field::new("i", DataType::Int32, true)]));
226 let arr = Arc::new(Int32Array::from((seq_start..=seq_end).collect::<Vec<_>>()));
227 let partitions = vec![vec![RecordBatch::try_new(
228 Arc::<Schema>::clone(&schema),
229 vec![arr as ArrayRef],
230 )?]];
231 Ok(Arc::new(MemTable::try_new(schema, partitions)?))
232}
233
234/// Return a RecordBatch with a single Int32 array with values (0..sz)
235pub fn make_partition(sz: i32) -> RecordBatch {

Callers 2

catalog_and_schema_testFunction · 0.85
cross_catalog_accessFunction · 0.85

Calls 1

newFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…