viirya commented on a change in pull request #25215: [SPARK-28445][SQL][Python] 
Fix error when PythonUDF is used in both group by and aggregate expression
URL: https://github.com/apache/spark/pull/25215#discussion_r305661718
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
 ##########
 @@ -2189,4 +2189,50 @@ class DataFrameSuite extends QueryTest with 
SharedSQLContext {
           |*(1) Range (0, 10, step=1, splits=2)""".stripMargin))
     }
   }
+
+  test("SPARK-28445: PythonUDF in grouping key and aggregate expressions") {
+    import IntegratedUDFTestUtils._
+
+    val scalaTestUDF = TestScalaUDF(name = "scalaUDF")
+    val pythonTestUDF = TestPythonUDF(name = "pyUDF")
+    assume(shouldTestPythonUDFs)
+
+    withTempView("testData") {
+      sql(
+        """CREATE OR REPLACE TEMPORARY VIEW testData AS
+          |SELECT * FROM VALUES
+          |(1, 1), (1, 2), (2, 1), (2, 2), (3, 1), (3, 2), (null, 1), (3, 
null), (null, null)
+          |AS testData(a, b)""".stripMargin)
+
+      val base = spark.table("testData")
 
 Review comment:
   oh, seems fine. :)
   

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


With regards,
Apache Git Services

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

Reply via email to