(location: &str, sql: &str)
| 526 | use url::Url; |
| 527 | |
| 528 | async fn create_external_table_test(location: &str, sql: &str) -> Result<()> { |
| 529 | let ctx = SessionContext::new(); |
| 530 | let plan = ctx.state().create_logical_plan(sql).await?; |
| 531 | |
| 532 | if let LogicalPlan::Ddl(DdlStatement::CreateExternalTable(cmd)) = &plan { |
| 533 | let format = config_file_type_from_str(&cmd.file_type); |
| 534 | register_object_store_and_config_extensions( |
| 535 | &ctx, |
| 536 | &cmd.location, |
| 537 | &cmd.options, |
| 538 | format, |
| 539 | false, |
| 540 | ) |
| 541 | .await?; |
| 542 | } else { |
| 543 | return plan_err!("LogicalPlan is not a CreateExternalTable"); |
| 544 | } |
| 545 | |
| 546 | // Ensure the URL is supported by the object store |
| 547 | ctx.runtime_env() |
| 548 | .object_store(ListingTableUrl::parse(location)?)?; |
| 549 | |
| 550 | Ok(()) |
| 551 | } |
| 552 | |
| 553 | async fn copy_to_table_test(location: &str, sql: &str) -> Result<()> { |
| 554 | let ctx = SessionContext::new(); |
no test coverage detected
searching dependent graphs…