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

Method register_tables

benchmarks/src/tpch/run.rs:216–237  ·  view source on GitHub ↗
(&self, ctx: &SessionContext)

Source from the content-addressed store, hash-verified

214 }
215
216 async fn register_tables(&self, ctx: &SessionContext) -> Result<()> {
217 for table in TPCH_TABLES {
218 let table_provider = { self.get_table(ctx, table).await? };
219
220 if self.mem_table {
221 println!("Loading table '{table}' into memory");
222 let start = Instant::now();
223 let memtable =
224 MemTable::load(table_provider, Some(self.partitions()), &ctx.state())
225 .await?;
226 println!(
227 "Loaded table '{}' into memory in {} ms",
228 table,
229 start.elapsed().as_millis()
230 );
231 ctx.register_table(*table, Arc::new(memtable))?;
232 } else {
233 ctx.register_table(*table, table_provider)?;
234 }
235 }
236 Ok(())
237 }
238
239 async fn execute_query(
240 &self,

Callers 3

runMethod · 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