File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions
core/src/main/scala/org/apache/spark/sql/execution Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .sql .catalyst .expressions
1919
20- import org .apache .spark .sql .catalyst .trees
21- import org .apache .spark .sql .catalyst .errors .TreeNodeException
2220import org .apache .spark .sql .catalyst .analysis .UnresolvedException
23- import org .apache .spark .sql .catalyst .types .{BooleanType , StringType , TimestampType }
21+ import org .apache .spark .sql .catalyst .plans .logical .LogicalPlan
22+ import org .apache .spark .sql .catalyst .trees
23+ import org .apache .spark .sql .catalyst .types .BooleanType
24+
2425
2526object InterpretedPredicate {
2627 def apply (expression : Expression ): (Row => Boolean ) = {
@@ -37,10 +38,17 @@ trait Predicate extends Expression {
3738}
3839
3940trait PredicateHelper {
40- def splitConjunctivePredicates (condition : Expression ): Seq [Expression ] = condition match {
41+ protected def splitConjunctivePredicates (condition : Expression ): Seq [Expression ] = condition match {
4142 case And (cond1, cond2) => splitConjunctivePredicates(cond1) ++ splitConjunctivePredicates(cond2)
4243 case other => other :: Nil
4344 }
45+
46+ private def combineConjunctivePredicates (predicates : Seq [Expression ]) =
47+ predicates.reduceLeft(And )
48+
49+ /** Returns true if `expr` can be evaluated using only the output of `plan`. */
50+ protected def canEvaluate (expr : Expression , plan : LogicalPlan ): Boolean =
51+ expr.references subsetOf plan.outputSet
4452}
4553
4654abstract class BinaryPredicate extends BinaryExpression with Predicate {
Original file line number Diff line number Diff line change @@ -66,13 +66,6 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
6666 }
6767 case _ => Nil
6868 }
69-
70- private def combineConjunctivePredicates (predicates : Seq [Expression ]) =
71- predicates.reduceLeft(And )
72-
73- /** Returns true if `expr` can be evaluated using only the output of `plan`. */
74- protected def canEvaluate (expr : Expression , plan : LogicalPlan ): Boolean =
75- expr.references subsetOf plan.outputSet
7669 }
7770
7871 object PartialAggregation extends Strategy {
You can’t perform that action at this time.
0 commit comments