Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions datafusion/core/src/execution/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2576,6 +2576,43 @@ mod tests {
Ok(())
}

#[tokio::test]
async fn unsupported_sql_returns_error() -> Result<()> {
let ctx = SessionContext::new();
ctx.register_table("test", test::table_with_sequence(1, 1).unwrap())
.unwrap();
let state = ctx.state();

// create view
let sql = "create view test_view as select * from test";
let plan = state.create_logical_plan(sql).await;
let physical_plan = state.create_physical_plan(&plan.unwrap()).await;
assert!(physical_plan.is_err());
assert_eq!(
format!("{}", physical_plan.unwrap_err()),
"This feature is not implemented: Unsupported logical plan: CreateView"
);
// // drop view
let sql = "drop view test_view";
let plan = state.create_logical_plan(sql).await;
let physical_plan = state.create_physical_plan(&plan.unwrap()).await;
assert!(physical_plan.is_err());
assert_eq!(
format!("{}", physical_plan.unwrap_err()),
"This feature is not implemented: Unsupported logical plan: DropView"
);
// // drop table
let sql = "drop table test";
let plan = state.create_logical_plan(sql).await;
let physical_plan = state.create_physical_plan(&plan.unwrap()).await;
assert!(physical_plan.is_err());
assert_eq!(
format!("{}", physical_plan.unwrap_err()),
"This feature is not implemented: Unsupported logical plan: DropTable"
);
Ok(())
}

struct MyPhysicalPlanner {}

#[async_trait]
Expand Down
54 changes: 0 additions & 54 deletions datafusion/core/tests/sql/errors.rs

This file was deleted.

1 change: 0 additions & 1 deletion datafusion/core/tests/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ pub mod aggregates;
#[cfg(feature = "avro")]
pub mod avro;
pub mod create_drop;
pub mod errors;
pub mod explain_analyze;
pub mod expr;
pub mod functions;
Expand Down