Repository: spark
Updated Branches:
  refs/heads/master f68d02409 -> a4acdabb1


[SPARK-9950] [SQL] Wrong Analysis Error for grouping/aggregating on struct 
fields

This issue has been fixed by https://github.com/apache/spark/pull/8215, this PR 
added regression test for it.

Author: Wenchen Fan <[email protected]>

Closes #8222 from cloud-fan/minor and squashes the following commits:

0bbfb1c [Wenchen Fan] fix style...
7e2d8d9 [Wenchen Fan] add test


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/a4acdabb
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/a4acdabb
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/a4acdabb

Branch: refs/heads/master
Commit: a4acdabb103f6d04603163c9555c1ddc413c3b80
Parents: f68d024
Author: Wenchen Fan <[email protected]>
Authored: Mon Aug 17 11:36:18 2015 -0700
Committer: Michael Armbrust <[email protected]>
Committed: Mon Aug 17 11:36:18 2015 -0700

----------------------------------------------------------------------
 .../src/test/scala/org/apache/spark/sql/DataFrameSuite.scala    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/a4acdabb/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala 
b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
index cf22797..1e2aaae 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
@@ -873,4 +873,9 @@ class DataFrameSuite extends QueryTest with 
SharedSQLContext {
       """{"a": {"b": 1}}""" :: Nil))
     checkAnswer(df.orderBy("a.b"), Row(Row(1)))
   }
+
+  test("SPARK-9950: correctly analyze grouping/aggregating on struct fields") {
+    val df = Seq(("x", (1, 1)), ("y", (2, 2))).toDF("a", "b")
+    checkAnswer(df.groupBy("b._1").agg(sum("b._2")), Row(1, 1) :: Row(2, 2) :: 
Nil)
+  }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to