diff --git a/datafusion/core/src/execution/session_state.rs b/datafusion/core/src/execution/session_state.rs index 60745076c242..dbfba9ea9352 100644 --- a/datafusion/core/src/execution/session_state.rs +++ b/datafusion/core/src/execution/session_state.rs @@ -554,9 +554,7 @@ impl SessionState { ); } let statement = statements.pop_front().ok_or_else(|| { - DataFusionError::NotImplemented( - "No SQL statements were provided in the query string".to_string(), - ) + plan_datafusion_err!("No SQL statements were provided in the query string") })?; Ok(statement) } diff --git a/datafusion/core/tests/sql/sql_api.rs b/datafusion/core/tests/sql/sql_api.rs index e7c40d2c8aa8..48f4a66b65dc 100644 --- a/datafusion/core/tests/sql/sql_api.rs +++ b/datafusion/core/tests/sql/sql_api.rs @@ -124,7 +124,7 @@ async fn empty_statement_returns_error() { let plan_res = state.create_logical_plan("").await; assert_eq!( plan_res.unwrap_err().strip_backtrace(), - "This feature is not implemented: No SQL statements were provided in the query string" + "Error during planning: No SQL statements were provided in the query string" ); }