You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/03/28 02:07:55 UTC

[GitHub] [incubator-inlong] healchow commented on a change in pull request #3384: [INLONG-3383][Manager] Fix the null pointer caused by sink field not configured with source field

healchow commented on a change in pull request #3384:
URL: https://github.com/apache/incubator-inlong/pull/3384#discussion_r836008056



##########
File path: inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/thirdparty/sort/util/FieldInfoUtils.java
##########
@@ -87,10 +87,11 @@
             FieldInfo sinkField = getFieldInfo(field.getFieldName(), field.getFieldType(),
                     field.getIsMetaField() == 1, field.getFieldFormat());
             sinkFields.add(sinkField);
-
-            FieldInfo sourceField = getFieldInfo(field.getSourceFieldName(),
-                    field.getSourceFieldType(), field.getIsMetaField() == 1, field.getFieldFormat());
-            mappingUnitList.add(new FieldMappingUnit(sourceField, sinkField));
+            if (StringUtils.isNotBlank(field.getSourceFieldName())) {

Review comment:
       Perhaps we should do non-null checks when saving and modifying source and sink fields.

##########
File path: inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/thirdparty/sort/util/FieldInfoUtils.java
##########
@@ -87,10 +87,11 @@
             FieldInfo sinkField = getFieldInfo(field.getFieldName(), field.getFieldType(),
                     field.getIsMetaField() == 1, field.getFieldFormat());
             sinkFields.add(sinkField);
-
-            FieldInfo sourceField = getFieldInfo(field.getSourceFieldName(),
-                    field.getSourceFieldType(), field.getIsMetaField() == 1, field.getFieldFormat());
-            mappingUnitList.add(new FieldMappingUnit(sourceField, sinkField));
+            if (StringUtils.isNotBlank(field.getSourceFieldName())) {

Review comment:
       The source and sink fields cannot be empty here. If they are empty, it means that there is a problem with the configuration, and an exception should be thrown.




-- 
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: commits-unsubscribe@inlong.apache.org

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