flink-cdc icon indicating copy to clipboard operation
flink-cdc copied to clipboard

Expose MySQL transaction id as metadata column

Open tao-xiao-sn opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. Unable get transaction.id from MySQL CDC while the underlying Debezium provides it

Describe the solution you'd like Something like below would work

CREATE TABLE products (
    transtaction_id STRING METADATA FROM 'transaction_id' VIRTUAL,
    order_id INT,
    order_date TIMESTAMP(0),
    customer_name STRING,
    price DECIMAL(10, 5),
    product_id INT,
    order_status BOOLEAN,
    PRIMARY KEY(order_id) NOT ENFORCED
) WITH (
    'connector' = 'mysql-cdc',
    'hostname' = 'localhost',
    'port' = '3306',
    'username' = 'root',
    'password' = '123456',
    'database-name' = 'mydb',
    'table-name' = 'orders'
);

Describe alternatives you've considered No alternative

tao-xiao-sn avatar Sep 22 '22 10:09 tao-xiao-sn