GitHub user scwf opened a pull request:
https://github.com/apache/spark/pull/4169
[SPARK-5373][SQL] Literal in agg grouping expressioons leads to incorrect
result
`select key, count( * ) from src group by key, 1` will get the wrong
answer.
e.g. for this table
```
val testData2 =
TestSQLContext.sparkContext.parallelize(
TestData2(1, 1) ::
TestData2(1, 2) ::
TestData2(2, 1) ::
TestData2(2, 2) ::
TestData2(3, 1) ::
TestData2(3, 2) :: Nil, 2).toSchemaRDD
testData2.registerTempTable("testData2")
```
result of `SELECT a, count(1) FROM testData2 GROUP BY a, 1` is
```
[1,1]
[2,2]
[3,1]
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/scwf/spark agg-bug
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/4169.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #4169
----
commit 05751dbe9837c7ab82a8b468b457dc6e7bb2b70d
Author: wangfei <[email protected]>
Date: 2015-01-23T02:49:43Z
fix bugs when literal in agg grouping expressioons
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]