Skip to content

[SPARK-23192] [SQL] Keep the Hint after Using Cached Data - #20365

Closed
gatorsmile wants to merge 2 commits into
apache:masterfrom
gatorsmile:fixBroadcastHintloss
Closed

[SPARK-23192] [SQL] Keep the Hint after Using Cached Data#20365
gatorsmile wants to merge 2 commits into
apache:masterfrom
gatorsmile:fixBroadcastHintloss

Conversation

@gatorsmile

@gatorsmilegatorsmile commented Jan 23, 2018

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

The hint of the plan segment is lost, when the plan segment is replaced by the cached data.

valdf1= spark.createDataFrame(Seq((1, "4"), (2, "2"))).toDF("key", "value")
valdf2= spark.createDataFrame(Seq((1, "1"), (2, "2"))).toDF("key", "value")
df2.cache()
valdf3= df1.join(broadcast(df2), Seq("key"), "inner")

This PR is to fix it.

How was this patch tested?

Added a test

@gatorsmile

Copy link
Copy Markdown
MemberAuthor

@sameeragarwal

Copy link
Copy Markdown
Member

LGTM

@dongjoon-hyundongjoon-hyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

@SparkQA

Copy link
Copy Markdown

Test build #86536 has finished for PR 20365 at commit 1186ef5.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jiangxb1987

Copy link
Copy Markdown
Contributor

retest this please

@SparkQA

Copy link
Copy Markdown

Test build #86544 has finished for PR 20365 at commit 1186ef5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile

Copy link
Copy Markdown
MemberAuthor

Since the last change is just to change the test case name, I merge this PR.

@gatorsmile

Copy link
Copy Markdown
MemberAuthor

Thanks! Merged to master/2.3

asfgit pushed a commit that referenced this pull request Jan 23, 2018
## What changes were proposed in this pull request?
The hint of the plan segment is lost, if the plan segment is replaced by the cached data.
```Scala
val df1 = spark.createDataFrame(Seq((1, "4"), (2, "2"))).toDF("key", "value")
val df2 = spark.createDataFrame(Seq((1, "1"), (2, "2"))).toDF("key", "value")
df2.cache()
val df3 = df1.join(broadcast(df2), Seq("key"), "inner")
```
This PR is to fix it.
## How was this patch tested?
Added a test
Author: gatorsmile <gatorsmile@gmail.com>
Closes#20365 from gatorsmile/fixBroadcastHintloss.
(cherry picked from commit 613c290)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
@SparkQA

Copy link
Copy Markdown

Test build #86546 has finished for PR 20365 at commit 7209792.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Sign up for freeto 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.

5 participants

@gatorsmile@sameeragarwal@SparkQA@jiangxb1987@dongjoon-hyun