[doc] add create table statement for create-materialized-view doc (#10029)

This commit is contained in:
zy-kkk
2022-06-09 20:16:46 -05:00
committed by GitHub
parent 1a31af0d85
commit 98c214e43a
2 changed files with 24 additions and 0 deletions

View File

@ -102,6 +102,18 @@ mysql> desc duplicate_table;
| k4 | BIGINT | Yes | true | N/A | |
+-------+--------+------+------+---------+-------+
````
```sql
create table duplicate_table(
k1 int null,
k2 int null,
k3 bigint null,
k4 bigint null
)
duplicate key (k1,k2,k3,k4)
distributed BY hash(k4) buckets 3
properties("replication_num" = "1");
```
attention:The partition and distributed columns must be key column in mv
1. Create a materialized view that contains only the columns of the original table (k1, k2)

View File

@ -102,6 +102,18 @@ mysql> desc duplicate_table;
| k4 | BIGINT | Yes | true | N/A | |
+-------+--------+------+------+---------+-------+
```
```sql
create table duplicate_table(
k1 int null,
k2 int null,
k3 bigint null,
k4 bigint null
)
duplicate key (k1,k2,k3,k4)
distributed BY hash(k4) buckets 3
properties("replication_num" = "1");
```
注意:分区列和分桶列必须作为物化视图中的key列
1. 创建一个仅包含原始表 (k1, k2)列的物化视图