yzeng1618 commented on code in PR #10186:
URL: https://github.com/apache/seatunnel/pull/10186#discussion_r2621581104
##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresJdbcRowConverter.java:
##########
@@ -222,7 +221,15 @@ public PreparedStatement toExternal(
switch (seaTunnelDataType.getSqlType()) {
case STRING:
String sourceType = sourceTypes[fieldIndex];
- if (PG_INET.equalsIgnoreCase(sourceType)
+ if (sourceType != null
+ && (PG_GEOMETRY.equalsIgnoreCase(sourceType)
+ ||
PG_GEOGRAPHY.equalsIgnoreCase(sourceType))) {
Review Comment:
Thanks for pointing this out, the original implementation was indeed taking
`sourceType` from the source `tableSchema`, so the special handling mainly
worked for the pgsql-cdc -> pgsql case.
I’ve updated `PostgresJdbcRowConverter.toExternal` to resolve the type from
the sink first:
- use `databaseTableSchema` (sink schema) by column name when it’s available
- fall back to the original `tableSchema` sourceType array only for backward
compatibility
--
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]