Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Formatting.
  • Loading branch information
marmbrus committed May 12, 2014
commit a92ed0cfbc9fbfada933f702e3879e70cb95283c
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,36 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
*/
object HashJoin extends Strategy with PredicateHelper {
var broadcastTables: Seq[String] =
sparkContext.conf.get("spark.sql.hints.broadcastTables", "").split(",")
sparkContext.conf.get("spark.sql.hints.broadcastTables", "").split(",").toBuffer

def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {

case HashFilteredJoin(Inner, leftKeys, rightKeys, condition,
left, PhysicalOperation(_, _, b: BaseRelation)) if broadcastTables.contains(b.tableName)=>
case HashFilteredJoin(
Inner,
leftKeys,
rightKeys,
condition,
left,
right @ PhysicalOperation(_, _, b: BaseRelation))
if broadcastTables.contains(b.tableName)=>

val hashJoin =
execution.BroadcastHashJoin(
leftKeys, rightKeys, BuildRight, planLater(left), planLater(b))(sparkContext)
leftKeys, rightKeys, BuildRight, planLater(left), planLater(right))(sparkContext)
condition.map(Filter(_, hashJoin)).getOrElse(hashJoin) :: Nil

case HashFilteredJoin(Inner, leftKeys, rightKeys, condition,
PhysicalOperation(_, _, b: BaseRelation), right) if broadcastTables.contains(b.tableName)=>
case HashFilteredJoin(
Inner,
leftKeys,
rightKeys,
condition,
left @ PhysicalOperation(_, _, b: BaseRelation),
right)
if broadcastTables.contains(b.tableName) =>

val hashJoin =
execution.BroadcastHashJoin(
leftKeys, rightKeys, BuildLeft, planLater(b), planLater(right))(sparkContext)
leftKeys, rightKeys, BuildLeft, planLater(left), planLater(right))(sparkContext)
condition.map(Filter(_, hashJoin)).getOrElse(hashJoin) :: Nil

case HashFilteredJoin(Inner, leftKeys, rightKeys, condition, left, right) =>
Expand Down