superdiaodiao commented on code in PR #57298:
URL: https://github.com/apache/spark/pull/57298#discussion_r3748852777


##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala:
##########
@@ -234,6 +234,16 @@ class DataFrameAggregateSuite extends SharedSparkSession
     }
   }
 
+  test("SPARK-38983: grouping functions in boolean expressions report type 
mismatch") {
+    Seq(grouping("course"), grouping_id("course", "year")).foreach { 
groupingExpr =>
+      val error = intercept[AnalysisException] {
+        courseSales.cube("course", "year").agg(groupingExpr && 
lit(true)).collect()
+      }
+      assert(error.getCondition === "DATATYPE_MISMATCH.BINARY_OP_DIFF_TYPES")
+      assert(!error.getMessage.contains("grouping()/grouping_id() can only be 
used"))

Review Comment:
   @uros-b Gentle ping — both review comments have been addressed 
(rollup/groupingSets are covered alongside cube, and the test uses the 
suite-idiomatic checkError pattern) and CI is green. Please take another look 
when you have a chance. Thanks!



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

To unsubscribe, e-mail: [email protected]

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