Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7709#discussion_r36106193
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala ---
    @@ -128,6 +128,18 @@ class StringFunctionsSuite extends QueryTest {
         // scalastyle:on
       }
     
    +  test("string translate") {
    +    val df = Seq(("translate", "")).toDF("a", "b")
    +
    +    checkAnswer(df.select(translate($"a", "rnlt", "123")), Row("1a2s3ae"))
    +    checkAnswer(df.select(translate($"a", "", "123")), Row("translate"))
    +    checkAnswer(df.select(translate($"a", "rnlt", "")), Row("asae"))
    +    // scalastyle:off
    +    // non ascii characters are not allowed in the source code, so we 
disable the scalastyle.
    +    checkAnswer(df.select(translate(lit("花花世界"), "花界", "ab")), 
Row("aa世b"))
    --- End diff --
    
    This is an end-to-end test for DataFrame or SQL parse, these special cases 
are not necessary here. Instead, we should have one fro SQL parser (using 
selectExpr())


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to