Github user chenghao-intel commented on a diff in the pull request:
https://github.com/apache/spark/pull/2802#discussion_r19849582
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUdfSuite.scala
---
@@ -87,8 +87,21 @@ class HiveUdfSuite extends QueryTest {
test("SPARK-2693 udaf aggregates test") {
checkAnswer(sql("SELECT percentile(key,1) FROM src LIMIT 1"),
sql("SELECT max(key) FROM src").collect().toSeq)
+
+ checkAnswer(sql("SELECT percentile(key,array(1,1)) FROM src LIMIT 1"),
+ sql("SELECT array(max(key),max(key)) FROM src").collect().toSeq)
+
+ TestHive.reset()
}
+ test("Generic UDAF aggregates") {
+ checkAnswer(sql("SELECT ceiling(percentile_approx(key,0.99999)) FROM
src LIMIT 1"),
+ sql("SELECT max(key) FROM src LIMIT 1").collect().toSeq)
+
+ checkAnswer(sql("SELECT percentile_approx(100.0, array(0.9,0.9)) FROM
src LIMIT 1"),
+ sql("SELECT array(100,100) FROM src LIMIT 1").collect().toSeq)
+ }
--- End diff --
A `tab` after `}`?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]