Skip to content

Commit d3abada

Browse files
authored
Merge pull request #534 from tapdata/fix-gp-array
fix: greenplum array type
2 parents ab2d828 + 1646343 commit d3abada

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

connectors/greenplum-connector/src/main/java/io/tapdata/connector/greenplum/GreenplumConnector.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,16 @@ public void registerCapabilities(ConnectorFunctions connectorFunctions, TapCodec
7575
return "null";
7676
});
7777
codecRegistry.registerFromTapValue(TapArrayValue.class, "text", tapValue -> {
78-
if (tapValue != null && tapValue.getValue() != null) return toJson(tapValue.getValue());
78+
if (tapValue != null && tapValue.getValue() != null) {
79+
if (tapValue.getOriginType().endsWith(" array")) {
80+
if (tapValue.getOriginValue() instanceof PgArray) {
81+
return tapValue.getOriginValue();
82+
} else {
83+
return tapValue.getValue();
84+
}
85+
}
86+
return toJson(tapValue.getValue());
87+
}
7988
return "null";
8089
});
8190

0 commit comments

Comments
 (0)