Skip to content

Support CREATE OR REPLACE TABLE  #2605

@alamb

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
DataFusion already supports CREATE TABLE AS SELECT

When working with tables it is nice to be able to replace them when they already exist

Describe the solution you'd like

I would like the following SQL to run rather than produce an error:

❯ CREATE TABLE valuetable AS VALUES(1,'HELLO'),(12,'DATAFUSION');
+---------+------------+
| column1 | column2    |
+---------+------------+
| 1       | HELLO      |
| 12      | DATAFUSION |
+---------+------------+
2 rows in set. Query took 0.016 seconds.
❯ CREATE OR REPLACE TABLE valuetable AS VALUES(1,'HELLO THERE');
Execution("Table '\"valuetable\"' already exists")

The result should be that valuetable now contains a single row 👍

+---------+------------+
| column1 | column2    |
+---------+------------+
| 1       | HELLO THERE      |

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions