You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "catpineapple (via GitHub)" <gi...@apache.org> on 2023/07/14 09:39:09 UTC

[GitHub] [doris] catpineapple opened a new issue, #21834: [Feature] create or replace to overwrite table/view

catpineapple opened a new issue, #21834:
URL: https://github.com/apache/doris/issues/21834

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Description
   
   it`s not atomical
   
   ```
   drop view view_name;
   create view view_name as ...;
   ```
   
   we need  ``` create or replace ``` to overwrite atomically.
   Especially the following scenarios use:
   ```
   create or replace table as select ...
   create or replace view as select ...
   ```
   
   
   
   ### Use case
   
   create or replace table as select ...
   create or replace view as select ...
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscribe@doris.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] catpineapple commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "catpineapple (via GitHub)" <gi...@apache.org>.
catpineapple commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1659505202

   > 
   
   @davedwwang  insertOverwrite is not equal to fullRefresh!


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] davedwwang commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "davedwwang (via GitHub)" <gi...@apache.org>.
davedwwang commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1658199190

   @catpineapple 


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] davedwwang commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "davedwwang (via GitHub)" <gi...@apache.org>.
davedwwang commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1658124846

   @catpineapple Based on my understanding, it seems that we should support the "create or replace" syntax here. Since it mainly involves metadata modifications, it will only take effect after being written to editLog, so there is no need to introduce transactions. If @Tech-Circle-48 has not started development, I can give it a try.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] davedwwang commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "davedwwang (via GitHub)" <gi...@apache.org>.
davedwwang commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1659638798

   @catpineapple Thank you for your reply. I think insertOverwrite is not fullRefresh because of "create table like", which copies the original table structure. So, if I replace "create table like" with "create table" in the "create table like + insert into + alter table" sequence, then I should be able to avoid introducing transaction, right?


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] Tech-Circle-48 commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "Tech-Circle-48 (via GitHub)" <gi...@apache.org>.
Tech-Circle-48 commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1635591794

   这个issue我来接


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] Tech-Circle-48 commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "Tech-Circle-48 (via GitHub)" <gi...@apache.org>.
Tech-Circle-48 commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1675797850

   I'm in development 


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] di99 commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "di99 (via GitHub)" <gi...@apache.org>.
di99 commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1637530515

   For view, `create view if not exists as` and `alter view as xxxx` can overwrite view statement;


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] davedwwang commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "davedwwang (via GitHub)" <gi...@apache.org>.
davedwwang commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1659495379

   @catpineapple I believe that transaction are not necessary.I looked at the implementation of "insert overwrite table", which is done through "create table like + insert into + alter table". Can "create or replace" be handled similarly? When the table does not exist, use "createTableStmt"; when the table exists, use "insertOverwriteStmt".


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] catpineapple commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "catpineapple (via GitHub)" <gi...@apache.org>.
catpineapple commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1658163699

   > @catpineapple Based on my understanding, it seems that we should support the "create or replace" syntax here. Since it mainly involves metadata modifications, it will only take effect after being written to editLog, so there is no need to introduce transactions. If @Tech-Circle-48 has not started development, I can give it a try.
   
   @davedwwang  The `ctas` statement must be a transaction.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] Tech-Circle-48 commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "Tech-Circle-48 (via GitHub)" <gi...@apache.org>.
Tech-Circle-48 commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1670656036

   #21834


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] davedwwang commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "davedwwang (via GitHub)" <gi...@apache.org>.
davedwwang commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1658201188

   @catpineapple Thank you for your reply. If I want to implement this requirement, the following tasks need to be done:
   
   1、Add a new syntax for "create or replace table/view as select".
   2、"create or replace table/view as select" is a transaction because when the table/view exists, it involves two actions: delete and create. The atomicity of these actions needs to be guaranteed. Is this correct?


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] davedwwang commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "davedwwang (via GitHub)" <gi...@apache.org>.
davedwwang commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1658199573

   @Thank you for your reply. If I want to implement this requirement, the following tasks need to be done:
   
   Add a new syntax for "create or replace table/view as select".
   "create or replace table/view as select" is a transaction because when the table/view exists, it involves two actions: create and replace. The atomicity of these actions needs to be guaranteed. Is this correct?


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] di99 commented on issue #21834: [Feature] create or replace to overwrite table/view

Posted by "di99 (via GitHub)" <gi...@apache.org>.
di99 commented on issue #21834:
URL: https://github.com/apache/doris/issues/21834#issuecomment-1637529890

   For view, ``create view if not exists as ` and `alter view as xxxx` can overwrite view statement;


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org