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

Method register_tables

benchmarks/src/imdb/run.rs:356–377  ·  view source on GitHub ↗
(&self, ctx: &SessionContext)

Source from the content-addressed store, hash-verified

354 }
355
356 async fn register_tables(&self, ctx: &SessionContext) -> Result<()> {
357 for table in IMDB_TABLES {
358 let table_provider = { self.get_table(ctx, table).await? };
359
360 if self.mem_table {
361 println!("Loading table '{table}' into memory");
362 let start = Instant::now();
363 let memtable =
364 MemTable::load(table_provider, Some(self.partitions()), &ctx.state())
365 .await?;
366 println!(
367 "Loaded table '{}' into memory in {} ms",
368 table,
369 start.elapsed().as_millis()
370 );
371 ctx.register_table(*table, Arc::new(memtable))?;
372 } else {
373 ctx.register_table(*table, table_provider)?;
374 }
375 }
376 Ok(())
377 }
378
379 async fn execute_query(
380 &self,

Callers 3

benchmark_queryMethod · 0.45
round_trip_logical_planFunction · 0.45
round_trip_physical_planFunction · 0.45

Calls 5

newFunction · 0.85
get_tableMethod · 0.45
partitionsMethod · 0.45
stateMethod · 0.45
register_tableMethod · 0.45

Tested by

no test coverage detected