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

Function create_drop_table

datafusion/core/tests/sql/create_drop.rs:71–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69
70#[tokio::test]
71async fn create_drop_table() -> Result<()> {
72 let ctx = SessionContext::new();
73
74 let sql = "CREATE TABLE dt (a_id integer, a_str string, a_bool boolean);";
75 ctx.sql(sql).await.unwrap();
76
77 let cat = ctx.catalog("datafusion").unwrap();
78 let schema = cat.schema("public").unwrap();
79
80 let exists = schema.table_exist("dt");
81 assert!(exists, "Table should have been created!");
82
83 // Drop the table
84 let sql = "DROP TABLE dt;";
85 ctx.sql(sql).await.unwrap();
86
87 let exists = schema.table_exist("dt");
88 assert!(!exists, "Table should have been dropped!");
89
90 Ok(())
91}

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
sqlMethod · 0.80
catalogMethod · 0.45
schemaMethod · 0.45
table_existMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…