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

Function create_context

datafusion/core/benches/dataframe.rs:28–41  ·  view source on GitHub ↗
(field_count: u32)

Source from the content-addressed store, hash-verified

26use tokio::runtime::Runtime;
27
28fn create_context(field_count: u32) -> datafusion_common::Result<Arc<SessionContext>> {
29 let mut fields = vec![];
30 for i in 0..field_count {
31 fields.push(Field::new(format!("str{i}"), DataType::Utf8, true))
32 }
33
34 let schema = Arc::new(Schema::new(fields));
35 let ctx = SessionContext::new();
36 let table = MemTable::try_new(Arc::clone(&schema), vec![vec![]])?;
37
38 ctx.register_table("t", Arc::new(table))?;
39
40 Ok(Arc::new(ctx))
41}
42
43#[expect(clippy::needless_pass_by_value)]
44fn run(column_count: u32, ctx: Arc<SessionContext>, rt: &Runtime) {

Callers 1

criterion_benchmarkFunction · 0.70

Calls 3

newFunction · 0.85
pushMethod · 0.45
register_tableMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…