Hi. Could you please share what version you're using for flink and 
postgres-cdc? 

I guess the two jar versions don't match. The source function has been (weakly) 
removed in flink 2.0.




--

    Best!
    Xuyang




At 2025-07-11 12:26:30, "" <oh_...@nttdata-bizsys.co.jp> wrote:

I need help to figure out the problem with sql-client.

 

With postgres-cdc jar copied to lib and execute the following sql statements, 
got ClassNotFoundException.

 

Error:

Flink SQL> SELECT * FROM shipments;

[ERROR] Could not execute SQL statement. Reason:

java.lang.ClassNotFoundException: 
org.apache.flink.streaming.api.functions.source.SourceFunction

 

 

Sql statements executed:

Flink SQL> CREATE TABLE shipments (

>   shipment_id INT,

>   order_id INT,

>   origin STRING,

>   destination STRING,

>   is_arrived BOOLEAN

> ) WITH (

>   'connector' = 'postgres-cdc',

>   'hostname' = 'localhost',

>   'port' = '5432',

>   'username' = 'postgres',

>   'password' = 'postgres',

>   'database-name' = 'postgres',

>   'schema-name' = 'public',

>   'table-name' = 'shipments',

>   'slot.name' = 'flink',

>    -- experimental feature: incremental snapshot (default off)

>   'scan.incremental.snapshot.enabled' = 'true'

> );

[INFO] Execute statement succeeded.

 

Flink SQL> SELECT * FROM shipments;

[ERROR] Could not execute SQL statement. Reason:

java.lang.ClassNotFoundException: 
org.apache.flink.streaming.api.functions.source.SourceFunction

 

flink/lib:

 

 

Reply via email to