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

    https://github.com/apache/spark/pull/6274#discussion_r30672622
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
 ---
    @@ -291,6 +291,29 @@ class HiveQuerySuite extends HiveComparisonTest with 
BeforeAndAfter {
           assert(x._1 == x._2.asInstanceOf[Double]))
       }
     
    +  // `Math.exp(1.0)` has different result for different jdk version, so 
not use createQueryTest
    +  test("udf_java_method") {
    +    val res = sql(
    +      """
    +        |SELECT java_method("java.lang.String", "valueOf", 1),
    +        |       java_method("java.lang.String", "isEmpty"),
    +        |       java_method("java.lang.Math", "max", 2, 3),
    +        |       java_method("java.lang.Math", "min", 2, 3),
    +        |       java_method("java.lang.Math", "round", 2.5),
    +        |       java_method("java.lang.Math", "exp", 1.0),
    +        |       java_method("java.lang.Math", "floor", 1.9)
    +        |FROM src tablesample (1 rows)
    +      """.stripMargin).collect().head
    +    Seq(
    +      "1",
    +      "true",
    +      java.lang.Math.max(2, 3).toString,
    +      java.lang.Math.min(2, 3).toString,
    +      java.lang.Math.round(2.5).toString,
    +      java.lang.Math.exp(1.0).toString,
    +      java.lang.Math.floor(1.9).toString).zip(res.toSeq).foreach( x => 
assert(x._1 == x._2))
    --- End diff --
    
    Done


---
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