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/content/docs/connectors/pipeline-connectors/starrocks.md
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,6 +222,13 @@ pipeline:
222
222
seconds. StarRocks will cancel the schema change after timeout which will
223
223
cause the sink failure. </td>
224
224
</tr>
225
+
<tr>
226
+
<td>unicode-char.max-bytes</td>
227
+
<td>optional</td>
228
+
<td style="word-wrap: break-word;">3</td>
229
+
<td>Integer</td>
230
+
<td>The maximum number of bytes allocated for each upstream character when mapping CHAR and VARCHAR types to StarRocks, whose length is measured in bytes. If the upstream source uses utf8mb4, set this option to 4 to avoid underestimating column lengths. The default value of 3 is retained for backward compatibility.</td>
231
+
</tr>
225
232
<tr>
226
233
<td>sink.socket.timeout-ms</td>
227
234
<td>optional</td>
@@ -329,24 +336,19 @@ pipeline:
329
336
<td></td>
330
337
</tr>
331
338
<tr>
332
-
<td>CHAR(n) where n <= 85</td>
333
-
<td>CHAR(n * 3)</td>
334
-
<td>CDC defines the length by characters, and StarRocks defines it by bytes. According to UTF-8, one Chinese
335
-
character is equal to three bytes, so the length for StarRocks is n * 3. Because the max length of StarRocks
336
-
CHAR is 255, map CDC CHAR to StarRocks CHAR only when the CDC length is no larger than 85.</td>
339
+
<td>CHAR(n) where n * unicode-char.max-bytes <= 255 and not primary key</td>
340
+
<td>CHAR(n * unicode-char.max-bytes)</td>
341
+
<td>CDC defines the length by characters, and StarRocks defines it by bytes. The StarRocks length is calculated as n * unicode-char.max-bytes. Because the max length of StarRocks CHAR is 255, map CDC CHAR to StarRocks CHAR only when the calculated length is no larger than 255. If the column is part of the primary key, it is mapped to VARCHAR instead.</td>
337
342
</tr>
338
343
<tr>
339
-
<td>CHAR(n) where n > 85</td>
340
-
<td>VARCHAR(n * 3)</td>
341
-
<td>CDC defines the length by characters, and StarRocks defines it by bytes. According to UTF-8, one Chinese
342
-
character is equal to three bytes, so the length for StarRocks is n * 3. Because the max length of StarRocks
343
-
CHAR is 255, map CDC CHAR to StarRocks VARCHAR if the CDC length is larger than 85.</td>
344
+
<td>CHAR(n) where n * unicode-char.max-bytes > 255, or primary key</td>
<td>CDC defines the length by characters, and StarRocks defines it by bytes. The StarRocks length is calculated as n * unicode-char.max-bytes. Because the max length of StarRocks CHAR is 255, map CDC CHAR to StarRocks VARCHAR when the calculated length exceeds 255. Primary key CHAR columns are also mapped to VARCHAR.</td>
344
347
</tr>
345
348
<tr>
346
349
<td>VARCHAR(n)</td>
347
-
<td>VARCHAR(n * 3)</td>
348
-
<td>CDC defines the length by characters, and StarRocks defines it by bytes. According to UTF-8, one Chinese
349
-
character is equal to three bytes, so the length for StarRocks is n * 3.</td>
<td>CDC defines the length by characters, and StarRocks defines it by bytes. The StarRocks length is calculated as n * unicode-char.max-bytes and capped at 1048576.</td>
Copy file name to clipboardExpand all lines: flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/main/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksDataSinkFactory.java
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -182,6 +182,7 @@ public Set<ConfigOption<?>> optionalOptions() {
Copy file name to clipboardExpand all lines: flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/main/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksDataSinkOptions.java
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -157,4 +157,14 @@ public class StarRocksDataSinkOptions {
157
157
"Timeout for a schema change on StarRocks side, and must be an integral multiple of "
158
158
+ "seconds. StarRocks will cancel the schema change after timeout which will "
Copy file name to clipboardExpand all lines: flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/main/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksMetadataApplier.java
Copy file name to clipboardExpand all lines: flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/main/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksUtils.java
+51-13Lines changed: 51 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,11 @@ public static StarRocksTable toStarRocksTable(
Copy file name to clipboardExpand all lines: flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/main/java/org/apache/flink/cdc/connectors/starrocks/sink/TableCreateConfig.java
0 commit comments