(&self, ctx: &SessionContext)
| 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, |
no test coverage detected