Hisoka-X commented on code in PR #8992:
URL: https://github.com/apache/seatunnel/pull/8992#discussion_r2000782756


##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/debezium/row/SeaTunnelRowDebeziumDeserializationConverters.java:
##########
@@ -476,6 +481,19 @@ public Object convert(Object dbzObj, Schema schema) throws 
Exception {
                     byte[] bytes = new byte[byteBuffer.remaining()];
                     byteBuffer.get(bytes);
                     return bytes;
+                } else if (dbzObj instanceof Struct) {
+                    Struct struct = (Struct) dbzObj;
+                    String name = struct.schema().name();
+                    if (StringUtils.isNotBlank(name)
+                            && 
name.equals("io.debezium.data.geometry.Geometry")) {
+                        WKBReader reader = new WKBReader();
+                        WKBWriter wkbWriter = new WKBWriter();
+                        byte[] wkbs = struct.getBytes("wkb");
+                        Geometry geometry = reader.read(wkbs);
+                        byte[] bytes = wkbWriter.write(geometry);

Review Comment:
   Why we need convert `wkb bytes` to `geometry` then reconvert `geometry` to 
`bytes` again?



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