Skip to content

Commit 5fd98ea

Browse files
authored
[Fix][Doc] Fixed typography error in starrocks sink document (#6579)
1 parent 2b1234c commit 5fd98ea

File tree

2 files changed

+52
-46
lines changed

2 files changed

+52
-46
lines changed

Diff for: docs/en/connector-v2/sink/Doris.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,20 @@ We use templates to automatically create Doris tables,
7373
which will create corresponding table creation statements based on the type of upstream data and schema type,
7474
and the default template can be modified according to the situation.
7575

76+
Default template:
77+
7678
```sql
77-
CREATE TABLE IF NOT EXISTS `${database}`.`${table_name}`
78-
(
79-
${rowtype_fields}
80-
) ENGINE = OLAP UNIQUE KEY (${rowtype_primary_key})
81-
DISTRIBUTED BY HASH (${rowtype_primary_key})
82-
PROPERTIES
83-
(
84-
"replication_num" = "1"
85-
);
79+
CREATE TABLE IF NOT EXISTS `${database}`.`${table_name}` (
80+
${rowtype_fields}
81+
) ENGINE=OLAP
82+
UNIQUE KEY (${rowtype_primary_key})
83+
DISTRIBUTED BY HASH (${rowtype_primary_key})
84+
PROPERTIES (
85+
"replication_allocation" = "tag.location.default: 1",
86+
"in_memory" = "false",
87+
"storage_format" = "V2",
88+
"disable_auto_compaction" = "false"
89+
)
8690
```
8791

8892
If a custom field is filled in the template, such as adding an `id` field

Diff for: docs/en/connector-v2/sink/StarRocks.md

+39-37
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,45 @@ We use templates to automatically create starrocks tables,
4848
which will create corresponding table creation statements based on the type of upstream data and schema type,
4949
and the default template can be modified according to the situation. Only work on multi-table mode at now.
5050

51+
Default template:
52+
53+
```sql
54+
CREATE TABLE IF NOT EXISTS `${database}`.`${table_name}` (
55+
${rowtype_primary_key},
56+
${rowtype_fields}
57+
) ENGINE=OLAP
58+
PRIMARY KEY (${rowtype_primary_key})
59+
DISTRIBUTED BY HASH (${rowtype_primary_key})PROPERTIES (
60+
"replication_num" = "1"
61+
)
62+
```
63+
64+
If a custom field is filled in the template, such as adding an `id` field
65+
66+
```sql
67+
CREATE TABLE IF NOT EXISTS `${database}`.`${table_name}`
68+
(
69+
id,
70+
${rowtype_fields}
71+
) ENGINE = OLAP DISTRIBUTED BY HASH (${rowtype_primary_key})
72+
PROPERTIES
73+
(
74+
"replication_num" = "1"
75+
);
76+
```
77+
78+
The connector will automatically obtain the corresponding type from the upstream to complete the filling,
79+
and remove the id field from `rowtype_fields`. This method can be used to customize the modification of field types and attributes.
80+
81+
You can use the following placeholders
82+
83+
- database: Used to get the database in the upstream schema
84+
- table_name: Used to get the table name in the upstream schema
85+
- rowtype_fields: Used to get all the fields in the upstream schema, we will automatically map to the field
86+
description of StarRocks
87+
- rowtype_primary_key: Used to get the primary key in the upstream schema (maybe a list)
88+
- rowtype_unique_key: Used to get the unique key in the upstream schema (maybe a list)
89+
5190
### table [string]
5291

5392
Use `database` and this `table-name` auto-generate sql and receive upstream input datas write to database.
@@ -82,43 +121,6 @@ Option introduction:
82121

83122
When data_save_mode selects CUSTOM_PROCESSING, you should fill in the CUSTOM_SQL parameter. This parameter usually fills in a SQL that can be executed. SQL will be executed before synchronization tasks.
84123

85-
```sql
86-
CREATE TABLE IF NOT EXISTS `${database}`.`${table_name}`
87-
(
88-
${rowtype_fields}
89-
) ENGINE = OLAP DISTRIBUTED BY HASH (${rowtype_primary_key})
90-
PROPERTIES
91-
(
92-
"replication_num" = "1"
93-
);
94-
```
95-
96-
If a custom field is filled in the template, such as adding an `id` field
97-
98-
```sql
99-
CREATE TABLE IF NOT EXISTS `${database}`.`${table_name}`
100-
(
101-
id,
102-
${rowtype_fields}
103-
) ENGINE = OLAP DISTRIBUTED BY HASH (${rowtype_primary_key})
104-
PROPERTIES
105-
(
106-
"replication_num" = "1"
107-
);
108-
```
109-
110-
The connector will automatically obtain the corresponding type from the upstream to complete the filling,
111-
and remove the id field from `rowtype_fields`. This method can be used to customize the modification of field types and attributes.
112-
113-
You can use the following placeholders
114-
115-
- database: Used to get the database in the upstream schema
116-
- table_name: Used to get the table name in the upstream schema
117-
- rowtype_fields: Used to get all the fields in the upstream schema, we will automatically map to the field
118-
description of StarRocks
119-
- rowtype_primary_key: Used to get the primary key in the upstream schema (maybe a list)
120-
- rowtype_unique_key: Used to get the unique key in the upstream schema (maybe a list)
121-
122124
## Data Type Mapping
123125

124126
| StarRocks Data type | SeaTunnel Data type |

0 commit comments

Comments
 (0)