LadyForest commented on code in PR #22539:
URL: https://github.com/apache/flink/pull/22539#discussion_r1201419123


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java:
##########
@@ -731,9 +731,16 @@ public TableResultInternal executePlan(InternalPlan plan) {
     }
 
     private CompiledPlan compilePlanAndWrite(
-            String filePath, boolean ifNotExists, Operation operation) {
-        File file = Paths.get(filePath).toFile();
-        if (file.exists()) {
+            Path filePath, boolean ifNotExists, Operation operation) {
+        FileSystem fs;
+        boolean exists;
+        try {
+            fs = filePath.getFileSystem();
+            exists = fs.exists(filePath);
+        } catch (IOException e) {
+            throw new RuntimeException(e);

Review Comment:
   I think we'd better throw `TableException` instead of `RuntimeException`



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to