healchow commented on code in PR #7343:
URL: https://github.com/apache/inlong/pull/7343#discussion_r1101328560


##########
inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/parser/impl/FlinkSqlParser.java:
##########
@@ -635,11 +638,15 @@ private void parseFieldRelations(List<FieldInfo> fields,
             Map<String, FieldRelation> fieldRelationMap, StringBuilder sb) {
         for (FieldInfo field : fields) {
             FieldRelation fieldRelation = 
fieldRelationMap.get(field.getName());
+            FormatInfo fieldFormatInfo = field.getFormatInfo();
             if (fieldRelation == null) {
-                String targetType = 
TableFormatUtils.deriveLogicalType(field.getFormatInfo()).asSummaryString();
+                String targetType = 
TableFormatUtils.deriveLogicalType(fieldFormatInfo).asSummaryString();
                 sb.append("\n    CAST(NULL as ").append(targetType).append(") 
AS ").append(field.format()).append(",");
                 continue;
             }
+            boolean complexType = fieldFormatInfo instanceof RowFormatInfo

Review Comment:
   Suggest extracting this check as a method into the `FieldInfoUtils`, then if 
we add a newly complex type, then we just modify `FieldInfoUtils` is enough, no 
need to modify this file. 



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