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

    https://github.com/apache/spark/pull/16068#discussion_r90763121
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala 
---
    @@ -487,6 +488,29 @@ class HiveUDFSuite extends QueryTest with 
TestHiveSingleton with SQLTestUtils {
         assert(count4 == 1)
         sql("DROP TABLE parquet_tmp")
       }
    +
    +  test("Hive Stateful UDF") {
    +    sql(s"CREATE TEMPORARY FUNCTION statefulUDF AS 
'${classOf[StatefulUDF].getName}'")
    +    sql(s"CREATE TEMPORARY FUNCTION statelessUDF AS 
'${classOf[StatelessUDF].getName}'")
    +    val testData = spark.sparkContext.parallelize(
    +      (0 until 10) map(x => IntegerCaseClass(1)), 2).toDF()
    +    testData.createOrReplaceTempView("inputTable")
    +    val max1 =
    +      sql("SELECT MAX(s) FROM (" +
    +        "SELECT statefulUDF() as s FROM (SELECT i from inputTable 
DISTRIBUTE by i) a" +
    +        ") b").head().getLong(0)
    --- End diff --
    
    will rewrite it after gathering feedback from others.


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