gong commented on code in PR #4241:
URL: https://github.com/apache/incubator-inlong/pull/4241#discussion_r875553911
##########
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` stands for schema name? May be better to change naming to
`schemaName`?
--
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]