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,
)
| 219 | /// Return a new table provider that has a single Int32 column with |
| 220 | /// values between `seq_start` and `seq_end` |
| 221 | pub 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) |
| 235 | pub fn make_partition(sz: i32) -> RecordBatch { |
no test coverage detected
searching dependent graphs…