Skip to content
Snippets Groups Projects
Commit 540b5aea authored by Shixiong Zhu's avatar Shixiong Zhu
Browse files

[SPARK-12410][STREAMING] Fix places that use '.' and '|' directly in split

String.split accepts a regular expression, so we should escape "." and "|".

Author: Shixiong Zhu <shixiong@databricks.com>

Closes #10361 from zsxwing/reg-bug.
parent 81845688
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ object MovieLensALS {
def parseMovie(str: String): Movie = {
val fields = str.split("::")
assert(fields.size == 3)
Movie(fields(0).toInt, fields(1), fields(2).split("|"))
Movie(fields(0).toInt, fields(1), fields(2).split("\\|"))
}
}
......
......@@ -253,7 +253,7 @@ private[streaming] object FileBasedWriteAheadLog {
def getCallerName(): Option[String] = {
val stackTraceClasses = Thread.currentThread.getStackTrace().map(_.getClassName)
stackTraceClasses.find(!_.contains("WriteAheadLog")).flatMap(_.split(".").lastOption)
stackTraceClasses.find(!_.contains("WriteAheadLog")).flatMap(_.split("\\.").lastOption)
}
/** Convert a sequence of files to a sequence of sorted LogInfo objects */
......
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