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/05/01 03:25:50 UTC
[GitHub] [incubator-doris] stalary commented on pull request #9271: [Feature] CTAS support insert data
stalary commented on PR #9271:
URL: https://github.com/apache/incubator-doris/pull/9271#issuecomment-1114118084
The current verification results are as follows
```sql
mysql> CREATE TABLE `table1` ( `id` int NOT NULL, `col1` varchar(255) NOT NULL, `col2` varchar(255) NOT NULL) ENGINE = OLAP UNIQUE KEY(`id`) COMMENT "测试表1" DISTRIBUTED BY HASH(`id`) BUCKETS 10
-> PROPERTIES (
-> "replication_num" = "1",
-> "in_memory" = "false",
-> "storage_format" = "V2"
-> );
Query OK, 0 rows affected (0.12 sec)
```
```sql
mysql> insert into table1
-> values (1, 'col1_1', 'col2_1'),
-> (2, 'col1_2', 'col2_2'),
-> (3, 'col1_3', 'col2_3'),
-> (4, 'col1_4', 'col2_4'),
-> (5, 'col1_5', 'col2_5');
Query OK, 5 rows affected (0.09 sec)
{'label':'insert_c02d578bd5434d53-b69baa4bfeb08377', 'status':'VISIBLE', 'txnId':'1003'}
```
```sql
mysql> create table table_ctas PROPERTIES ("replication_num" = "1") as select * from table1;
Query OK, 5 rows affected (0.21 sec)
{'label':'insert_e5cb0d80b2d0407f-9d659c4f7c885751', 'status':'VISIBLE', 'txnId':'1004'}
```
```sql
mysql> select *
-> from table_ctas;
+------+--------+--------+
| id | col1 | col2 |
+------+--------+--------+
| 3 | col1_3 | col2_3 |
| 2 | col1_2 | col2_2 |
| 5 | col1_5 | col2_5 |
| 4 | col1_4 | col2_4 |
| 1 | col1_1 | col2_1 |
+------+--------+--------+
5 rows in set (0.02 sec)
```
--
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