(
&self,
ctx: &SessionContext,
table: &str,
)
| 303 | } |
| 304 | |
| 305 | async fn get_table( |
| 306 | &self, |
| 307 | ctx: &SessionContext, |
| 308 | table: &str, |
| 309 | ) -> Result<Arc<dyn TableProvider>> { |
| 310 | let path = self.path.to_str().unwrap(); |
| 311 | |
| 312 | // Obtain a snapshot of the SessionState |
| 313 | let state = ctx.state(); |
| 314 | let path = format!("{path}/{table}"); |
| 315 | let format = Arc::new( |
| 316 | ParquetFormat::default() |
| 317 | .with_options(ctx.state().table_options().parquet.clone()), |
| 318 | ); |
| 319 | let extension = DEFAULT_PARQUET_EXTENSION; |
| 320 | |
| 321 | let options = ListingOptions::new(format) |
| 322 | .with_file_extension(extension) |
| 323 | .with_collect_stat(state.config().collect_statistics()); |
| 324 | |
| 325 | let table_path = ListingTableUrl::parse(path)?; |
| 326 | let config = ListingTableConfig::new(table_path).with_listing_options(options); |
| 327 | let config = config.infer_schema(&state).await?; |
| 328 | |
| 329 | Ok(Arc::new(ListingTable::try_new(config)?.with_cache( |
| 330 | ctx.runtime_env().cache_manager.get_file_statistic_cache(), |
| 331 | ))) |
| 332 | } |
| 333 | |
| 334 | fn iterations(&self) -> usize { |
| 335 | self.common.iterations |
no test coverage detected