Serializing Debezium point to Postgres POINT

52 views
Skip to first unread message

Tony Foster

unread,
Aug 31, 2021, 5:30:22 PM8/31/21
to debezium
Hello,

I'm using the Debezium CDC Connector to successfully extract data from a Postgres table to a topic in Kafka. I have a POINT column type in that table that serializes to a struct in Json/Avro with srid, wkb, x, and y.  I'm now using a JDBC Connector to try to move that to a destination datastore, but looking for a way to convert this value BACK to a point within Kafka connect. Do I need to write a custom converter to handle this?

Here's the Debezium class in question.

https://github.com/debezium/debezium/blob/7c150de94395580191ca047ba285851596b054a7/debezium-core/src/main/java/io/debezium/data/geometry/Point.java#L26

Appreciate any help!

Gunnar Morling

unread,
Sep 1, 2021, 6:30:06 AM9/1/21
to debezium
Hi,

The key question is whether your chosen sink connector supports POINT values to begin with? I.e. can it insert/update values in such column? If so, you could either implement a custom Debezium converter (https://debezium.io/documentation/reference/development/converters.html) for emitting the POINT value in a representation handled by your sink connector, or you could implement an SMT which takes the Debezium struct and converts it accordingly.

Hth,

--Gunnar
Reply all
Reply to author
Forward
0 new messages