KurtYoung commented on a change in pull request #7887: 
[FLINK-11802][table-runtime-blink] Create TypeInfo and TypeSerializer for blink 
data format
URL: https://github.com/apache/flink/pull/7887#discussion_r261982598
 
 

 ##########
 File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/type/TypeConverters.java
 ##########
 @@ -110,8 +134,43 @@ public static InternalType 
createInternalTypeFromTypeInfo(TypeInformation typeIn
                        return InternalTypes.createMapType(
                                        
createInternalTypeFromTypeInfo(mapType.getKeyTypeInfo()),
                                        
createInternalTypeFromTypeInfo(mapType.getValueTypeInfo()));
+               } else if (typeInfo instanceof BinaryMapTypeInfo) {
+                       BinaryMapTypeInfo mapType = (BinaryMapTypeInfo) 
typeInfo;
+                       return InternalTypes.createMapType(
+                                       mapType.getKeyType(), 
mapType.getValueType());
+               } else if (typeInfo instanceof BinaryArrayTypeInfo) {
+                       BinaryArrayTypeInfo arrayType = (BinaryArrayTypeInfo) 
typeInfo;
+                       return 
InternalTypes.createArrayType(arrayType.getElementType());
                } else {
                        return InternalTypes.createGenericType(typeInfo);
                }
        }
+
+       /**
+        * Create a internal {@link TypeInformation} from a {@link 
InternalType}.
+        *
+        * <p>eg:
+        * {@link InternalTypes#STRING} => {@link BinaryStringTypeInfo}.
+        * {@link RowType} => {@link BaseRowTypeInfo}.
+        */
+       public static TypeInformation 
createInternalTypeInfoFromInternalType(InternalType type) {
+               TypeInformation typeInfo = 
INTERNAL_TYPE_TO_INTERNAL_TYPE_INFO.get(type);
+               if (typeInfo != null) {
+                       return typeInfo;
+               }
+
+               if (type instanceof RowType) {
+                       RowType rowType = (RowType) type;
+                       return new BaseRowTypeInfo(rowType.getFieldTypes(), 
rowType.getFieldNames()
+                       );
 
 Review comment:
   no need wrap line

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to