From 4f77a17d19c3e6ab5f85d0c836dbbca6cc703711 Mon Sep 17 00:00:00 2001 From: Matthew Burgess Date: Fri, 6 Jan 2023 17:53:54 -0500 Subject: [PATCH] NIFI-11031: Fix logic error in GenerateRecord for nullPercentage This closes #6830 Signed-off-by: David Handermann --- .../org/apache/nifi/processors/standard/GenerateRecord.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateRecord.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateRecord.java index 08b7d51b9c..39f441aa5f 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateRecord.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateRecord.java @@ -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()) {