Skip to content

Commit f93ec15

Browse files
committed
FLINK-37658: Improve the Datagen connector docs
Signed-off-by: davidradl <david_radley@uk.ibm.com>
1 parent 0053b41 commit f93ec15

File tree

2 files changed

+39
-9
lines changed

2 files changed

+39
-9
lines changed

Diff for: docs/content.zh/docs/connectors/table/datagen.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ CREATE TABLE Orders (
9797
)
9898
```
9999

100+
And for collections it is possible to specify different sized collections.
101+
102+
```sql
103+
CREATE TABLE Orders (
104+
f0 Array<INT>,
105+
f1 Map<INT, STRING>,
106+
f2 MULTISET<INT>
107+
) WITH (
108+
'connector' = 'datagen',
109+
'fields.f0.length' = '10',
110+
'fields.f1.length' = '11',
111+
'fields.f2.length' = '12'
112+
);
113+
```
114+
100115
字段类型
101116
-----
102117

@@ -337,7 +352,7 @@ CREATE TABLE Orders (
337352
<tr>
338353
<td><h5>fields.#.null-rate</h5></td>
339354
<td>optional</td>
340-
<td style="word-wrap: break-word;">(none)</td>
355+
<td style="word-wrap: break-word;">0</td>
341356
<td>(Type of field)</td>
342357
<td>空值比例。</td>
343358
</tr>

Diff for: docs/content/docs/connectors/table/datagen.md

+23-8
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ CREATE TABLE Orders (
9999
)
100100
```
101101

102+
And for collections it is possible to specify different sized collections.
103+
104+
```sql
105+
CREATE TABLE Orders (
106+
f0 Array<INT>,
107+
f1 Map<INT, STRING>,
108+
f2 MULTISET<INT>
109+
) WITH (
110+
'connector' = 'datagen',
111+
'fields.f0.length' = '10',
112+
'fields.f1.length' = '11',
113+
'fields.f2.length' = '12'
114+
);
115+
```
116+
102117
Types
103118
-----
104119

@@ -289,14 +304,14 @@ Connector Options
289304
<td>optional</td>
290305
<td style="word-wrap: break-word;">(Minimum value of type)</td>
291306
<td>(Type of field)</td>
292-
<td>Minimum value of random generator, work for numeric types.</td>
307+
<td>Minimum value of random generator, only works for numeric types.</td>
293308
</tr>
294309
<tr>
295310
<td><h5>fields.#.max</h5></td>
296311
<td>optional</td>
297312
<td style="word-wrap: break-word;">(Maximum value of type)</td>
298313
<td>(Type of field)</td>
299-
<td>Maximum value of random generator, work for numeric types.</td>
314+
<td>Maximum value of random generator, only works for numeric types.</td>
300315
</tr>
301316
<tr>
302317
<td><h5>fields.#.max-past</h5></td>
@@ -308,21 +323,21 @@ Connector Options
308323
<tr>
309324
<td><h5>fields.#.length</h5></td>
310325
<td>optional</td>
311-
<td style="word-wrap: break-word;">100</td>
326+
<td style="word-wrap: break-word;">100 for string/bytes, 3 for array/map/multiset </td>
312327
<td>Integer</td>
313328
<td>
314329
Size or length of the collection for generating varchar/varbinary/string/bytes/array/map/multiset types.
315-
Please notice that for variable-length fields (varchar/varbinary), the default length is defined by the schema and cannot be set to a length greater than it.
316-
for super-long fields (string/bytes), the default length is 100 and can be set to a length less than 2^31.
317-
for constructed fields (array/map/multiset), the default number of elements is 3 and can be customized.
330+
Please note that for variable-length fields (varchar/varbinary), the default length is defined by the schema and cannot be set to a length greater than it.
331+
For super-long fields (string/bytes), the default length is 100 and can be set to a length less than 2^31.
332+
For constructed fields (array/map/multiset), the default number of elements is 3.
318333
</td>
319334
</tr>
320335
<tr>
321336
<td><h5>fields.#.var-len</h5></td>
322337
<td>optional</td>
323338
<td style="word-wrap: break-word;">false</td>
324339
<td>Boolean</td>
325-
<td>Whether to generate a variable-length data, please notice that it should only be used for variable-length types (varchar, string, varbinary, bytes).</td>
340+
<td>Whether to generate a variable-length data, only works for variable-length types (varchar, string, varbinary, bytes).</td>
326341
</tr>
327342
<tr>
328343
<td><h5>fields.#.start</h5></td>
@@ -341,7 +356,7 @@ Connector Options
341356
<tr>
342357
<td><h5>fields.#.null-rate</h5></td>
343358
<td>optional</td>
344-
<td style="word-wrap: break-word;">(none)</td>
359+
<td style="word-wrap: break-word;">0</td>
345360
<td>(Type of field)</td>
346361
<td>The proportion of null values.</td>
347362
</tr>

0 commit comments

Comments
 (0)