wangyum commented on a change in pull request #29490:
URL: https://github.com/apache/spark/pull/29490#discussion_r550949512



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
##########
@@ -2176,8 +2176,7 @@ abstract class SQLQuerySuiteBase extends QueryTest with 
SQLTestUtils with TestHi
       sql(
         s"""
            |CREATE TEMPORARY FUNCTION udtf_stack2
-           |AS 'org.apache.spark.sql.hive.execution.UDTFStack2'
-           |USING JAR '${hiveContext.getHiveFile("SPARK-21101-1.0.jar").toURI}'
+           |AS 'org.apache.spark.sql.hive.execution.UDTFStack3'

Review comment:
       Just replace this test with:
   ```scala
     test("SPARK-32668: HiveGenericUDTF initialize UDTF should use 
StructObjectInspector method") {
       withUserDefinedFunction("udtf_stack1" -> true, "udtf_stack2" -> true) {
         sql(
           s"""
              |CREATE TEMPORARY FUNCTION udtf_stack1
              |AS 'org.apache.spark.sql.hive.execution.UDTFStack'
              |USING JAR 
'${hiveContext.getHiveFile("SPARK-21101-1.0.jar").toURI}'
           """.stripMargin)
         sql(
           s"""
              |CREATE TEMPORARY FUNCTION udtf_stack2
              |AS 'org.apache.spark.sql.hive.execution.UDTFStack2'
              |USING JAR 
'${hiveContext.getHiveFile("SPARK-21101-1.0.jar").toURI}'
           """.stripMargin)
   
         Seq("udtf_stack1", "udtf_stack2").foreach { udf =>
           checkAnswer(
             sql(s"SELECT $udf(2, 'A', 10, date '2015-01-01', 'B', 20, date 
'2016-01-01')"),
             Seq(Row("A", 10, Date.valueOf("2015-01-01")),
               Row("B", 20, Date.valueOf("2016-01-01"))))
         }
       }
     }
   ```
   ?
   
   `UDTFStack` and `UDTFStack2 ` are two ways to implement UDTF.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to