I'm having a problem with type conversion of binary(16)
in the jdbc mysql sink. The issue arises when trying to store a text
representation of a binary(16)
column in the sink table. Is there a way to CAST the input data before it is inserted in the table or force the jdbc sink to encode the text as binary just before sending it?
Florian Klein
Asked on Mar 07, 2024
convert_to
function to convert text to bytea
in the sink table:declare
v_text text := 'your_text_value';
v_bytea bytea;
begin
v_bytea := convert_to(v_text, 'UTF8');
end;
decode
function to convert the text representation to bytea
:create sink product_pim1_to_pim2 as
select decode(ltrim(uuid, '0x'), 'hex') as uuid, id, product_model_id, raw_values from product where tenant = 'pim1';