aboutsummaryrefslogtreecommitdiff
path: root/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala
diff options
context:
space:
mode:
Diffstat (limited to 'sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala')
-rw-r--r--sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala
index 4a8086d7e5..84f915977b 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala
@@ -509,6 +509,19 @@ abstract class AggregationQuerySuite extends QueryTest with SQLTestUtils with Te
Row(null, null, 110.0, null, null, 10.0) :: Nil)
}
+ test("non-deterministic children expressions of UDAF") {
+ val e = intercept[AnalysisException] {
+ spark.sql(
+ """
+ |SELECT mydoublesum(value + 1.5 * key + rand())
+ |FROM agg1
+ |GROUP BY key
+ """.stripMargin)
+ }.getMessage
+ assert(Seq("nondeterministic expression",
+ "should not appear in the arguments of an aggregate function").forall(e.contains))
+ }
+
test("interpreted aggregate function") {
checkAnswer(
spark.sql(