GitHub user watermen reopened a pull request:
https://github.com/apache/spark/pull/13321
[SPARK-15549][SQL] Bucket column only need to be found in the output of
relation when use bucketed table
## What changes were proposed in this pull request?
I create a bucketed table bucketed_table with bucket column i,
```scala
case class Data(i: Int, j: Int, k: Int)
sc.makeRDD(Array((1, 2, 3))).map(x => Data(x._1, x._2,
x._3)).toDF.write.bucketBy(2, "i").saveAsTable("bucketed_table")
```
and I run the following SQLs:
```sql
SELECT j FROM bucketed_table;
Error in query: bucket column i not found in existing columns (j);
SELECT j, MAX(k) FROM bucketed_table GROUP BY j;
Error in query: bucket column i not found in existing columns (j, k);
```
I think the bucket column only need to be found in the output of relation.
So the 2 SQLs above should be executed right.
## How was this patch tested?
Updated test cases to reflect the changes.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/watermen/spark SPARK-15549
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/13321.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 #13321
----
commit 59a8db6df43f52ad3437ed7ab2cf1381eca49ede
Author: Yadong Qi <[email protected]>
Date: 2016-05-27T06:55:31Z
Add a check.
----
---
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]