NIFI-7043: This closes #3999. When a Record incorporates its 'inactive fields' the schema should not change if there are no inactive fields (i.e., if the record has not been modified in such a way that any new fields were added to its schema)

NIFI-7043: Account for case where MapRecord.incorporateInactiveFields is called, and there are no inactive fields, but there are updated fields (i.e., fields whose type has changed from the schema).

Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
Mark Payne 2020-01-18 10:19:03 -05:00 committed by Joe Witt
parent 0789ec3a6b
commit 3d99d02f93
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A
1 changed files with 11 additions and 1 deletions

View File

@ -443,8 +443,18 @@ public class MapRecord implements Record {
public void incorporateInactiveFields() {
final List<RecordField> updatedFields = new ArrayList<>();
boolean fieldUpdated = false;
for (final RecordField field : schema.getFields()) {
updatedFields.add(getUpdatedRecordField(field));
final RecordField updated = getUpdatedRecordField(field);
if (!updated.equals(field)) {
fieldUpdated = true;
}
updatedFields.add(updated);
}
if (!fieldUpdated && (inactiveFields == null || inactiveFields.isEmpty())) {
return;
}
if (inactiveFields != null) {