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

Function copy_to_table_test

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

Source from the content-addressed store, hash-verified

551 }
552
553 async fn copy_to_table_test(location: &str, sql: &str) -> Result<()> {
554 let ctx = SessionContext::new();
555 // AWS CONFIG register.
556
557 let plan = ctx.state().create_logical_plan(sql).await?;
558
559 if let LogicalPlan::Copy(cmd) = &plan {
560 let format = config_file_type_from_str(&cmd.file_type.get_ext());
561 register_object_store_and_config_extensions(
562 &ctx,
563 &cmd.output_url,
564 &cmd.options,
565 format,
566 false,
567 )
568 .await?;
569 } else {
570 return plan_err!("LogicalPlan is not a CreateExternalTable");
571 }
572
573 // Ensure the URL is supported by the object store
574 ctx.runtime_env()
575 .object_store(ListingTableUrl::parse(location)?)?;
576
577 Ok(())
578 }
579
580 #[tokio::test]
581 async fn create_object_store_table_http() -> Result<()> {

Callers 1

Calls 8

newFunction · 0.85
create_logical_planMethod · 0.80
stateMethod · 0.45
get_extMethod · 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…