uros-b commented on code in PR #57298:
URL: https://github.com/apache/spark/pull/57298#discussion_r3603943973
##########
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:
Please use the suite-idiomatic `checkError` pattern instead of raw
intercept/assert.
--
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]