[ 
https://issues.apache.org/jira/browse/SPARK-6583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14729625#comment-14729625
 ] 

Harish Butani commented on SPARK-6583:
--------------------------------------

The following still fails on the master branch. Can you please confirm? 

{code}
val df = sqlContext.read.json("examples/src/main/resources/people.json")
df.registerTempTable("t")
val df2 = sqlContext.sql("select age, count(*) from t group by age order by 
count(*)")
df2.show()
{code}

{code:title=StackTrace}
Caused by: org.apache.spark.sql.catalyst.errors.package$TreeNodeException: No 
function to evaluate expression. type: Count, tree: COUNT(1)
        at 
org.apache.spark.sql.catalyst.expressions.AggregateExpression.eval(aggregates.scala:41)
        at 
org.apache.spark.sql.catalyst.expressions.RowOrdering.compare(rows.scala:219)
{code}

In 1.4 the issue seemed to be BindReferences.bindReference didn't handle this 
case.
Haven't looked at 1.5 code, but don't see a change to bindReference in this 
patch.

> Support aggregated function in order by
> ---------------------------------------
>
>                 Key: SPARK-6583
>                 URL: https://issues.apache.org/jira/browse/SPARK-6583
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.3.0
>            Reporter: Yadong Qi
>            Assignee: Yadong Qi
>             Fix For: 1.5.0
>
>




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

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

Reply via email to