kubaugust commented on code in PR #11817:
URL: https://github.com/apache/nifi/pull/11817#discussion_r4323908066


##########
nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java:
##########
@@ -1922,17 +1922,33 @@ public static boolean isRecordWider(final RecordSchema 
potentiallyWider, final R
                 continue;
             }
 
-            final Optional<DataType> widerType = 
getWiderType(widerField.get().getDataType(), narrowerField.getDataType());
-            if (widerType.isEmpty()) {
+            if (!isWiderOrEqual(widerField.get().getDataType(), 
narrowerField.getDataType())) {
                 return false;
             }
+        }
 
-            if (!widerType.get().equals(widerField.get().getDataType())) {
-                return false;
+        return true;
+    }
+
+    private static boolean isWiderOrEqual(final DataType potentiallyWider, 
final DataType potentiallyNarrower) {

Review Comment:
   Added a comment with a short explanation



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to