[typo](docs) add a create table as select sample (#21078)

This commit is contained in:
yagagagaga
2023-06-26 19:27:05 +08:00
committed by GitHub
parent eb2a08bdf2
commit 05d94e5a4c
2 changed files with 30 additions and 0 deletions

View File

@ -80,6 +80,21 @@ illustrate:
from `test`.`varchar_table` vt join
`test`.`join_table` jt on vt.userId=jt.userId
```
3. Specify table model, partitions, and buckets
```sql
CREATE TABLE t_user(dt, id, name)
ENGINE=OLAP
UNIQUE KEY(dt, id)
COMMENT "OLAP"
PARTITION BY RANGE(dt)
(
FROM ("2020-01-01") TO ("2021-12-31") INTERVAL 1 YEAR
)
DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES("replication_num"="1")
AS SELECT cast('2020-05-20' as date) as dt, 1 as id, 'Tom' as name;
```
### Keywords

View File

@ -80,6 +80,21 @@ CREATE TABLE table_name [( column_name_list )]
from `test`.`varchar_table` vt join
`test`.`join_table` jt on vt.userId=jt.userId
```
3. 指定表模型、分区、分桶
```sql
CREATE TABLE t_user(dt, id, name)
ENGINE=OLAP
UNIQUE KEY(dt, id)
COMMENT "OLAP"
PARTITION BY RANGE(dt)
(
FROM ("2020-01-01") TO ("2021-12-31") INTERVAL 1 YEAR
)
DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES("replication_num"="1")
AS SELECT cast('2020-05-20' as date) as dt, 1 as id, 'Tom' as name;
```
### Keywords