mirror of
https://github.com/apache/nifi.git
synced 2025-02-06 10:08:42 +00:00
NIFI-8720: Ensure that when we use Expression Language for Records Per Split property of SplitRecord, we treat the result as a value of 1 if it's less than 1.
Signed-off-by: Matthew Burgess <mattyb149@apache.org> This closes #5171
This commit is contained in:
parent
b1ad13c835
commit
6fc9f33ba2
@ -144,7 +144,7 @@ public class SplitRecord extends AbstractProcessor {
|
||||
final RecordReaderFactory readerFactory = context.getProperty(RECORD_READER).asControllerService(RecordReaderFactory.class);
|
||||
final RecordSetWriterFactory writerFactory = context.getProperty(RECORD_WRITER).asControllerService(RecordSetWriterFactory.class);
|
||||
|
||||
final int maxRecords = context.getProperty(RECORDS_PER_SPLIT).evaluateAttributeExpressions(original).asInteger();
|
||||
final int maxRecords = Math.max(1, context.getProperty(RECORDS_PER_SPLIT).evaluateAttributeExpressions(original).asInteger());
|
||||
|
||||
final List<FlowFile> splits = new ArrayList<>();
|
||||
final Map<String, String> originalAttributes = original.getAttributes();
|
||||
|
Loading…
x
Reference in New Issue
Block a user