MCPcopy Create free account
hub / github.com/apache/datafusion / create_external_table_test

Function create_external_table_test

datafusion-cli/src/exec.rs:528–551  ·  view source on GitHub ↗
(location: &str, sql: &str)

Source from the content-addressed store, hash-verified

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();

Calls 7

newFunction · 0.85
create_logical_planMethod · 0.80
stateMethod · 0.45
object_storeMethod · 0.45
runtime_envMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…