Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-10437

Support aggregation expressions in Order By

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.6.0
    • SQL
    • None

    Description

      Followup on SPARK-6583

      The following still fails.

      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()
      
      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)
      

      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.

      Attachments

        Issue Links

          Activity

            People

              viirya L. C. Hsieh
              rhbutani Harish Butani
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: