baomingyu commented on code in PR #4241:
URL: https://github.com/apache/incubator-inlong/pull/4241#discussion_r875645323


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sort/util/LoadNodeUtils.java:
##########
@@ -161,6 +165,29 @@ public static HiveLoadNode createLoadNode(HiveSinkResponse 
hiveSinkResponse) {
         );
     }
 
+    /**
+     * create Postgres sink response
+     * @param postgresSinkResponse postgresSinkResponse
+     * @return
+     */
+    public static PostgresLoadNode createLoadNode(PostgresSinkResponse 
postgresSinkResponse) {
+        List<SinkFieldResponse> sinkFieldResponses = 
postgresSinkResponse.getFieldList();
+
+        String name = postgresSinkResponse.getSinkName();
+        List<FieldInfo> fields = sinkFieldResponses.stream()
+                .map(sinkFieldResponse -> 
FieldInfoUtils.parseSinkFieldInfo(sinkFieldResponse,
+                        name))
+                .collect(Collectors.toList());
+        List<FieldRelationShip> fieldRelationShips = 
parseSinkFields(sinkFieldResponses, name);
+        return new PostgresLoadNode(postgresSinkResponse.getSinkName(),
+                postgresSinkResponse.getSinkName(),
+                fields, fieldRelationShips, null, null, 1,
+                null, postgresSinkResponse.getJdbcUrl(), 
postgresSinkResponse.getUsername(),
+                postgresSinkResponse.getPassword(),
+                postgresSinkResponse.getDbName() + "." + 
postgresSinkResponse.getTableName(),

Review Comment:
   dbName will be more clear when configuring.



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

Reply via email to