fsk119 commented on a change in pull request #16028:
URL: https://github.com/apache/flink/pull/16028#discussion_r642749269



##########
File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/SqlClient.java
##########
@@ -213,6 +214,16 @@ protected static void startClient(String[] args, 
Supplier<Terminal> terminalFact
         }
     }
 
+    public static void checkArgs(String[] args) {
+        for (String arg : args) {
+            if (arg.trim().toLowerCase().startsWith("hdfs")) {

Review comment:
       There are other protocols, e.g. oss. Would better to check the protocol  
whether is "file". Also I think the validation should be like 
   
   ```
       public static void checkFilePath(String filePath) {
           Path path = new Path(filePath);
           String scheme = path.toUri().getScheme();
           if (scheme != null && !scheme.equals("file")) {
               throw new SqlClientException("SQL Client only supports to load 
files in local.");
           }
       }
   ```
   
   Please add the check around the 
[validation](https://github.com/apache/flink/blob/master/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/SqlClient.java#L123)
 here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to