flink1.13 通过sql cli执行hdfs上面的SQL文件

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

flink1.13 通过sql cli执行hdfs上面的SQL文件

mangguozhi
各位好,
我在flink1.13文档中看到,sql cli已经可以通过 -f 参数执行SQL文件。

但是我试图通过 bin/sql-client.sh -f hdfs:///user/username/test.sql去执行时
报以下错误:


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.util.WrappingRuntimeException:
org.apache.flink.util.DynamicCodeLoadingException: Cannot find configured
state backend factory class: hdfs
at
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.loadStateBackend(StreamExecutionEnvironment.java:913)
at
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.configure(StreamExecutionEnvironment.java:854)
at
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.<init>(StreamExecutionEnvironment.java:247)
at
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.<init>(StreamExecutionEnvironment.java:216)
at
org.apache.flink.table.client.gateway.context.ExecutionContext.createStreamExecutionEnvironment(ExecutionContext.java:185)
at
org.apache.flink.table.client.gateway.context.ExecutionContext.createTableEnvironment(ExecutionContext.java:112)
at
org.apache.flink.table.client.gateway.context.ExecutionContext.<init>(ExecutionContext.java:68)
at
org.apache.flink.table.client.gateway.context.SessionContext.create(SessionContext.java:231)
at
org.apache.flink.table.client.gateway.local.LocalContextUtils.buildSessionContext(LocalContextUtils.java:100)
at
org.apache.flink.table.client.gateway.local.LocalExecutor.openSession(LocalExecutor.java:91)
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.util.DynamicCodeLoadingException: Cannot find
configured state backend factory class: hdfs
at
org.apache.flink.runtime.state.StateBackendLoader.loadUnwrappedStateBackendFromConfig(StateBackendLoader.java:173)
at
org.apache.flink.runtime.state.StateBackendLoader.loadStateBackendFromConfig(StateBackendLoader.java:220)
at
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.loadStateBackend(StreamExecutionEnvironment.java:911)
... 12 more
Caused by: java.lang.ClassNotFoundException: hdfs
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at
org.apache.flink.util.FlinkUserCodeClassLoader.loadClassWithoutExceptionHandling(FlinkUserCodeClassLoader.java:64)
at
org.apache.flink.util.ChildFirstClassLoader.loadClassWithoutExceptionHandling(ChildFirstClassLoader.java:74)
at
org.apache.flink.util.FlinkUserCodeClassLoader.loadClass(FlinkUserCodeClassLoader.java:48)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at
org.apache.flink.runtime.execution.librarycache.FlinkUserCodeClassLoaders$SafetyNetWrapperClassLoader.loadClass(FlinkUserCodeClassLoaders.java:172)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at
org.apache.flink.runtime.state.StateBackendLoader.loadUnwrappedStateBackendFromConfig(StateBackendLoader.java:168)
... 14 more

从错误中来看的话,像是缺失对hdfs的支持导致的,想请教一下各位,如何解决该问题。

需要导哪些jar包。
Reply | Threaded
Open this post in threaded view
|

Re: flink1.13 通过sql cli执行hdfs上面的SQL文件

JasonLee
hi

目前还不支持HDFS路径,只支持本地的文件,未来应该会支持.



-----
Best Wishes
JasonLee
--
Sent from: http://apache-flink.147419.n8.nabble.com/
Best Wishes
JasonLee
Reply | Threaded
Open this post in threaded view
|

Re: flink1.13 通过sql cli执行hdfs上面的SQL文件

Leonard Xu
>
> 目前还不支持HDFS路径,只支持本地的文件,未来应该会支持.


是的, 目前还不支持,只支持本地文件,这个异常信息不是很明确


https://issues.apache.org/jira/browse/FLINK-22795 <https://issues.apache.org/jira/browse/FLINK-22795>

祝好,
Leonard

>
>
>
> -----
> Best Wishes
> JasonLee
> --
> Sent from: http://apache-flink.147419.n8.nabble.com/