(
mut self,
ctx: &dyn CliSessionContext,
print_options: &PrintOptions,
)
| 322 | } |
| 323 | |
| 324 | async fn create_and_execute_logical_plan( |
| 325 | mut self, |
| 326 | ctx: &dyn CliSessionContext, |
| 327 | print_options: &PrintOptions, |
| 328 | ) -> Result<(datafusion::dataframe::DataFrame, AdjustedPrintOptions)> { |
| 329 | let adjusted = AdjustedPrintOptions::new(print_options.clone()) |
| 330 | .with_statement(&self.statement); |
| 331 | |
| 332 | let plan = create_plan(ctx, self.statement, false).await?; |
| 333 | let adjusted = adjusted.with_plan(&plan); |
| 334 | |
| 335 | let df = match ctx.execute_logical_plan(plan).await { |
| 336 | Ok(df) => Ok(df), |
| 337 | Err(DataFusionError::ObjectStore(err)) |
| 338 | if matches!(err.as_ref(), Generic { store, source: _ } if "S3".eq_ignore_ascii_case(store)) |
| 339 | && self.statement_for_retry.is_some() => |
| 340 | { |
| 341 | warn!( |
| 342 | "S3 region is incorrect, auto-detecting the correct region (this may be slow). Consider updating your region configuration." |
| 343 | ); |
| 344 | let plan = |
| 345 | create_plan(ctx, self.statement_for_retry.take().unwrap(), true) |
| 346 | .await?; |
| 347 | ctx.execute_logical_plan(plan).await |
| 348 | } |
| 349 | Err(e) => Err(e), |
| 350 | }?; |
| 351 | |
| 352 | Ok((df, adjusted)) |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | /// Track adjustments to the print options based on the plan / statement being executed |
no test coverage detected