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/10 03:24:52 UTC

[GitHub] [incubator-inlong] healchow commented on a change in pull request #3036: [INLONG-3033] Add sourceFieldName in sinkFields

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



##########
File path: inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongStreamSinkTransfer.java
##########
@@ -244,21 +230,32 @@ private static HiveSinkRequest createHiveRequest(StreamSink streamSink, InlongSt
         hiveSinkRequest.setPrimaryPartition(hiveSink.getPrimaryPartition());
         hiveSinkRequest.setSecondaryPartition(hiveSink.getSecondaryPartition());
         if (CollectionUtils.isNotEmpty(hiveSink.getStreamFields())) {
-            List<SinkFieldRequest> fieldRequests = hiveSink.getStreamFields()
-                    .stream()
-                    .map(streamField -> {
-                        SinkFieldRequest storageFieldRequest = new SinkFieldRequest();
-                        storageFieldRequest.setFieldName(streamField.getFieldName());
-                        storageFieldRequest.setFieldType(streamField.getFieldType().toString());
-                        storageFieldRequest.setFieldComment(streamField.getFieldComment());
-                        return storageFieldRequest;
-                    })
-                    .collect(Collectors.toList());
+            List<SinkFieldRequest> fieldRequests = createSinkFields(streamSink.getStreamFields(),
+                    streamInfo.getFieldList());
             hiveSinkRequest.setFieldList(fieldRequests);
         }
         return hiveSinkRequest;
     }
 
+    private static List<SinkFieldRequest> createSinkFields(List<StreamField> sinkFields,

Review comment:
       The `StreamField` may be named `SinkField`?




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