Skip to content

Commit afadc0e

Browse files
committed
add comments
1 parent 76f8fdc commit afadc0e

File tree

1 file changed

+8
-0
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+8
-0
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ trait PredicateHelper extends Logging {
201201
case e => e.children.forall(canEvaluateWithinJoin)
202202
}
203203

204+
/*
205+
* Returns a filter that it's output is a subset of `outputSet` and it contains all possible constraints
206+
* from `condition`. This is used for predicate pushdown.
207+
* When there is no such convertible filter, `None` is returned.
208+
*/
204209
protected def convertibleFilter(
205210
condition: Expression,
206211
outputSet: AttributeSet): Option[Expression] = condition match {
@@ -231,6 +236,9 @@ trait PredicateHelper extends Logging {
231236
rhs <- convertibleFilter(right, outputSet)
232237
} yield Or(lhs, rhs)
233238

239+
// Here we assume all the `Not` operators is already below all the `And` and `Or` operators
240+
// after the optimization rule `BooleanSimplification`, so that we don't need to handle the
241+
// `Not` operators here.
234242
case other =>
235243
if (other.references.subsetOf(outputSet)) {
236244
Some(other)

0 commit comments

Comments
 (0)