alamb commented on issue #4426: URL: https://github.com/apache/arrow-datafusion/issues/4426#issuecomment-1335845164
The current functionality split works like this: `SessionContext::create_logical_plan` creates a `LogicalPlan` for DDL statements like `CREATE EXTERNAL TABLE` and `CREATE VIEW` However, `SessionContext::create_physical_plan` can not create an execution plan for such statements (it errors if you try) Instead, `SessionContext::sql` provides some basic implementation for the DDL statements. https://github.com/apache/arrow-datafusion/blob/40e44a64f51438ea8eae7112828ef116409a15f0/datafusion/core/src/execution/context.rs#L251-L481 So if DataFusion users want the basic implementations, they can use `SessionContext::sql` If they want to control / disallow such statements (as we do in IOx, for example), instead one uses the lower level APIs to create the physical plan directly. I think this is a reasonable model and suggest we follow the same pattern with prepared statements `CreatePlan` and `ExecutePlan` as described by @metesynnada If someone is feeling ambitious, they could try and consolidate the DDL variants to make this split clearer: https://github.com/apache/arrow-datafusion/issues/3349 -- 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]
