wuchong commented on a change in pull request #15703:
URL: https://github.com/apache/flink/pull/15703#discussion_r707399782



##########
File path: 
flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/connector/datagen/table/RandomGeneratorVisitor.java
##########
@@ -203,6 +217,33 @@ public DataGeneratorContainer visit(DayTimeIntervalType 
dayTimeIntervalType) {
                 RandomGenerator.longGenerator(config.get(min), 
config.get(max)), min, max);
     }
 
+    @Override
+    public DataGeneratorContainer visit(TimestampType timestampType) {

Review comment:
       nit: should we move the override implementation to base class 
`DataGenVisitorBase`, or remove the default implementation in 
`DataGenVisitorBase`? IMO, datagen for timestamp type only works for random.

##########
File path: docs/content/docs/connectors/table/datagen.md
##########
@@ -253,6 +259,13 @@ Connector Options
       <td>(Type of field)</td>
       <td>Maximum value of random generator, work for numeric types.</td>
     </tr>
+    <tr>
+      <td><h5>fields.#.max-past</h5></td>
+      <td>optional</td>
+      <td style="word-wrap: break-word;">0</td>
+      <td>Duration</td>
+      <td>Maximum past of timestamp random generator, work for timestamp 
types.</td>

Review comment:
       ```suggestion
         <td>Maximum past of timestamp random generator, only work for 
timestamp types.</td>
   ```
   
   And please also mention this can be used to generate out-of-order records.




-- 
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]


Reply via email to