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-22916][SQL] shouldn't bias towards build right if user does not specify #20099

Closed
wants to merge 4 commits into from
Closed

[SPARK-22916][SQL] shouldn't bias towards build right if user does not specify #20099

wants to merge 4 commits into from

Conversation

liufengdb
Copy link

@liufengdb liufengdb commented Dec 28, 2017

What changes were proposed in this pull request?

When there are no broadcast hints, the current spark strategies will prefer to building the right side, without considering the sizes of the two tables. This patch added the logic to consider the sizes of the two tables for the build side. To make the logic clear, the build side is determined by two steps:

  1. If there are broadcast hints, the build side is determined by broadcastSideByHints;
  2. If there are no broadcast hints, the build side is determined by broadcastSideBySizes;
  3. If the broadcast is disabled by the config, it falls back to the next cases.

How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)

Please review http://spark.apache.org/contributing.html before opening a pull request.

@SparkQA
Copy link

SparkQA commented Dec 28, 2017

Test build #85449 has finished for PR 20099 at commit e4b63f5.

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

@SparkQA
Copy link

SparkQA commented Dec 28, 2017

Test build #85458 has finished for PR 20099 at commit 2e0007d.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 28, 2017

Test build #85459 has finished for PR 20099 at commit a171f29.

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

@gatorsmile
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Dec 28, 2017

Test build #85471 has finished for PR 20099 at commit a171f29.

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

}
}

private def needsBroadcastByHints(joinType: JoinType, left: LogicalPlan, right: LogicalPlan)
Copy link

Choose a reason for hiding this comment

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

Maybe using canBroadcastByHints more consistent with the naming convention?

buildLeft || buildRight
}

private def broadcastSideByConfig(joinType: JoinType, left: LogicalPlan, right: LogicalPlan)
Copy link

Choose a reason for hiding this comment

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

Is is better to use xxxbySize? byConfig might confuse people.

@SparkQA
Copy link

SparkQA commented Dec 29, 2017

Test build #85484 has finished for PR 20099 at commit 41ba559.

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

@SparkQA
Copy link

SparkQA commented Dec 29, 2017

Test build #85486 has finished for PR 20099 at commit 4080bb1.

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

Copy link
Member

@gatorsmile gatorsmile left a comment

Choose a reason for hiding this comment

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

LGTM

@gatorsmile
Copy link
Member

Thanks! Merged to master.

@asfgit asfgit closed this in cc30ef8 Dec 29, 2017
@cloud-fan
Copy link
Contributor

a late LGTM!

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.

5 participants