When I try to run a Flink batch process while using the Table environment the table environment is not implementing but instead an exception is thrown:
TableEnvironment tenv = TableEnvironment.create(EnvironmentSettings.inBatchMode());
I am getting the following error exception:
Could not find any factories that implement 'org.apache.flink.table.delegation.ExecutorFactory' in the classpath. and the job is getting failed.
ExecutionEnvironment env = ExecutionEnvironment.createRemoteEnvironment(wslIpAddress, flinkPort);
TableEnvironment tenv = TableEnvironment.create(EnvironmentSettings.inBatchMode());
tenv.executeSql("CREATE TABLE Flinkdata (\n" +
" Inde STRING,\n" +
" User_Id STRING,\n" +
" First_Name STRING,\n" +
" Last_Name STRING,\n" +
" Sex STRING,\n" +
" Email STRING,\n" +
" Phone STRING,\n" +
" Date_of_birth STRING, \n" +
" Job_Title STRING,\n" +
" PRIMARY KEY (Inde) NOT ENFORCED\n" +
") WITH (\n" +
" 'connector.type' = 'jdbc',\n" +
" 'connector.url' = 'jdbc:mysql://localhost/ruby',\n" +
" 'connector.table' = 'flink_people_data',\n" +
" 'connector.username' = 'root',\n" +
" 'connector.password' = 'passwordd1234'\n" +
")");
tenv.executeSql("SELECT * FROM Flinkdata");
Table transactions = tenv.from("Flinkdata");
env.execute("ReadWriteToMariaDB");
The error seems to be occurring at this line from the code:
TableEnvironment tenv = TableEnvironment.create(EnvironmentSettings.inBatchMode());
How can I solve that?
This is due to missing dependencies, you can import the following dependencies in maven:
The following is a full pom file:
And here's the demo: