ruanwenjun commented on code in PR #14937:
URL:
https://github.com/apache/dolphinscheduler/pull/14937#discussion_r1330318116
##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java:
##########
@@ -419,4 +422,28 @@ public LocalDateTime deserialize(JsonParser p,
DeserializationContext context) t
return LocalDateTime.parse(p.getValueAsString(), formatter);
}
}
+
+ public static class PgArraySerializer extends JsonSerializer<PgArray> {
+ @Override
+ public void serialize(PgArray pgArray, JsonGenerator jsonGenerator,
SerializerProvider serializerProvider) throws IOException {
+ try {
+ Object[] array = (Object[]) pgArray.getArray();
+
+ // 将 array 转换为合适的类型(List 或数组)
+ // 然后进行序列化
+ // ...
+
+ // 示例:将 array 序列化为 JSON 数组
+ jsonGenerator.writeStartArray();
+ for (Object item : array) {
+ jsonGenerator.writeObject(item);
+ }
+ jsonGenerator.writeEndArray();
+ } catch (SQLException e) {
+ // 处理异常
+ e.printStackTrace();
+ }
+ }
+ }
+
Review Comment:
Move this in SqlTask, please don't use Chinese in source code.
##########
dolphinscheduler-common/pom.xml:
##########
@@ -177,5 +177,9 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ </dependency>
Review Comment:
Don't put this in common module
##########
README.md:
##########
@@ -7,6 +7,8 @@
[](https://s.apache.org/dolphinscheduler-slack)
[](README_zh_CN.md)
+
+
Review Comment:
```suggestion
```
--
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]