You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/04/21 02:19:01 UTC

[GitHub] [incubator-doris] lide-reed opened a new issue, #9143: [Enhancement] Let "create table as ... select" statement could insert data which query from select statement

lide-reed opened a new issue, #9143:
URL: https://github.com/apache/incubator-doris/issues/9143

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Description
   
    Now in  Doris, the statement "create table as ... select" only create table and can not insert data, it is not comply with the statement's real semantic logic.
   
   ### Solution
   
   _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] [incubator-doris] long2ice commented on issue #9143: [Enhancement] Let "create table as ... select" statement could insert data which query from select statement

Posted by GitBox <gi...@apache.org>.
long2ice commented on issue #9143:
URL: https://github.com/apache/incubator-doris/issues/9143#issuecomment-1118582993

   In addition, the columns of created table can be same as origin? Because if I create table with list partition, the error always occur, since the columns of created table are always `null` able
   ```
   [HY000][1105] errCode = 2, detailMessage = Failed to execute CREATE TABLE AS SELECT Reason: errCode = 2, detailMessage = The list partition column must be NOT NULL
   ```


-- 
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] [incubator-doris] stalary commented on issue #9143: [Enhancement] Let "create table as ... select" statement could insert data which query from select statement

Posted by GitBox <gi...@apache.org>.
stalary commented on issue #9143:
URL: https://github.com/apache/incubator-doris/issues/9143#issuecomment-1118588079

   > In addition, the columns of created table can be same as origin? Because if I create table with list partition, the error always occur, since the columns of created table are always `null` able
   > 
   > ```
   > [HY000][1105] errCode = 2, detailMessage = Failed to execute CREATE TABLE AS SELECT Reason: errCode = 2, detailMessage = The list partition column must be NOT NULL
   > ```
   
   create table is fully reusable and please post your complete SQL.


-- 
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] [incubator-doris] long2ice commented on issue #9143: [Enhancement] Let "create table as ... select" statement could insert data which query from select statement

Posted by GitBox <gi...@apache.org>.
long2ice commented on issue #9143:
URL: https://github.com/apache/incubator-doris/issues/9143#issuecomment-1118590305

   origin table:
   ```sql
   CREATE TABLE `country_codes` (
     `country_code` varchar(2) NOT NULL COMMENT "",
     `country_name` varchar(32) NOT NULL COMMENT "",
     `calling_code` int(11) NOT NULL COMMENT ""
   ) ENGINE=OLAP
   DUPLICATE KEY(`country_code`)
   COMMENT "OLAP"
   DISTRIBUTED BY HASH(`country_code`, `country_name`, `calling_code`) BUCKETS 1
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "in_memory" = "false",
   "storage_format" = "V2"
   )
   ```
   create  table:
   ```sql
   create table `gaia_test`.`test_incremental` PARTITION BY LIST (country_code)(PARTITION p1 values in ("CA","GB","US","ZH")) PROPERTIES ("replication_num" = "1") as select
   *
   from gaia_test.country_codes;
   ```


-- 
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] [incubator-doris] stalary commented on issue #9143: [Enhancement] Let "create table as ... select" statement could insert data which query from select statement

Posted by GitBox <gi...@apache.org>.
stalary commented on issue #9143:
URL: https://github.com/apache/incubator-doris/issues/9143#issuecomment-1109865707

   Assign it to me. I did `insert into select` before, and I was only halfway done. I will perfect him in the near future


-- 
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] [incubator-doris] long2ice commented on issue #9143: [Enhancement] Let "create table as ... select" statement could insert data which query from select statement

Posted by GitBox <gi...@apache.org>.
long2ice commented on issue #9143:
URL: https://github.com/apache/incubator-doris/issues/9143#issuecomment-1119323340

   OK


-- 
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] [incubator-doris] yiguolei closed issue #9143: [Enhancement] Let "create table as ... select" statement could insert data which query from select statement

Posted by GitBox <gi...@apache.org>.
yiguolei closed issue #9143: [Enhancement] Let "create table as ... select" statement could insert data which query from select statement
URL: https://github.com/apache/incubator-doris/issues/9143


-- 
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] [incubator-doris] stalary commented on issue #9143: [Enhancement] Let "create table as ... select" statement could insert data which query from select statement

Posted by GitBox <gi...@apache.org>.
stalary commented on issue #9143:
URL: https://github.com/apache/incubator-doris/issues/9143#issuecomment-1119319269

   The field was not copied not null. I will fix it later. @long2ice 
   ```java
   if (!ConnectContext.get().getSessionVariable().isAllowPartitionColumnNullable()
                               && columnDef.isAllowNull()) {
                           throw new AnalysisException("The partition column must be NOT NULL");
                       }
   ```


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