You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/connector-v2/sink/StarRocks.md
+39-37
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,45 @@ We use templates to automatically create starrocks tables,
48
48
which will create corresponding table creation statements based on the type of upstream data and schema type,
49
49
and the default template can be modified according to the situation. Only work on multi-table mode at now.
50
50
51
+
Default template:
52
+
53
+
```sql
54
+
CREATETABLEIF 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
+
CREATETABLEIF 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
+
51
90
### table [string]
52
91
53
92
Use `database` and this `table-name` auto-generate sql and receive upstream input datas write to database.
@@ -82,43 +121,6 @@ Option introduction:
82
121
83
122
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.
84
123
85
-
```sql
86
-
CREATETABLEIF 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
-
CREATETABLEIF 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)
0 commit comments