GitHub user marmbrus opened a pull request:
https://github.com/apache/spark/pull/5163
[SPARK-6459][SQL] Warn when constructing trivially true equals predicate
For example, one might expect the following code to work, but it does not.
Now you will at least get a warning with a suggestion to use aliases.
```scala
val df = sqlContext.load(path, "parquet")
val txns = df.groupBy("cust_id").agg($"cust_id",
countDistinct($"day_num").as("txns"))
val spend = df.groupBy("cust_id").agg($"cust_id",
sum($"extended_price").as("spend"))
val rmJoin = txns.join(spend, txns("cust_id") === spend("cust_id"), "inner")
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/marmbrus/spark selfJoinError
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5163.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 #5163
----
commit 1b57e8da974af5a0497ae4723fde9242446fabf8
Author: Michael Armbrust <[email protected]>
Date: 2015-03-24T08:36:54Z
Warn when constructing trivially true equals predicate
commit 16c1f0b352c7ca3e51fa64f4c08ede23dfcddcbe
Author: Michael Armbrust <[email protected]>
Date: 2015-03-24T08:39:42Z
fix visibility
----
---
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]