matthewmturner opened a new issue #1877:
URL: https://github.com/apache/arrow-datafusion/issues/1877


   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   A clear and concise description of what the problem is. Ex. I'm always 
frustrated when [...] 
   (This section helps Arrow developers understand the context and *why* for 
this feature, in addition to  the *what*)
   
   Right now there is limited schema and catalog support in sql.  You have to 
be using language bindings and register the catalog / schema to the 
`ExecutionContext` before being able to select.  I would like to be able to 
create schemas and catalogs from sql, without language bindings, so that its 
easier to manage ddl and do data analysis just using datafusion-cli.
    
   ```
   DataFusion CLI v7.0.0
   ❯ CREATE TABLE sch.tbl AS VALUES (1,2,3);
   0 rows in set. Query took 0.032 seconds.
   ❯ show tables;
   +---------------+--------------------+------------+------------+
   | table_catalog | table_schema       | table_name | table_type |
   +---------------+--------------------+------------+------------+
   | datafusion    | public             | sch.tbl    | BASE TABLE |
   | datafusion    | information_schema | tables     | VIEW       |
   | datafusion    | information_schema | columns    | VIEW       |
   +---------------+--------------------+------------+------------+
   3 rows in set. Query took 0.015 seconds.
   ❯ CREATE TABLE cat.sch.tbl AS VALUES (1,2,3);
   0 rows in set. Query took 0.003 seconds.
   ❯ show tables;
   +---------------+--------------------+-------------+------------+
   | table_catalog | table_schema       | table_name  | table_type |
   +---------------+--------------------+-------------+------------+
   | datafusion    | public             | cat.sch.tbl | BASE TABLE |
   | datafusion    | public             | sch.tbl     | BASE TABLE |
   | datafusion    | information_schema | tables      | VIEW       |
   | datafusion    | information_schema | columns     | VIEW       |
   +---------------+--------------------+-------------+------------+
   4 rows in set. Query took 0.006 seconds.
   ```
   
   ```
   ❯ CREATE SCHEMA abc;
   NotImplemented("Unsupported SQL statement: CreateSchema { schema_name: 
ObjectName([Ident { value: \"abc\", quote_style: None }]), if_not_exists: false 
}")
   ```
   
   ```
   CREATE CATALOG xyz;  🤔 Invalid statement: sql parser error: Expected an 
object type after CREATE, found: CATALOG
   ```
   
   **Describe the solution you'd like**
   A clear and concise description of what you want to happen.
   Support the following sql statements:
   - `CREATE CATALOG abc`
   - `CREATE SCHEMA xyz`
   - Parse catalog and schema from `CREATE TABLE abc.xyz.tbl` instead of 
creating table `
   
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features 
you've considered.
   
   **Additional context**
   Add any other context or screenshots about the feature request here.
   Postgres reference here
   https://www.postgresql.org/docs/9.3/sql-createschema.html
   
   


-- 
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]


Reply via email to