Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from

Conversation

gatorsmile
Copy link
Member

@gatorsmile gatorsmile commented Jan 23, 2018

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.

      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

@gatorsmile
Copy link
Member Author

@sameeragarwal
Copy link
Member

LGTM

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

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

SparkQA commented Jan 23, 2018

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
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Jan 23, 2018

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
Member Author

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

@gatorsmile
Copy link
Member Author

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>
@asfgit asfgit closed this in 613c290 Jan 23, 2018
@SparkQA
Copy link

SparkQA commented Jan 24, 2018

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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants