JoinSelection is a Strategy of SparkPlanner and Hive-specific QueryPlanner.

When applied to a LogicalPlan, its processing varies per join type.

Table 1. JoinSelection’s Cases
Name Behaviour


Used to destructure a Join


canBuildLocalHashMap Internal Method



ExtractEquiJoinKeys is a pattern used to destructure a Join into a tuple of (JoinType, Seq[Expression], Seq[Expression], Option[Expression], LogicalPlan, LogicalPlan).

canBuildRight Internal Method

canBuildRight(joinType: JoinType): Boolean

canBuildRight is a predicate that is positive (i.e. true) for joins that are:

  • "INNER", "CROSS", "LEFT OUTER", "LEFT SEMI", "LEFT ANTI" and a helper ExistenceJoin.

Otherwise, canBuildRight is negative (i.e. false).

Checking If Logical Plan Be Broadcast — canBroadcast Internal Method

canBroadcast(plan: LogicalPlan): Boolean

canBroadcast is a predicate that is positive (i.e. true) for logical operators with statistics that can be broadcast and of non-negative size that is however less than spark.sql.autoBroadcastJoinThreshold.

results matching ""

    No results matching ""