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

    https://github.com/apache/spark/pull/15694#discussion_r85802668
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/MiscFunctionsSuite.scala ---
    @@ -31,6 +34,47 @@ class MiscFunctionsSuite extends QueryTest with 
SharedSQLContext {
             s"java_method('$className', 'method1', a, b)"),
           Row("m1one", "m1one"))
       }
    +
    +  test("reflect and java_method throw an analysis exception for 
unsupported types") {
    +    val df = Seq((new Timestamp(1), Decimal(10))).toDF("a", "b")
    +    val className = ReflectClass.getClass.getName.stripSuffix("$")
    +    val messageOne = intercept[AnalysisException] {
    +      df.selectExpr(
    +        s"reflect('$className', 'method1', a, b)").collect()
    +    }.getMessage
    +
    +    assert(messageOne.contains(
    +      "arguments from the third require boolean, byte, short, " +
    +        "integer, long, float, double or string expressions"))
    +
    +    val messageTwo = intercept[AnalysisException] {
    +      df.selectExpr(
    +        s"java_method('$className', 'method1', a, b)").collect()
    +    }.getMessage
    +
    +    assert(messageTwo.contains(
    +      "arguments from the third require boolean, byte, short, " +
    +        "integer, long, float, double or string expressions"))
    +  }
    +
    +  test("reflect and java_method throw an analysis exception for 
non-existing method/class") {
    --- End diff --
    
    this is already tested in CallMethodViaReflectionSuite isn't 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

Reply via email to