raminqaf commented on code in PR #29133:
URL: https://github.com/apache/flink/pull/29133#discussion_r3987995353


##########
flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java:
##########
@@ -1498,10 +1499,16 @@ private static void validateInfo(
             // check for Java Basic Types
             if (typeInfo instanceof BasicTypeInfo) {
 
-                TypeInformation<?> actual;
                 // check if basic type at all
-                if (!(type instanceof Class<?>)
-                        || (actual = BasicTypeInfo.getInfoFor((Class<?>) 
type)) == null) {
+                if (!(type instanceof Class<?>)) {
+                    throw new InvalidTypesException("Basic type expected.");
+                }
+                // UUID is not registered for automatic extraction to preserve 
existing serializers.
+                final TypeInformation<?> actual =
+                        type == UUID.class
+                                ? BasicTypeInfo.UUID_TYPE_INFO
+                                : BasicTypeInfo.getInfoFor((Class<?>) type);

Review Comment:
   Should we add a test in `TypeExtractorTest`?



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