hailin0 commented on code in PR #4004:
URL:
https://github.com/apache/incubator-seatunnel/pull/4004#discussion_r1092956556
##########
seatunnel-connectors-v2/connector-fake/src/main/java/org/apache/seatunnel/connectors/seatunnel/fake/source/FakeDataGenerator.java:
##########
@@ -92,6 +93,21 @@ public List<SeaTunnelRow> generateFakedRows(int rowNum) {
return seaTunnelRows;
}
+ /**
+ * @param rowNum The number of pieces of data to be generated by the
current task
+ * @param output Data collection and distribution
+ **/
+ public void collectFakedRows(int rowNum, Collector<SeaTunnelRow> output) {
+ if (fakeConfig.getFakeRows() != null) {
+ for (FakeConfig.RowData rowData : fakeConfig.getFakeRows()) {
+ output.collect(convertRow(rowData));
+ }
+ }
+ for (int i = 0; i < rowNum; i++) {
+ output.collect(randomRow());
+ }
Review Comment:
```suggestion
if (fakeConfig.getFakeRows() != null) {
for (FakeConfig.RowData rowData : fakeConfig.getFakeRows()) {
output.collect(convertRow(rowData));
}
} else {
for (int i = 0; i < rowNum; i++) {
output.collect(randomRow());
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]