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

Function fruit_table

datafusion/ffi/src/tests/catalog.rs:50–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50pub fn fruit_table() -> Arc<dyn TableProvider + 'static> {
51 use arrow::datatypes::{DataType, Field};
52 use datafusion_common::record_batch;
53
54 let schema = Arc::new(Schema::new(vec![
55 Field::new("units", DataType::Int32, true),
56 Field::new("price", DataType::Float64, true),
57 ]));
58
59 let partitions = vec![
60 record_batch!(
61 ("units", Int32, vec![10, 20, 30]),
62 ("price", Float64, vec![1.0, 2.0, 5.0])
63 )
64 .unwrap(),
65 record_batch!(
66 ("units", Int32, vec![5, 7]),
67 ("price", Float64, vec![1.5, 2.5])
68 )
69 .unwrap(),
70 ];
71
72 Arc::new(MemTable::try_new(schema, vec![partitions]).unwrap())
73}
74
75impl Default for FixedSchemaProvider {
76 fn default() -> Self {

Callers 1

defaultMethod · 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…