iRakson commented on a change in pull request #27580: [SPARK-27619][SQL]MapType
should be prohibited in hash expressions
URL: https://github.com/apache/spark/pull/27580#discussion_r381088173
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -2121,6 +2121,26 @@ class SQLQuerySuite extends QueryTest with
SharedSparkSession with AdaptiveSpark
}
}
+ test("SPARK-27619: Throw analysis exception when hash and xxhash64 is used
on MapType") {
+ Seq("hash", "xxhash64").foreach {
+ case hashExpression =>
+ intercept[AnalysisException] {
+ spark.createDataset(Map(1 -> 10, 2 -> 20) ::
Nil).selectExpr(s"$hashExpression(*)")
+ }
+ }
+ }
+
+ test("SPARK-27619: when spark.sql.legacy.useHashOnMapType is true, hash can
be used on Maptype") {
+ Seq("hash", "xxhash64").foreach {
+ case hashExpression =>
Review comment:
I modified the code.
----------------------------------------------------------------
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]