PredicateHelper¶
isLikelySelective¶
isLikelySelective(
e: Expression): Boolean
isLikelySelective
is true
(enabled) for the following Expressions:
Not
with an Expression that is likely to be selectiveAnd
with either Expression likely to be selectiveOr
with both Expressions likely to be selectiveStringRegexExpression
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:
InjectRuntimeFilter
logical optimization is requested to isSelectiveFilterOverScanPartitionPruning
logical optimization is requested to hasSelectivePredicate
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:
- InjectRuntimeFilter logical optimization is executed (to extractBeneficialFilterCreatePlan)
- PartitionPruning logical optimization is executed (to getFilterableTableScan)