PredicateHelper¶
isLikelySelective¶
isLikelySelective(
e: Expression): Boolean
isLikelySelective is true (enabled) for the following Expressions:
Notwith an Expression that is likely to be selectiveAndwith either Expression likely to be selectiveOrwith both Expressions likely to be selectiveStringRegexExpressionLikeRLike
BinaryComparisonEqualNullSafeEqualToGreaterThanGreaterThanOrEqualLessThanLessThanOrEqual
- In
- InSet
StringPredicateContainsEndsWithStartsWith
BinaryPredicateMultiLikeBaseLikeAllNotLikeAllLikeAnyNotLikeAny
isLikelySelective is used when:
InjectRuntimeFilterlogical optimization is requested to isSelectiveFilterOverScanPartitionPruninglogical 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)