kafka-connect-jdbc icon indicating copy to clipboard operation
kafka-connect-jdbc copied to clipboard

__debezium_unavailable_value in JSON column causes exception

Open FreCap opened this issue 2 years ago • 2 comments

I was experimenting on REPLICA IDENTITY DEFAULT in debezium (https://debezium.io/documentation/reference/stable/connectors/postgresql.html#postgresql-replica-identity), but it seems that the JDBCSinkConnector automatically tries to cast '__debezium_unavailable_value' to jsonb, causing an exception.

Can we have a "protected value" of some kind to avoid this insert?

java.sql.BatchUpdateException: Batch entry 0 INSERT INTO "myschema"."mytable" ("id",'__debezium_unavailable_value'::jsonb,'__debezium_unavailable_value'::jsonb,14541,14541,'2022-06-02 03:08:26.859+00') ON CONFLICT ("id") DO UPDATE SET "json_payload"=EXCLUDED."json_payload","response_payload"=EXCLUDED."response_payload","_updated_time"=EXCLUDED."_updated_time" was aborted: ERROR: invalid input syntax for type json

FreCap avatar Sep 17 '22 16:09 FreCap

i have the same problem i fix that by changing the config replica identity to full for that table https://debezium.io/blog/2019/10/08/handling-unchanged-postgres-toast-values/

t0nem1n avatar Sep 20 '22 02:09 t0nem1n

I did the same, but it is quite more expensive, that I’d rather not keep for longer term

On Mon, Sep 19, 2022 at 10:57 PM t0nem1n @.***> wrote:

i have the same problem i fix that by changing the config replica identity to full for that table

https://debezium.io/blog/2019/10/08/handling-unchanged-postgres-toast-values/

— Reply to this email directly, view it on GitHub https://github.com/confluentinc/kafka-connect-jdbc/issues/1242#issuecomment-1251775192, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4TGNVGB4N3PALJZF5DE3V7ER2LANCNFSM6AAAAAAQPCFREA . You are receiving this because you authored the thread.Message ID: @.***>

FreCap avatar Sep 20 '22 04:09 FreCap

Also interested in this. It'd be convenient to selectively filter out some fields from the UPSERT based on makers.

maurolscla avatar Feb 03 '23 18:02 maurolscla