You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I would like to more cleanly separate the DDL (data definition) statements supported by DataFusion from the query execution.
Specifically, DataFusion offers basic support for "catalog" like operations such as registering external tables (CREATE EXTERNAL TABLE) , views (CREATE VIEW) and others. Some systems (like datafusion-cli or the tpch-benchmarks) use this basic support and others such as https://github.com/influxdata/influxdb_iox use DataFusion to query tables and views that are defined elsewhere.
The current support for catalog like operations is implemented as individual LogicalPlan variants such as LogicalPlan::CreateExternalTable
Adding support for a new statement (such as DROP TABLE, as in implement drop view #3267) results in a bunch of boiler plate that may not be needed
It is non-trivial to understand how to configure DataFusion so that it does not support CREATE VIEW or CREATE TABLE if that is not desired ( because, e.g. it would be a security hole - see this test):
Describe the solution you'd like
I would like to consolidate LogicalPlan::Create* and LogicalPlan::Drop* variants into a single LogicalPlan::DDL variant, and make a new DDLStatement enum like
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I would like to more cleanly separate the DDL (data definition) statements supported by DataFusion from the query execution.
Specifically, DataFusion offers basic support for "catalog" like operations such as registering external tables (
CREATE EXTERNAL TABLE) , views (CREATE VIEW) and others. Some systems (likedatafusion-clior thetpch-benchmarks) use this basic support and others such as https://github.com/influxdata/influxdb_iox use DataFusion to query tables and views that are defined elsewhere.The current support for catalog like operations is implemented as individual
LogicalPlanvariants such asLogicalPlan::CreateExternalTablehttps://github.com/apache/arrow-datafusion/blob/5621e3bbd050eeb79646240ec0a09426badfa162/datafusion/expr/src/logical_plan/plan.rs#L77-L90
This results in two potential issues:
DROP TABLE, as in implementdrop view#3267) results in a bunch of boiler plate that may not be neededCREATE VIEWorCREATE TABLEif that is not desired ( because, e.g. it would be a security hole - see this test):Describe the solution you'd like
I would like to consolidate
LogicalPlan::Create*andLogicalPlan::Drop*variants into a singleLogicalPlan::DDLvariant, and make a newDDLStatementenum likeDescribe alternatives you've considered
We can not make any changes (as this change would result in some API churn)
Additional context
See #3267 (comment)