LadyForest commented on code in PR #22539:
URL: https://github.com/apache/flink/pull/22539#discussion_r1207961398
##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java:
##########
@@ -731,11 +732,22 @@ 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) throws
IOException {
+ FileSystem fs;
+ boolean exists;
+ try {
+ fs = filePath.getFileSystem();
+ exists = fs.exists(filePath);
+ } catch (IOException e) {
+ throw new TableException(e.getMessage());
+ }
+ if (exists) {
if (ifNotExists) {
- return loadPlan(PlanReference.fromFile(filePath));
+ if (fs.isDistributedFS()) {
+ URL localUrl = resourceManager.downloadResource(filePath);
Review Comment:
It's a little unnatural to do so. Can we wrap up this logic?
##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java:
##########
@@ -748,7 +760,6 @@ private CompiledPlan compilePlanAndWrite(
filePath,
TableConfigOptions.PLAN_FORCE_RECOMPILE.key()));
}
}
-
Review Comment:
revert this back
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/ExecNodeGraphInternalPlan.java:
##########
@@ -63,7 +63,6 @@ public void writeToFile(File file, boolean ignoreIfExists,
boolean failIfExists)
if (ignoreIfExists) {
return;
}
-
Review Comment:
Please revert this change.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]