Skip to content
Snippets Groups Projects
Commit d2495f7c authored by Kousuke Saruta's avatar Kousuke Saruta Committed by Andrew Or
Browse files

[SPARK-8739] [WEB UI] [WINDOWS] A illegal character `\r` can be contained in StagePage.

This issue was reported by saurfang. Thanks!

There is a following code in StagePage.scala.

```
                   |width="$serializationTimeProportion%"></rect>
                 |<rect class="getting-result-time-proportion"
                   |x="$gettingResultTimeProportionPos%" y="0px" height="26px"
                   |width="$gettingResultTimeProportion%"></rect></svg>',
               |'start': new Date($launchTime),
               |'end': new Date($finishTime)
             |}
           |""".stripMargin.replaceAll("\n", " ")
```

The last `replaceAll("\n", "")` doesn't work when we checkout and build source code on Windows and deploy on Linux.
It's because when we checkout the source code on Windows, new-line-code is replaced with `"\r\n"` and `replaceAll("\n", "")` replaces only `"\n"`.

Author: Kousuke Saruta <sarutak@oss.nttdata.co.jp>

Closes #7133 from sarutak/SPARK-8739 and squashes the following commits:

17fb044 [Kousuke Saruta] Fixed a new-line-code issue
parent e7252622
No related branches found
No related tags found
No related merge requests found
...@@ -628,7 +628,7 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { ...@@ -628,7 +628,7 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
|'start': new Date($launchTime), |'start': new Date($launchTime),
|'end': new Date($finishTime) |'end': new Date($finishTime)
|} |}
|""".stripMargin.replaceAll("\n", " ") |""".stripMargin.replaceAll("""[\r\n]+""", " ")
timelineObject timelineObject
}.mkString("[", ",", "]") }.mkString("[", ",", "]")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment