Skip to content

PredicateHelper

isLikelySelective

isLikelySelective(
  e: Expression): Boolean

isLikelySelective is true (enabled) for the following Expressions:

  • Not with an Expression that is likely to be selective
  • And with either Expression likely to be selective
  • Or with both Expressions likely to be selective
  • StringRegexExpression
    • Like
    • RLike
  • BinaryComparison
    • EqualNullSafe
    • EqualTo
    • GreaterThan
    • GreaterThanOrEqual
    • LessThan
    • LessThanOrEqual
  • In
  • InSet
  • StringPredicate
    • Contains
    • EndsWith
    • StartsWith
  • BinaryPredicate
  • MultiLikeBase
    • LikeAll
    • NotLikeAll
    • LikeAny
    • NotLikeAny

isLikelySelective is used when:

findExpressionAndTrackLineageDown

findExpressionAndTrackLineageDown(
  exp: Expression,
  plan: LogicalPlan): Option[(Expression, LogicalPlan)]

findExpressionAndTrackLineageDown returns None for no references in the given Expression.

For a Project logical operator, findExpressionAndTrackLineageDown...FIXME

For a Aggregate logical operator, findExpressionAndTrackLineageDown...FIXME

For any LeafNode logical operator with the output attributes being the superset of the references of the given Expression, findExpressionAndTrackLineageDown returns a pair of the Expression and the LeafNode.

For a Union logical operator, findExpressionAndTrackLineageDown...FIXME

For any other logical operator, findExpressionAndTrackLineageDown checks the child logical operator one by one, recursively, and only when the references of the given Expression are all among the output attributes of a child operator.


findExpressionAndTrackLineageDown is used when: