Skip to content

Commit 17ab0fb

Browse files
committed
Sanitize file plans for ExplainUtils
1 parent 5aa399b commit 17ab0fb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/api

wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/api/Job.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,17 @@ protected void doExecute() {
308308
if (this.configuration.getBooleanProperty("wayang.core.explain.enabled")) {
309309
long unixTime = System.currentTimeMillis() / 1000L;
310310

311+
String sanitized = ("job-" + this.name + "-" + unixTime)
312+
.replaceAll("\\s+", "_")
313+
.replaceAll("[^a-zA-Z0-9._-]", "");
314+
311315
ExplainUtils.write(
312316
ExplainUtils.parsePlan(this.wayangPlan, true),
313-
this.configuration.getStringProperty("wayang.core.explain.directory") + "job-" + this.name + "-" + unixTime + "-logical.json"
317+
this.configuration.getStringProperty("wayang.core.explain.directory") + sanitized + "-logical.json"
314318
);
315319
ExplainUtils.write(
316320
ExplainUtils.parsePlan(executionPlan, true),
317-
this.configuration.getStringProperty("wayang.core.explain.directory") + "job-" + this.name + "-" + unixTime + "-execution.json"
321+
this.configuration.getStringProperty("wayang.core.explain.directory") + sanitized + "-execution.json"
318322
);
319323
}
320324

0 commit comments

Comments
 (0)