healchow commented on code in PR #7343:
URL: https://github.com/apache/inlong/pull/7343#discussion_r1101332043
##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/sort/util/FieldInfoUtils.java:
##########
@@ -148,6 +148,17 @@ private static FieldInfo getFieldInfo(String fieldName,
String fieldType,
* @return Sort field format instance
*/
public static FormatInfo convertFieldFormat(String type) {
+ FieldType fieldType = FieldType.forName(type);
+ switch (fieldType) {
+ case ARRAY:
+ return new ArrayFormatInfo(new StringFormatInfo());
+ case MAP:
+ return new MapFormatInfo(new StringFormatInfo(), new
StringFormatInfo());
+ case STRUCT:
+ return new RowFormatInfo(new String[]{}, new FormatInfo[]{});
+ default:
+ break;
+ }
return convertFieldFormat(type, null);
Review Comment:
```suggestion
FieldType fieldType = FieldType.forName(type);
FormatInfo formatInfo;
switch (fieldType) {
case ARRAY:
formatInfo = new ArrayFormatInfo(new StringFormatInfo());
break;
case MAP:
formatInfo = new MapFormatInfo(new StringFormatInfo(), new
StringFormatInfo());
break;
case STRUCT:
formatInfo = new RowFormatInfo(new String[]{}, new
FormatInfo[]{});
break;
default:
formatInfo = convertFieldFormat(type, null);
}
return formatInfo;
```
--
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]