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/27 14:09:51 UTC

[GitHub] [incubator-inlong] yunqingmoswu opened a new pull request #3384: [INLONG-3383][Manager] Fix the null pointer caused by sink field not configured with source field

yunqingmoswu opened a new pull request #3384:
URL: https://github.com/apache/incubator-inlong/pull/3384


   ### Title Name: [INLONG-3383][Manager] Fix the null pointer caused by sink field not configured with source field
   
   Fixes #3383 
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve.*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


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



[GitHub] [incubator-inlong] dockerzhang merged pull request #3384: [INLONG-3383][Manager] Fix the null pointer caused by sink field not configured with source field

Posted by GitBox <gi...@apache.org>.
dockerzhang merged pull request #3384:
URL: https://github.com/apache/incubator-inlong/pull/3384


   


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



[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

Posted by GitBox <gi...@apache.org>.
healchow commented on a change in pull request #3384:
URL: https://github.com/apache/incubator-inlong/pull/3384#discussion_r836027019



##########
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:
       OK, then the Sort module needs to handle this scenario.




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



[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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on a change in pull request #3384:
URL: https://github.com/apache/incubator-inlong/pull/3384#discussion_r836013637



##########
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:
       Writing a data source like hive requires all table field information, but there are some field mapping scenarios, such as 8 fields on the user source side and 10 fields on the target side. At this time, all the fields on the target side need to be passed in. But only part of the field mapping can be passed in.




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