pvillard31 commented on a change in pull request #4648:
URL: https://github.com/apache/nifi/pull/4648#discussion_r518405917



##########
File path: 
nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java
##########
@@ -1025,6 +1029,17 @@ public static boolean isStringTypeCompatible(final 
Object value) {
         return value != null;
     }
 
+    public static boolean isEnumTypeCompatible(final Object value, final 
EnumDataType enumType) {
+        return enumType.getEnums() != null && 
enumType.getEnums().contains(value);
+    }
+
+    private static Object toEnum(Object value, EnumDataType dataType, String 
fieldName) {
+        if(dataType.getEnums() != null && dataType.getEnums().contains(value)) 
{

Review comment:
       I assumed that we can only have strings: 
http://avro.apache.org/docs/current/spec.html#Enums




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to