You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/03/28 03:33:42 UTC

[incubator-inlong] branch master updated: [Manager] Fix the null pointer caused by sink field not configured with source field (#3384)

This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new ba98bcc  [Manager] Fix the null pointer caused by sink field not configured with source field (#3384)
ba98bcc is described below

commit ba98bcc5161e500d2eb39d829c4bcc017c7c4735
Author: yunqingmoswu <44...@users.noreply.github.com>
AuthorDate: Mon Mar 28 11:33:37 2022 +0800

    [Manager] Fix the null pointer caused by sink field not configured with source field (#3384)
    
    Co-authored-by: yunqingmo <yu...@tencent.com>
---
 .../manager/service/thirdparty/sort/util/FieldInfoUtils.java     | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/thirdparty/sort/util/FieldInfoUtils.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/thirdparty/sort/util/FieldInfoUtils.java
index fb3512d..bee5e92 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/thirdparty/sort/util/FieldInfoUtils.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/thirdparty/sort/util/FieldInfoUtils.java
@@ -87,10 +87,11 @@ public class FieldInfoUtils {
             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())) {
+                FieldInfo sourceField = getFieldInfo(field.getSourceFieldName(),
+                        field.getSourceFieldType(), field.getIsMetaField() == 1, field.getFieldFormat());
+                mappingUnitList.add(new FieldMappingUnit(sourceField, sinkField));
+            }
         }
 
         return mappingUnitList;