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