NIFI-11031: Fix logic error in GenerateRecord for nullPercentage

This closes #6830

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Matthew Burgess 2023-01-06 17:53:54 -05:00 committed by exceptionfactory
parent e966336e89
commit 4f77a17d19
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
1 changed files with 1 additions and 1 deletions

View File

@ -296,7 +296,7 @@ public class GenerateRecord extends AbstractProcessor {
}
private Object generateValueFromRecordField(RecordField recordField, Faker faker, int nullPercentage) {
if (recordField.isNullable() && faker.number().numberBetween(0, 100) <= nullPercentage) {
if (recordField.isNullable() && faker.number().numberBetween(0, 100) < nullPercentage) {
return null;
}
switch (recordField.getDataType().getFieldType()) {