【Flink】The primary key is necessary when enable ‘Key: ‘scan.incremental.snapshot.enabled‘ , default:

问题出现:在执行FlinkSQL-CDC连接mysql的时候,使用FlinkSQL客户端出现如下问题:

Flink SQL> CREATE TABLE demo (
>      id int,
>      name STRING
>      ) WITH (
>      ‘connector’ = ‘mysql-cdc’,
>      ‘hostname’ = ‘localhost’,
>      ‘port’ = ‘3306’,
>      ‘username’ = ‘root’,
>      ‘password’ = ‘root’,
>      ‘database-name’ = ‘cdc’,
>      ‘table-name’ = ‘cdc_test’);
>
[INFO] Execute statement succeed.

Flink SQL> select * from demo;
[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.table.api.ValidationException: The primary key is necessary when enable ‘Key: ‘scan.incremental.snapshot.enabled’ , default: true (fallback keys

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/93ae72f6f3.html