mirror of https://github.com/apache/nifi.git
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:
parent
0789ec3a6b
commit
3d99d02f93
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue