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