Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test for non-matching optional group in regexp_extract
  • Loading branch information
srowen committed Aug 5, 2016
commit 75d62ae1ce5c33a8c4929aa3500aba1ebb916a09
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ class StringFunctionsSuite extends QueryTest with SharedSQLContext {
Row("300", "100") :: Row("400", "100") :: Row("400-400", "100") :: Nil)
}

test("non-matching optional group") {
val df = Seq("aaaac").toDF("s")
checkAnswer(
df.select(regexp_extract($"s", "(a+)(b)?(c)", 2)),
Row("")
)
}

test("string ascii function") {
val df = Seq(("abc", "")).toDF("a", "b")
checkAnswer(
Expand Down