Skip to content

[SPARK-6459][SQL] Warn when constructing trivially true equals predicate#5163

Closed
marmbrus wants to merge 2 commits into
apache:masterfrom
marmbrus:selfJoinError
Closed

[SPARK-6459][SQL] Warn when constructing trivially true equals predicate#5163
marmbrus wants to merge 2 commits into
apache:masterfrom
marmbrus:selfJoinError

Conversation

@marmbrus

Copy link
Copy Markdown
Contributor

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.

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")

@SparkQA

SparkQA commented Mar 24, 2015

Copy link
Copy Markdown

Test build #29075 has finished for PR 5163 at commit 16c1f0b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class Column(protected[sql] val expr: Expression) extends Logging

@yhuai

yhuai commented Mar 24, 2015

Copy link
Copy Markdown
Contributor

LGTM

asfgit pushed a commit that referenced this pull request Mar 24, 2015
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")
```

Author: Michael Armbrust <michael@databricks.com>

Closes #5163 from marmbrus/selfJoinError and squashes the following commits:

16c1f0b [Michael Armbrust] fix visibility
1b57e8d [Michael Armbrust] Warn when constructing trivially true equals predicate

(cherry picked from commit 32efadd)
Signed-off-by: Michael Armbrust <michael@databricks.com>
@asfgit asfgit closed this in 32efadd Mar 24, 2015
@marmbrus marmbrus deleted the selfJoinError branch August 3, 2015 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants