Repository: spark Updated Branches: refs/heads/branch-1.5 727944564 -> 76390ec00
[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 (cherry picked from commit a4acdabb103f6d04603163c9555c1ddc413c3b80) Signed-off-by: Michael Armbrust <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/76390ec0 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/76390ec0 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/76390ec0 Branch: refs/heads/branch-1.5 Commit: 76390ec00a659b5e3dead0792bfe51cbb59b883b Parents: 7279445 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:34 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/76390ec0/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]
