Packages

object JoinSelection extends Strategy with PredicateHelper with JoinSelectionHelper

Select the proper physical plan for join based on join strategy hints, the availability of equi-join keys and the sizes of joining relations. Below are the existing join strategies, their characteristics and their limitations.

- Broadcast hash join (BHJ): Only supported for equi-joins, while the join keys do not need to be sortable. Supported for all join types except full outer joins. BHJ usually performs faster than the other join algorithms when the broadcast side is small. However, broadcasting tables is a network-intensive operation and it could cause OOM or perform badly in some cases, especially when the build/broadcast side is big.

- Shuffle hash join: Only supported for equi-joins, while the join keys do not need to be sortable. Supported for all join types. Building hash map from table is a memory-intensive operation and it could cause OOM when the build side is big.

- Shuffle sort merge join (SMJ): Only supported for equi-joins and the join keys have to be sortable. Supported for all join types.

- Broadcast nested loop join (BNLJ): Supports both equi-joins and non-equi-joins. Supports all the join types, but the implementation is optimized for: 1) broadcasting the left side in a right outer join; 2) broadcasting the right side in a left outer, left semi, left anti or existence join; 3) broadcasting either side in an inner-like join. For other cases, we need to scan the data multiple times, which can be rather slow.

- Shuffle-and-replicate nested loop join (a.k.a. cartesian product join): Supports both equi-joins and non-equi-joins. Supports only inner like joins.

Linear Supertypes
JoinSelectionHelper, PredicateHelper, AliasHelper, SparkStrategy, GenericStrategy[SparkPlan], Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JoinSelection
  2. JoinSelectionHelper
  3. PredicateHelper
  4. AliasHelper
  5. SparkStrategy
  6. GenericStrategy
  7. Logging
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(plan: LogicalPlan): Seq[SparkPlan]
    Definition Classes
    JoinSelection → GenericStrategy
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def buildBalancedPredicate(expressions: Seq[Expression], op: (Expression, Expression) => Expression): Expression
    Attributes
    protected
    Definition Classes
    PredicateHelper
  7. def canBroadcastBySize(plan: LogicalPlan, conf: SQLConf): Boolean
    Definition Classes
    JoinSelectionHelper
  8. def canBuildBroadcastLeft(joinType: JoinType): Boolean
    Definition Classes
    JoinSelectionHelper
  9. def canBuildBroadcastRight(joinType: JoinType): Boolean
    Definition Classes
    JoinSelectionHelper
  10. def canBuildShuffledHashJoinLeft(joinType: JoinType): Boolean
    Definition Classes
    JoinSelectionHelper
  11. def canBuildShuffledHashJoinRight(joinType: JoinType): Boolean
    Definition Classes
    JoinSelectionHelper
  12. def canEvaluate(expr: Expression, plan: LogicalPlan): Boolean
    Attributes
    protected
    Definition Classes
    PredicateHelper
  13. def canEvaluateWithinJoin(expr: Expression): Boolean
    Attributes
    protected
    Definition Classes
    PredicateHelper
  14. def canPlanAsBroadcastHashJoin(join: Join, conf: SQLConf): Boolean
    Definition Classes
    JoinSelectionHelper
  15. def canPruneLeft(joinType: JoinType): Boolean
    Definition Classes
    JoinSelectionHelper
  16. def canPruneRight(joinType: JoinType): Boolean
    Definition Classes
    JoinSelectionHelper
  17. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  20. def extractPredicatesWithinOutputSet(condition: Expression, outputSet: AttributeSet): Option[Expression]
    Attributes
    protected
    Definition Classes
    PredicateHelper
  21. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  22. def findExpressionAndTrackLineageDown(exp: Expression, plan: LogicalPlan): Option[(Expression, LogicalPlan)]
    Definition Classes
    PredicateHelper
  23. def getAliasMap(exprs: Seq[NamedExpression]): AttributeMap[Alias]
    Attributes
    protected
    Definition Classes
    AliasHelper
  24. def getAliasMap(plan: Aggregate): AttributeMap[Alias]
    Attributes
    protected
    Definition Classes
    AliasHelper
  25. def getAliasMap(plan: Project): AttributeMap[Alias]
    Attributes
    protected
    Definition Classes
    AliasHelper
  26. def getBroadcastBuildSide(left: LogicalPlan, right: LogicalPlan, joinType: JoinType, hint: JoinHint, hintOnly: Boolean, conf: SQLConf): Option[BuildSide]
    Definition Classes
    JoinSelectionHelper
  27. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. def getShuffleHashJoinBuildSide(left: LogicalPlan, right: LogicalPlan, joinType: JoinType, hint: JoinHint, hintOnly: Boolean, conf: SQLConf): Option[BuildSide]
    Definition Classes
    JoinSelectionHelper
  29. def getSmallerSide(left: LogicalPlan, right: LogicalPlan): BuildSide
    Definition Classes
    JoinSelectionHelper
  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def hintToBroadcastLeft(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  32. def hintToBroadcastRight(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  33. def hintToNotBroadcastLeft(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  34. def hintToNotBroadcastRight(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  35. def hintToPreferShuffleHashJoin(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  36. def hintToPreferShuffleHashJoinLeft(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  37. def hintToPreferShuffleHashJoinRight(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  38. def hintToShuffleHashJoin(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  39. def hintToShuffleHashJoinLeft(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  40. def hintToShuffleHashJoinRight(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  41. def hintToShuffleReplicateNL(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  42. def hintToSortMergeJoin(hint: JoinHint): Boolean
    Definition Classes
    JoinSelectionHelper
  43. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  44. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  45. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  46. def isLikelySelective(e: Expression): Boolean
    Definition Classes
    PredicateHelper
  47. def isNullIntolerant(expr: Expression): Boolean
    Attributes
    protected
    Definition Classes
    PredicateHelper
  48. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  49. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  50. def logDebug(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  51. def logDebug(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  52. def logError(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  53. def logError(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  54. def logInfo(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  55. def logInfo(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  56. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  57. def logTrace(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  58. def logTrace(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  59. def logWarning(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  60. def logWarning(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  61. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  62. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  63. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  64. def outputWithNullability(output: Seq[Attribute], nonNullAttrExprIds: Seq[ExprId]): Seq[Attribute]
    Attributes
    protected
    Definition Classes
    PredicateHelper
  65. def planLater(plan: LogicalPlan): SparkPlan
    Attributes
    protected
    Definition Classes
    SparkStrategy → GenericStrategy
  66. def replaceAlias(expr: Expression, aliasMap: AttributeMap[Alias]): Expression
    Attributes
    protected
    Definition Classes
    AliasHelper
  67. def replaceAliasButKeepName(expr: NamedExpression, aliasMap: AttributeMap[Alias]): NamedExpression
    Attributes
    protected
    Definition Classes
    AliasHelper
  68. def splitConjunctivePredicates(condition: Expression): Seq[Expression]
    Attributes
    protected
    Definition Classes
    PredicateHelper
  69. def splitDisjunctivePredicates(condition: Expression): Seq[Expression]
    Attributes
    protected
    Definition Classes
    PredicateHelper
  70. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  71. def toString(): String
    Definition Classes
    AnyRef → Any
  72. def trimAliases(e: Expression): Expression
    Attributes
    protected
    Definition Classes
    AliasHelper
  73. def trimNonTopLevelAliases[T <: Expression](e: T): T
    Attributes
    protected
    Definition Classes
    AliasHelper
  74. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  75. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  76. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from JoinSelectionHelper

Inherited from PredicateHelper

Inherited from AliasHelper

Inherited from SparkStrategy

Inherited from GenericStrategy[SparkPlan]

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped