lincoln-lil commented on code in PR #23810:
URL: https://github.com/apache/flink/pull/23810#discussion_r1410805913
##########
flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/connector/datagen/table/RandomGeneratorVisitor.java:
##########
@@ -503,10 +524,14 @@ private static RandomGenerator<byte[]>
getRandomBytesGenerator(int length) {
return new RandomGenerator<byte[]>() {
@Override
public byte[] next() {
- byte[] arr = new byte[length];
+ byte[] arr = new byte[getVariableLengthFieldRealLen(length,
varLen)];
random.getRandomGenerator().nextBytes(arr);
return arr;
}
};
}
+
+ private static int getVariableLengthFieldRealLen(int length, boolean
varLen) {
+ return varLen ? (new Random().nextInt(length)) + 1 : length;
Review Comment:
Both are fine
--
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]