Skip to content

Commit

Permalink
[SPARK-12410][STREAMING] Fix places that use '.' and '|' directly in …
Browse files Browse the repository at this point in the history
…split

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

Author: Shixiong Zhu <[email protected]>

Closes #10361 from zsxwing/reg-bug.
  • Loading branch information
zsxwing committed Dec 17, 2015
1 parent 8184568 commit 540b5ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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("\\|"))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 540b5ae

Please sign in to comment.