Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
yaooqinn committed Nov 15, 2019
1 parent 61626ff commit e12bb86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ object IntervalUtils {
}
}

def currentWord: String = {
val strings = s.toString.split("\\s+")
val lenLeft = s.substring(i, s.numBytes()).toString.split("\\s+").length
def currentWord: UTF8String = {
val strings = s.split(UTF8String.blankString(1), -1)
val lenLeft = s.substring(i, s.numBytes()).split(UTF8String.blankString(1), -1).length
strings(strings.length - lenLeft)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ class IntervalUtilsSuite extends SparkFunSuite {
checkFromInvalidString("1a1 hour", "invalid value '1a1'")
checkFromInvalidString("1.1a1 seconds", "invalid value '1.1a1' in fractional part")
checkFromInvalidString("2234567890 days", "integer overflow")
checkFromInvalidString("\n", "Error parsing '\n' to interval")
checkFromInvalidString("\t", "Error parsing '\t' to interval")

}

test("string to interval: seconds with fractional part") {
Expand Down

0 comments on commit e12bb86

Please sign in to comment.