Not exactly, the flink distribution just doesn't include the scala api by 
default. 

For using scala, you can pack in your job jar both flink-table-api-scala and 
flink-table-api-scala-bridge and keep the flink distribution structure, which 
mean flink-table-planner_2.12-1.15.0.jar is under opt folder and 
flink-table-planner-loader is under /lib. in such way, you can choose 
whaterever scala version you prefer. 

Also, you can swap flink-table-planner_2.12-1.15.0.jar and 
flink-table-planner-loader. But with such way, you are bind on Flink's 2.12. 
scala version, 


Best regards, 
Yuxia 


发件人: "Jeff Zhang" <zjf...@gmail.com> 
收件人: "yuxia" <luoyu...@alumni.sjtu.edu.cn> 
抄送: "User" <user@flink.apache.org> 
发送时间: 星期日, 2022年 5 月 08日 下午 3:50:33 
主题: Re: Unable to start sql-client when putting 
flink-table-planner_2.12-1.15.0.jar to lib folder 

Thanks Yuxia, that works. Does that mean for one flink distribution, I can 
either use java or use scala ? If so, it seems not user friendly. 



On Sun, May 8, 2022 at 10:40 AM yuxia < [ mailto:luoyu...@alumni.sjtu.edu.cn | 
luoyu...@alumni.sjtu.edu.cn ] > wrote: 



Hi, you can move the flink-table-planner-loader to the /opt. See more in [ 
https://issues.apache.org/jira/browse/FLINK-25128 | 
https://issues.apache.org/jira/browse/FLINK-25128 ] 


Best regards, 
Yuxia 


发件人: "Jeff Zhang" < [ mailto:zjf...@gmail.com | zjf...@gmail.com ] > 
收件人: "User" < [ mailto:user@flink.apache.org | user@flink.apache.org ] > 
发送时间: 星期六, 2022年 5 月 07日 下午 10:05:55 
主题: Unable to start sql-client when putting flink-table-planner_2.12-1.15.0.jar 
to lib folder 

Hi folks, 
It looks like flink 1.15 changes its binary distribution because of scala free. 
The flink-table-planner_2.12-1.15.0.jar is put under the opt folder. Now I 
would like to use it for my scala flink app, so I move it to the lib folder, 
but after that, I can not start sql-client. Is it expected ? Here's the error I 
see 

-------------------------------------------------------------------------------------
 
Exception in thread "main" org.apache.flink.table.client.SqlClientException: 
Unexpected exception. This is a bug. Please consider filing an issue. 
at org.apache.flink.table.client.SqlClient.startClient(SqlClient.java:201) 
at org.apache.flink.table.client.SqlClient.main(SqlClient.java:161) 
Caused by: org.apache.flink.table.api.TableException: Could not instantiate the 
executor. Make sure a planner module is on the classpath 
at 
org.apache.flink.table.client.gateway.context.ExecutionContext.lookupExecutor(ExecutionContext.java:163)
 
at 
org.apache.flink.table.client.gateway.context.ExecutionContext.createTableEnvironment(ExecutionContext.java:111)
 
at 
org.apache.flink.table.client.gateway.context.ExecutionContext.<init>(ExecutionContext.java:66)
 
at 
org.apache.flink.table.client.gateway.context.SessionContext.create(SessionContext.java:247)
 
at 
org.apache.flink.table.client.gateway.local.LocalContextUtils.buildSessionContext(LocalContextUtils.java:87)
 
at 
org.apache.flink.table.client.gateway.local.LocalExecutor.openSession(LocalExecutor.java:87)
 
at org.apache.flink.table.client.SqlClient.start(SqlClient.java:88) 
at org.apache.flink.table.client.SqlClient.startClient(SqlClient.java:187) 
... 1 more 
Caused by: org.apache.flink.table.api.ValidationException: Multiple factories 
for identifier 'default' that implement 
'org.apache.flink.table.delegation.ExecutorFactory' found in the classpath. 

Ambiguous factory classes are: 

org.apache.flink.table.planner.delegation.DefaultExecutorFactory 
org.apache.flink.table.planner.loader.DelegateExecutorFactory 
at 
org.apache.flink.table.factories.FactoryUtil.discoverFactory(FactoryUtil.java:553)
 
at 
org.apache.flink.table.client.gateway.context.ExecutionContext.lookupExecutor(ExecutionContext.java:154)
 
... 8 more 



-- 
Best Regards 

Jeff Zhang 






-- 
Best Regards 

Jeff Zhang 

Reply via email to