tustvold commented on code in PR #4679:
URL: https://github.com/apache/arrow-datafusion/pull/4679#discussion_r1053290242
##########
datafusion/core/src/execution/context.rs:
##########
@@ -254,7 +254,21 @@ impl SessionContext {
/// This method is `async` because queries of type `CREATE EXTERNAL TABLE`
/// might require the schema to be inferred.
pub async fn sql(&self, sql: &str) -> Result<DataFrame> {
- let plan = self.create_logical_plan(sql)?;
+ let mut statements = DFParser::parse_sql(sql)?;
+ if statements.len() != 1 {
+ return Err(DataFusionError::NotImplemented(
+ "The context currently only supports a single SQL
statement".to_string(),
+ ));
+ }
+
+ // create a query planner
+ let plan = {
+ // TODO: Move catalog off SessionState onto SessionContext
Review Comment:
This somewhat relates to #4607 but also serves avoids issues due to the
interior mutability of CatalogList
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]