You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by yhuai <gi...@git.apache.org> on 2016/02/05 09:48:19 UTC

[GitHub] spark pull request: [SPARK-12789]Support order by index and group ...

Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10731#discussion_r51989906
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala ---
    @@ -456,21 +455,32 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
     
       test("literal in agg grouping expressions") {
         checkAnswer(
    -      sql("SELECT a, count(1) FROM testData2 GROUP BY a, 1"),
    -      Seq(Row(1, 2), Row(2, 2), Row(3, 2)))
    +      sql("SELECT SUM(a) FROM testData2 GROUP BY 2"),
    +      Seq(Row(6), Row(6)))
    +
         checkAnswer(
    -      sql("SELECT a, count(2) FROM testData2 GROUP BY a, 2"),
    +      sql("SELECT a, SUM(b) FROM testData2 GROUP BY 1"),
    +      Seq(Row(1, 3), Row(2, 3), Row(3, 3)))
    +
    +    checkAnswer(
    +      sql("SELECT a, count(1) FROM testData2 GROUP BY a, 1"),
           Seq(Row(1, 2), Row(2, 2), Row(3, 2)))
     
         checkAnswer(
           sql("SELECT a, 1, sum(b) FROM testData2 GROUP BY a, 1"),
    --- End diff --
    
    If we have a table with a single column, what will happen if we call `GROUP BY 1, 2`?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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