Github user liancheng commented on a diff in the pull request: https://github.com/apache/spark/pull/8889#discussion_r40477126 --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala --- @@ -1223,4 +1223,26 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton { checkAnswer(df, (0 until 5).map(i => Row(i + "#", i + "#"))) } + + test("SPARK-10741: Sort on Aggregate using parquet") { + withTable("test10741") { + sql("CREATE TABLE test10741(c1 STRING, c2 INT) STORED AS PARQUET") + + checkAnswer(sql( + """ + |SELECT c1, AVG(c2) AS c_avg + |FROM test10741 + |GROUP BY c1 + |HAVING (AVG(c2) > 5) ORDER BY c1 + """.stripMargin), Nil) + + checkAnswer(sql( + """ + |SELECT c1, AVG(c2) AS c_avg + |FROM test10741 + |GROUP BY c1 + |ORDER BY AVG(c2) + """.stripMargin), Nil) --- End diff -- Would be better to insert some testing data into the table so that we can assert that the `ORDER BY` actually works.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org