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

Function create_context

datafusion/core/benches/topk_aggregate.rs:77–95  ·  view source on GitHub ↗
(
    partition_cnt: i32,
    sample_cnt: i32,
    asc: bool,
    use_topk: bool,
    use_view: bool,
)

Source from the content-addressed store, hash-verified

75}
76
77async fn create_context(
78 partition_cnt: i32,
79 sample_cnt: i32,
80 asc: bool,
81 use_topk: bool,
82 use_view: bool,
83) -> Result<SessionContext> {
84 let (schema, parts) = make_data(partition_cnt, sample_cnt, asc, use_view).unwrap();
85 let mem_table = Arc::new(MemTable::try_new(schema, parts).unwrap());
86
87 // Create the DataFrame
88 let mut cfg = SessionConfig::new();
89 let opts = cfg.options_mut();
90 opts.optimizer.enable_topk_aggregation = use_topk;
91 let ctx = SessionContext::new_with_config(cfg);
92 let _ = ctx.register_table("traces", mem_table)?;
93
94 Ok(ctx)
95}
96
97async fn create_context_distinct(
98 partition_cnt: i32,

Callers 2

criterion_benchmarkFunction · 0.70

Calls 4

make_dataFunction · 0.85
newFunction · 0.85
options_mutMethod · 0.80
register_tableMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…