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

Method register_tables

benchmarks/src/sort_tpch.rs:258–279  ·  view source on GitHub ↗
(&self, ctx: &SessionContext)

Source from the content-addressed store, hash-verified

256 }
257
258 async fn register_tables(&self, ctx: &SessionContext) -> Result<()> {
259 for table in Self::SORT_TABLES {
260 let table_provider = { self.get_table(ctx, table).await? };
261
262 if self.mem_table {
263 println!("Loading table '{table}' into memory");
264 let start = Instant::now();
265 let memtable =
266 MemTable::load(table_provider, Some(self.partitions()), &ctx.state())
267 .await?;
268 println!(
269 "Loaded table '{}' into memory in {} ms",
270 table,
271 start.elapsed().as_millis()
272 );
273 ctx.register_table(table, Arc::new(memtable))?;
274 } else {
275 ctx.register_table(table, table_provider)?;
276 }
277 }
278 Ok(())
279 }
280
281 async fn execute_query(&self, ctx: &SessionContext, sql: &str) -> Result<usize> {
282 let debug = self.common.debug;

Callers 1

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