Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/14004#discussion_r69848674 --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala --- @@ -725,4 +725,41 @@ class StringExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { checkEvaluation(FindInSet(Literal("abf"), Literal("abc,b,ab,c,def")), 0) checkEvaluation(FindInSet(Literal("ab,"), Literal("abc,b,ab,c,def")), 0) } + + test("Sentences") { + val nullString = Literal.create(null, StringType) + checkEvaluation(Sentences(nullString, nullString, nullString), null, EmptyRow) + checkEvaluation(Sentences(nullString, nullString), null, EmptyRow) + checkEvaluation(Sentences(nullString), null, EmptyRow) + checkEvaluation(Sentences(Literal.create(null, NullType)), null, EmptyRow) + checkEvaluation(Sentences("", nullString, nullString), Seq.empty, EmptyRow) + checkEvaluation(Sentences("", nullString), Seq.empty, EmptyRow) + checkEvaluation(Sentences(""), Seq.empty, EmptyRow) + + val correct_answer = Seq( + Seq("Hi", "there"), + Seq("The", "price", "was"), + Seq("But", "not", "now")) + + // Hive compatible test-cases. + checkEvaluation( + Sentences("Hi there! The price was $1,234.56.... But, not now."), + correct_answer, + EmptyRow) --- End diff -- `EmptyRow` is the default value, we don't need to pass it.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org