James Watkins
04/11/2023, 10:16 PMdependencies {
...
implementation 'com.ververica:flink-sql-connector-postgres-cdc:2.2.1'
This is the error I’m getting:
[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.table.api.ValidationException: Could not find any factory for identifier 'postgres-cdc' that implements 'org.apache.flink.table.factories.DynamicTableFactory' in the classpath.
I will add more details in-thread for the steps I have taken. Any help would be much appreciated.James Watkins
04/11/2023, 10:17 PMgradle clean shadowJar
2. Start a cluster: ./bin/start-cluster.sh
3. Start a SQL Client and pass the JAR file from step 1: ./bin/sql-client.sh -j build/libs/<project-name>-<version>-all.jar
4. Register a PostgreSQL table in Flink SQL using the ‘postgres-cdc’ connector.
5. When I try and select * from the table created in step 4 I get the error shown in the post
I think this paragraph explains the exact issue I’m having but for a pom.xml file/Maven, but it doesn’t specify what to do for Gradle. I came across a similar issue in GitHub for another 3rd party connector which says to add mergeServiceFiles() to the build.gradle file. I tried that and it also didn’t work.Martijn Visser
04/12/2023, 7:11 AMMartijn Visser
04/12/2023, 7:12 AMJames Watkins
04/12/2023, 8:14 AMJames Watkins
04/12/2023, 9:24 AM$FLINK_HOME/lib/ before starting the cluster, but it’s not particularly clear how I can do this with a fat JAR.Martijn Visser
04/12/2023, 9:53 AMbut it’s not particularly clear how I can do this with a fat JAR.I'm not sure what your intent is of that fat JAR. What's in there? Are there UDFs? Because a normal use case for the SQL Client is that you submit SQL statements, which get executed. There is no JAR involved in those cases
Martijn Visser
04/12/2023, 9:55 AMSo I have got this working by downloading the jar file for that single connector and moving it toThat's indeed how you normally add connectors to the cluster. https://nightlies.apache.org/flink/flink-docs-stable/docs/dev/configuration/overview/ talks specifically about Table API programs, not SQL applications$FLINK_HOME/lib/
Martijn Visser
04/12/2023, 9:57 AMJames Watkins
04/12/2023, 10:04 AMAn overview of available connectors and formats is available for both DataStream and Table API/SQL.
….
The uber/fat JARs are supported mostly for being used in conjunction with the SQL client, but you can also use them in any DataStream/Table application.(Link)
Martijn Visser
04/12/2023, 10:08 AM