@@ -35,11 +35,11 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
3535 def apply (plan : LogicalPlan ): Seq [SparkPlan ] = plan match {
3636 // Find left semi joins where at least some predicates can be evaluated by matching join keys
3737 case ExtractEquiJoinKeys (LeftSemi , leftKeys, rightKeys, condition, left, right) =>
38- val semiJoin = join .LeftSemiJoinHash (leftKeys, rightKeys, planLater(left), planLater(right))
38+ val semiJoin = joins .LeftSemiJoinHash (leftKeys, rightKeys, planLater(left), planLater(right))
3939 condition.map(Filter (_, semiJoin)).getOrElse(semiJoin) :: Nil
4040 // no predicate can be evaluated by matching hash keys
4141 case logical.Join (left, right, LeftSemi , condition) =>
42- join .LeftSemiJoinBNL (planLater(left), planLater(right), condition) :: Nil
42+ joins .LeftSemiJoinBNL (planLater(left), planLater(right), condition) :: Nil
4343 case _ => Nil
4444 }
4545 }
@@ -49,13 +49,13 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
4949 * evaluated by matching hash keys.
5050 *
5151 * This strategy applies a simple optimization based on the estimates of the physical sizes of
52- * the two join sides. When planning a [[join .BroadcastHashJoin ]], if one side has an
52+ * the two join sides. When planning a [[joins .BroadcastHashJoin ]], if one side has an
5353 * estimated physical size smaller than the user-settable threshold
5454 * [[org.apache.spark.sql.SQLConf.AUTO_BROADCASTJOIN_THRESHOLD ]], the planner would mark it as the
5555 * ''build'' relation and mark the other relation as the ''stream'' side. The build table will be
5656 * ''broadcasted'' to all of the executors involved in the join, as a
5757 * [[org.apache.spark.broadcast.Broadcast ]] object. If both estimates exceed the threshold, they
58- * will instead be used to decide the build side in a [[join .ShuffledHashJoin ]].
58+ * will instead be used to decide the build side in a [[joins .ShuffledHashJoin ]].
5959 */
6060 object HashJoin extends Strategy with PredicateHelper {
6161
@@ -65,8 +65,8 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
6565 left : LogicalPlan ,
6666 right : LogicalPlan ,
6767 condition : Option [Expression ],
68- side : join .BuildSide ) = {
69- val broadcastHashJoin = execution.join .BroadcastHashJoin (
68+ side : joins .BuildSide ) = {
69+ val broadcastHashJoin = execution.joins .BroadcastHashJoin (
7070 leftKeys, rightKeys, side, planLater(left), planLater(right))
7171 condition.map(Filter (_, broadcastHashJoin)).getOrElse(broadcastHashJoin) :: Nil
7272 }
@@ -75,26 +75,26 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
7575 case ExtractEquiJoinKeys (Inner , leftKeys, rightKeys, condition, left, right)
7676 if sqlContext.autoBroadcastJoinThreshold > 0 &&
7777 right.statistics.sizeInBytes <= sqlContext.autoBroadcastJoinThreshold =>
78- makeBroadcastHashJoin(leftKeys, rightKeys, left, right, condition, join .BuildRight )
78+ makeBroadcastHashJoin(leftKeys, rightKeys, left, right, condition, joins .BuildRight )
7979
8080 case ExtractEquiJoinKeys (Inner , leftKeys, rightKeys, condition, left, right)
8181 if sqlContext.autoBroadcastJoinThreshold > 0 &&
8282 left.statistics.sizeInBytes <= sqlContext.autoBroadcastJoinThreshold =>
83- makeBroadcastHashJoin(leftKeys, rightKeys, left, right, condition, join .BuildLeft )
83+ makeBroadcastHashJoin(leftKeys, rightKeys, left, right, condition, joins .BuildLeft )
8484
8585 case ExtractEquiJoinKeys (Inner , leftKeys, rightKeys, condition, left, right) =>
8686 val buildSide =
8787 if (right.statistics.sizeInBytes <= left.statistics.sizeInBytes) {
88- join .BuildRight
88+ joins .BuildRight
8989 } else {
90- join .BuildLeft
90+ joins .BuildLeft
9191 }
92- val hashJoin = join .ShuffledHashJoin (
92+ val hashJoin = joins .ShuffledHashJoin (
9393 leftKeys, rightKeys, buildSide, planLater(left), planLater(right))
9494 condition.map(Filter (_, hashJoin)).getOrElse(hashJoin) :: Nil
9595
9696 case ExtractEquiJoinKeys (joinType, leftKeys, rightKeys, condition, left, right) =>
97- join .HashOuterJoin (
97+ joins .HashOuterJoin (
9898 leftKeys, rightKeys, joinType, condition, planLater(left), planLater(right)) :: Nil
9999
100100 case _ => Nil
@@ -163,11 +163,11 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
163163 case logical.Join (left, right, joinType, condition) =>
164164 val buildSide =
165165 if (right.statistics.sizeInBytes <= left.statistics.sizeInBytes) {
166- join .BuildRight
166+ joins .BuildRight
167167 } else {
168- join .BuildLeft
168+ joins .BuildLeft
169169 }
170- join .BroadcastNestedLoopJoin (
170+ joins .BroadcastNestedLoopJoin (
171171 planLater(left), planLater(right), buildSide, joinType, condition) :: Nil
172172 case _ => Nil
173173 }
@@ -176,10 +176,10 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
176176 object CartesianProduct extends Strategy {
177177 def apply (plan : LogicalPlan ): Seq [SparkPlan ] = plan match {
178178 case logical.Join (left, right, _, None ) =>
179- execution.join .CartesianProduct (planLater(left), planLater(right)) :: Nil
179+ execution.joins .CartesianProduct (planLater(left), planLater(right)) :: Nil
180180 case logical.Join (left, right, Inner , Some (condition)) =>
181181 execution.Filter (condition,
182- execution.join .CartesianProduct (planLater(left), planLater(right))) :: Nil
182+ execution.joins .CartesianProduct (planLater(left), planLater(right))) :: Nil
183183 case _ => Nil
184184 }
185185 }
0 commit comments