[ https://issues.apache.org/jira/browse/FLINK-22795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17353015#comment-17353015 ]
Leonard Xu commented on FLINK-22795: ------------------------------------ Thanks [~mangguozhi] for report this. Currently both sql file and sql jars in sql client loaded by `-f`, `-j` command option only support local file, and does not support remote file system files. I think we can check file path and throw better exception message. For support loading remote files, it should be another topic we can also discuss here. > Flink sql client -f option doesn't support load sql file from hdfs > ------------------------------------------------------------------ > > Key: FLINK-22795 > URL: https://issues.apache.org/jira/browse/FLINK-22795 > Project: Flink > Issue Type: Bug > Components: Table SQL / Client > Affects Versions: 1.13.0 > Environment: flink 1.13 > hadoop2.6.0 > Reporter: manguozhi > Priority: Minor > > hi, all > When I executed following command in Flink 1.13 > {code:java} > bin/sql-client.sh -f hdfs:/user/test.sql > {code} > The exception is unclear to me: > > 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.client.gateway.SqlExecutionException: > Fail to read content from the /opt/flink-1.13.0/hdfs:/user/test.sql. > at org.apache.flink.table.client.SqlClient.readFromURL(SqlClient.java:250) > at > org.apache.flink.table.client.SqlClient.readExecutionContent(SqlClient.java:239) > at org.apache.flink.table.client.SqlClient.openCli(SqlClient.java:153) > at org.apache.flink.table.client.SqlClient.start(SqlClient.java:95) > at org.apache.flink.table.client.SqlClient.startClient(SqlClient.java:187) > ... 1 more > {color:#de350b} Caused by: java.io.FileNotFoundException: > /opt/flink-1.13.0/hdfs:/user/test.sql (No such file or directory){color} at > java.io.FileInputStream.open0(Native Method) > at java.io.FileInputStream.open(FileInputStream.java:195) > at java.io.FileInputStream.<init>(FileInputStream.java:138) > at java.io.FileInputStream.<init>(FileInputStream.java:93) > at > sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) > at > sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) > at java.net.URL.openStream(URL.java:1045) > at org.apache.commons.io.IOUtils.toString(IOUtils.java:2764) > at org.apache.flink.table.client.SqlClient.readFromURL(SqlClient.java:247) > ... 5 more > Shutting down the session... > done. > I think we should improve the exception message at first, and then it's great > if we can support load file from HDFS. -- This message was sent by Atlassian Jira (v8.3.4#803005)