Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CREATE OR REPLACE TABLE #2605

Closed
alamb opened this issue May 24, 2022 · 1 comment · Fixed by #2613
Closed

Support CREATE OR REPLACE TABLE #2605

alamb opened this issue May 24, 2022 · 1 comment · Fixed by #2613
Labels
datafusion Changes in the datafusion crate enhancement New feature or request good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented May 24, 2022

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      |
@alamb alamb added enhancement New feature or request good first issue Good for newcomers datafusion Changes in the datafusion crate labels May 24, 2022
@HuSen8891
Copy link
Contributor

@alamb please review the patch/pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants