You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/25 05:05:02 UTC

[GitHub] [arrow-datafusion] AssHero opened a new pull request, #2613: Support CREATE OR REPLACE TABLE

AssHero opened a new pull request, #2613:
URL: https://github.com/apache/arrow-datafusion/pull/2613

   # Which issue does this PR close?
   Closes  #2605 
   
    # Rationale for this change
   replace the table content if table already exits
   ❯ create table xx as values(1,2),(3,4);
   +---------+---------+
   | column1 | column2 |
   +---------+---------+
   | 1       | 2       |
   | 3       | 4       |
   +---------+---------+
   2 rows in set. Query took 0.004 seconds.
   
   ❯ create or replace table xx as values(5,6);
   +---------+---------+
   | column1 | column2 |
   +---------+---------+
   | 5       | 6       |
   +---------+---------+
   1 row in set. Query took 0.004 seconds.
   
   if 'if not exists' and 'or replace' are both specified, treat as 'or replace'
   ❯ create or replace table if not exists xx as values(7,8);
   +---------+---------+
   | column1 | column2 |
   +---------+---------+
   | 7       | 8       |
   +---------+---------+
   1 row in set. Query took 0.002 seconds.
   
   # What changes are included in this PR?
   adjust rules for create table in context.rs
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] AssHero commented on pull request #2613: Support CREATE OR REPLACE TABLE

Posted by GitBox <gi...@apache.org>.
AssHero commented on PR #2613:
URL: https://github.com/apache/arrow-datafusion/pull/2613#issuecomment-1137232352

   > 
   
   
   
   > > if 'if not exists' and 'or replace' are both specified, treat as 'or replace'
   > 
   > I personally feel weird about `IF NOT EXIST` coexist with `OR REPLACE`. They are asking for two different behaviors. Should we reject this kind of query like others ( [1](https://docs.microsoft.com/en-us/azure/databricks/sql/language-manual/sql-ref-syntax-ddl-create-table-using#parameters), [2](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#:~:text=collate_specification%5D%0A%5BOPTIONS(schema_option_list)%5D-,Arguments,-IF%20NOT%20EXISTS) )?
   
   'create or replace if not exists' is not supported in MySQL/PG, and is not permitted in databricks. 
   we can have a disscussion about how to deal with it.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] andygrove commented on pull request #2613: Support CREATE OR REPLACE TABLE

Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #2613:
URL: https://github.com/apache/arrow-datafusion/pull/2613#issuecomment-1137250052

   Thanks for the contribution @AssHero. I also would like to see `IF NOT EXISTS` and `OR REPLACE` as separate options that cannot be used together. LGTM otherwise.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb merged pull request #2613: Support CREATE OR REPLACE TABLE

Posted by GitBox <gi...@apache.org>.
alamb merged PR #2613:
URL: https://github.com/apache/arrow-datafusion/pull/2613


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] AssHero commented on pull request #2613: Support CREATE OR REPLACE TABLE

Posted by GitBox <gi...@apache.org>.
AssHero commented on PR #2613:
URL: https://github.com/apache/arrow-datafusion/pull/2613#issuecomment-1137352424

   > Thanks for the contribution @AssHero. I also would like to see `IF NOT EXISTS` and `OR REPLACE` as separate options that cannot be used together. LGTM otherwise.
   
    I'll separate the 'IF NOT EXISTS' and 'OR REPLACE', and report the error if both specified.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] AssHero commented on pull request #2613: Support CREATE OR REPLACE TABLE

Posted by GitBox <gi...@apache.org>.
AssHero commented on PR #2613:
URL: https://github.com/apache/arrow-datafusion/pull/2613#issuecomment-1137161024

   > @AssHero Thanks for your work 👍 Maybe you can add some test like
   > 
   > https://github.com/apache/arrow-datafusion/blob/0c4ffd4f7b064a8f4e4a167e2e4c913389056968/datafusion/core/tests/sql/create_drop.rs#L22-L46
   
   ok, i'll  add some test cases


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] waynexia commented on pull request #2613: Support CREATE OR REPLACE TABLE

Posted by GitBox <gi...@apache.org>.
waynexia commented on PR #2613:
URL: https://github.com/apache/arrow-datafusion/pull/2613#issuecomment-1136800236

   >if 'if not exists' and 'or replace' are both specified, treat as 'or replace'
   
   I personally feel weird about `IF NOT EXIST` coexist with `OR REPLACE`. They are asking for two different behaviors. Should we reject this kind of query like others ( [1](https://docs.microsoft.com/en-us/azure/databricks/sql/language-manual/sql-ref-syntax-ddl-create-table-using#parameters), [2](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#:~:text=collate_specification%5D%0A%5BOPTIONS(schema_option_list)%5D-,Arguments,-IF%20NOT%20EXISTS) )?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org