You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2015/05/30 08:37:17 UTC

[jira] [Updated] (SPARK-7963) order by should support aggregate functions

     [ https://issues.apache.org/jira/browse/SPARK-7963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reynold Xin updated SPARK-7963:
-------------------------------
    Target Version/s: 1.5.0

> order by should support aggregate functions
> -------------------------------------------
>
>                 Key: SPARK-7963
>                 URL: https://issues.apache.org/jira/browse/SPARK-7963
>             Project: Spark
>          Issue Type: New Feature
>          Components: SQL
>            Reporter: Reynold Xin
>
> {code}
> select github_username, avg(1)
> from spark_prs_issue_comment, spark_prs_user
> where
> 	author_id = spark_prs_user.id and
>     body like "%LGTM%"
> group by github_username
> order by avg(1) desc
> {code}
> Throws exception
> {code}
> org.apache.spark.sql.catalyst.errors.package$TreeNodeException: No function to evaluate expression. type: Average, tree: AVG(1)
> 	at org.apache.spark.sql.catalyst.expressions.AggregateExpression.eval(aggregates.scala:41)
> 	at org.apache.spark.sql.catalyst.expressions.RowOrdering.compare(rows.scala:212)
> 	at org.apache.spark.sql.catalyst.expressions.RowOrdering.compare(rows.scala:204)
> 	at scala.math.Ordering$$anon$4.compare(Ordering.scala:111)
> 	at java.util.PriorityQueue.siftUpUsingComparator(PriorityQueue.java:649)
> 	at java.util.PriorityQueue.siftUp(PriorityQueue.java:627)
> 	at java.util.PriorityQueue.offer(PriorityQueue.java:329)
> 	at org.apache.spark.util.BoundedPriorityQueue.$plus$eq(BoundedPriorityQueue.scala:47)
> 	at org.apache.spark.util.BoundedPriorityQueue$$anonfun$$plus$plus$eq$1.apply(BoundedPriorityQueue.scala:41)
> 	at org.apache.spark.util.BoundedPriorityQueue$$anonfun$$plus$plus$eq$1.apply(BoundedPriorityQueue.scala:41)
> 	at scala.collection.Iterator$class.foreach(Iterator.scala:727)
> 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
> 	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
> 	at org.apache.spark.util.BoundedPriorityQueue.foreach(BoundedPriorityQueue.scala:31)
> 	at org.apache.spark.util.BoundedPriorityQueue.$plus$plus$eq(BoundedPriorityQueue.scala:41)
> 	at org.apache.spark.rdd.RDD$$anonfun$takeOrdered$1.apply(RDD.scala:1241)
> 	at org.apache.spark.rdd.RDD$$anonfun$takeOrdered$1.apply(RDD.scala:1240)
> 	at org.apache.spark.rdd.RDD$$anonfun$20.apply(RDD.scala:895)
> 	at org.apache.spark.rdd.RDD$$anonfun$20.apply(RDD.scala:892)
> 	at org.apache.spark.scheduler.JobWaiter.taskSucceeded(JobWaiter.scala:56)
> 	at org.apache.spark.scheduler.DAGScheduler.handleTaskCompletion(DAGScheduler.scala:962)
> 	... 3 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org