Skip to content

[SPARK-26576][SQL] Broadcast hint not applied to partitioned table#23507

Closed
jzhuge wants to merge 3 commits into
apache:branch-2.4from
jzhuge:SPARK-26576
Closed

[SPARK-26576][SQL] Broadcast hint not applied to partitioned table#23507
jzhuge wants to merge 3 commits into
apache:branch-2.4from
jzhuge:SPARK-26576

Conversation

@jzhuge

@jzhuge jzhuge commented Jan 10, 2019

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Make sure broadcast hint is applied to partitioned tables.

Since the issue exists in branch 2.0 to 2.4, but not in master, I created this PR for branch-2.4.

How was this patch tested?

  • A new unit test in PruneFileSourcePartitionsSuite
  • Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

@cloud-fan @davies @rxin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we check the physical plan to make sure BroadcastJoin is picked?

@maryannxue maryannxue Jan 10, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1. And since master doesn't use ResolvedHint in optimization anymore, this issue doesn't exist in master, but figured it wouldn't hurt to add a test in master too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fine with porting at least the unit test to master.

@cloud-fan

Copy link
Copy Markdown
Contributor

ok to test

@cloud-fan

Copy link
Copy Markdown
Contributor

cc @gatorsmile @maryannxue

@SparkQA

SparkQA commented Jan 10, 2019

Copy link
Copy Markdown

Test build #101013 has finished for PR 23507 at commit c3217f7.

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

@SparkQA

SparkQA commented Jan 10, 2019

Copy link
Copy Markdown

Test build #101035 has finished for PR 23507 at commit dae47f1.

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have tried this fix, it works. However, I am not sure about the original rational to add this code in SPARK-14581, and trying to minimize the impact of removing it because there are other callers of PhysicalOperation.unapply.

If @davies and @cloud-fan are ok and we can pass test cases covering the scenarios for this code, I'd be happy to go with this fix.

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.

Just a bug.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems better to remove that line.

@jzhuge

jzhuge commented Jan 11, 2019

Copy link
Copy Markdown
Member Author

Test build #101035 failures seem unrelated. VersionSuite and HiveClientSuites pass locally for me.

@SparkQA

SparkQA commented Jan 11, 2019

Copy link
Copy Markdown

Test build #101053 has finished for PR 23507 at commit 2189ce0.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan

Copy link
Copy Markdown
Contributor

retest this please

@SparkQA

SparkQA commented Jan 11, 2019

Copy link
Copy Markdown

Test build #101082 has finished for PR 23507 at commit 2189ce0.

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

@gatorsmile

Copy link
Copy Markdown
Member

LGTM. Thanks! Merged to 2.4 and 2.3.

asfgit pushed a commit that referenced this pull request Jan 11, 2019
## What changes were proposed in this pull request?

Make sure broadcast hint is applied to partitioned tables.

Since the issue exists in branch 2.0 to 2.4, but not in master, I created this PR for branch-2.4.

## How was this patch tested?

- A new unit test in PruneFileSourcePartitionsSuite
- Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

cloud-fan davies rxin

Closes #23507 from jzhuge/SPARK-26576.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
asfgit pushed a commit that referenced this pull request Jan 11, 2019
## What changes were proposed in this pull request?

Make sure broadcast hint is applied to partitioned tables.

Since the issue exists in branch 2.0 to 2.4, but not in master, I created this PR for branch-2.4.

## How was this patch tested?

- A new unit test in PruneFileSourcePartitionsSuite
- Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

cloud-fan davies rxin

Closes #23507 from jzhuge/SPARK-26576.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
(cherry picked from commit b9eb0e8)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
@gatorsmile gatorsmile closed this Jan 11, 2019
@jzhuge

jzhuge commented Jan 11, 2019

Copy link
Copy Markdown
Member Author

Thx @gatorsmile!

Should we merge it to master any way? Remove the buggy/dead code and add a unit test.

@cloud-fan

Copy link
Copy Markdown
Contributor

The buggy code doesn't exist in master anymore, but it will be great to put the test in master. Can you send a PR to do it? thanks!

jzhuge added a commit to jzhuge/spark that referenced this pull request Jan 12, 2019
## What changes were proposed in this pull request?

Make sure broadcast hint is applied to partitioned tables.

## How was this patch tested?

- A new unit test in PruneFileSourcePartitionsSuite
- Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

Closes apache#23507 from jzhuge/SPARK-26576.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
(cherry picked from commit b9eb0e8)
@srowen

srowen commented Jan 13, 2019

Copy link
Copy Markdown
Member

I'm not 100% sure, but I think this is causing StreamingQuerySuite to fail consistently in 2.3, but not 2.4. See failures from https://amplab.cs.berkeley.edu/jenkins/view/Spark%20QA%20Test%20(Dashboard)/ and drill down to things like https://amplab.cs.berkeley.edu/jenkins/view/Spark%20QA%20Test%20(Dashboard)/job/spark-branch-2.3-test-maven-hadoop-2.6/577/testReport/ . Most of the subsequent build failures seem to be related to this test.

CC @maropu as this probably affects a 2.3.3 release.
@jzhuge @gatorsmile what do you think, is it an issue, and should we fix-forward or just revert from 2.3?

asfgit pushed a commit that referenced this pull request Jan 13, 2019
## What changes were proposed in this pull request?

Make sure broadcast hint is applied to partitioned tables.

## How was this patch tested?

- A new unit test in PruneFileSourcePartitionsSuite
- Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

Closes #23507 from jzhuge/SPARK-26576.

Closes #23530 from jzhuge/SPARK-26576-master.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
@jzhuge

jzhuge commented Jan 14, 2019 via email

Copy link
Copy Markdown
Member Author

@maropu

maropu commented Jan 14, 2019

Copy link
Copy Markdown
Member

Sorry, but the rightest column in the page @gatorsmile showed means what? It seems StreamingOuterJoinSuite fails but the column shows pass?
Anyway, I'm not sure about why though, most of StreamingOuterJoinSuite test runs failed after this commit.... I'm running the test in branch-2.3 on my AWS env now...

@maropu

maropu commented Jan 14, 2019

Copy link
Copy Markdown
Member

I tried to run the unit tests windowed left outer join and windowed right outer join in StreamingOuterJoinSuite 3 times on my AWS env.(m4.2xlarge) though, all the runs passed....
Added cc: @tdas because these tests are related to structured streaming stuffs

@srowen

srowen commented Jan 14, 2019

Copy link
Copy Markdown
Member

It's possible it merely uncovered a different problem, in the test or main code, that only exists in 2.3.

How important is the change for 2.3? given that there is a release imminent, would it be OK to revert it now in 2.3, or does that lose an important fix?

@maropu

maropu commented Jan 15, 2019

Copy link
Copy Markdown
Member

+1 for reverting it from v2.3 (it might be worth digging into the cause though, IMO its not worth blocking the v2.3 release).
If other guys agree to that, I'll do it.

@gatorsmile

gatorsmile commented Jan 15, 2019 via email

Copy link
Copy Markdown
Member

@jzhuge

jzhuge commented Jan 15, 2019 via email

Copy link
Copy Markdown
Member Author

@maropu

maropu commented Jan 15, 2019

Copy link
Copy Markdown
Member

What I really concern about is; should we fix the StreamingOuterJoinSuite issue before the v2.3.3 release? StreamingOuterJoinSuite sometimes fails before this commit and the test seems to be originally flaky in branch-2.3 only...

@srowen

srowen commented Jan 15, 2019

Copy link
Copy Markdown
Member

That would be ideal, of course; I have no idea what the issue is or difference is with 2.4. Up to you whether you want to investigate and hold up 2.3.3, or just punt on it and revert this commit and go ahead.

@maropu

maropu commented Jan 16, 2019

Copy link
Copy Markdown
Member

ok, for now, I'll revert the commit and start the vote for the v2.3.3 release.

@maropu

maropu commented Jan 16, 2019

Copy link
Copy Markdown
Member

I reverted this commit from branch-2.3, and then added a tag for v2.3.3-rc1 in the head.
https://github.com/apache/spark/commits/branch-2.3

I'm re-publishing a candidate now, so I'll start a first vote for v2.3.3 in a few days after the Jenkins tests checked.

@gatorsmile

Copy link
Copy Markdown
Member

Thanks! @maropu

jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
## What changes were proposed in this pull request?

Make sure broadcast hint is applied to partitioned tables.

## How was this patch tested?

- A new unit test in PruneFileSourcePartitionsSuite
- Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

Closes apache#23507 from jzhuge/SPARK-26576.

Closes apache#23530 from jzhuge/SPARK-26576-master.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
rdblue pushed a commit to rdblue/spark that referenced this pull request Apr 3, 2019
Make sure broadcast hint is applied to partitioned tables.

Since the issue exists in branch 2.0 to 2.4, but not in master, I created this PR for branch-2.4.

- A new unit test in PruneFileSourcePartitionsSuite
- Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

cloud-fan davies rxin

Closes apache#23507 from jzhuge/SPARK-26576.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
(cherry picked from commit b9eb0e8)

Conflicts:
	sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala
	sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneFileSourcePartitionsSuite.scala
rdblue pushed a commit to rdblue/spark that referenced this pull request Apr 3, 2019
Make sure broadcast hint is applied to partitioned tables.

Since the issue exists in branch 2.0 to 2.4, but not in master, I created this PR for branch-2.4.

- A new unit test in PruneFileSourcePartitionsSuite
- Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

cloud-fan davies rxin

Closes apache#23507 from jzhuge/SPARK-26576.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
(cherry picked from commit b9eb0e8)

Conflicts:
	sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala
	sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneFileSourcePartitionsSuite.scala
kai-chi pushed a commit to kai-chi/spark that referenced this pull request Jul 23, 2019
## What changes were proposed in this pull request?

Make sure broadcast hint is applied to partitioned tables.

Since the issue exists in branch 2.0 to 2.4, but not in master, I created this PR for branch-2.4.

## How was this patch tested?

- A new unit test in PruneFileSourcePartitionsSuite
- Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

cloud-fan davies rxin

Closes apache#23507 from jzhuge/SPARK-26576.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
kai-chi pushed a commit to kai-chi/spark that referenced this pull request Aug 1, 2019
## What changes were proposed in this pull request?

Make sure broadcast hint is applied to partitioned tables.

Since the issue exists in branch 2.0 to 2.4, but not in master, I created this PR for branch-2.4.

## How was this patch tested?

- A new unit test in PruneFileSourcePartitionsSuite
- Unit test suites touched by SPARK-14581: JoinOptimizationSuite, FilterPushdownSuite, ColumnPruningSuite, and PruneFiltersSuite

cloud-fan davies rxin

Closes apache#23507 from jzhuge/SPARK-26576.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
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.

7 participants