Skip to content

Commit b8cb843

Browse files
committed
add comment
1 parent 5f412bd commit b8cb843

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ object DataSourceStrategy {
516516
* Tries to translate a Catalyst [[Expression]] into data source [[Filter]].
517517
*
518518
* @param predicate The input [[Expression]] to be translated as [[Filter]]
519-
* @param translatedFilterToExpr Optional Mapping of all the leaf node filter expression to its
520-
* translated [[Filter]]. The map is used for rebuilding Expression
521-
* from [[Filter]]s.
519+
* @param translatedFilterToExpr An optional map from leaf node filter expressions to its
520+
* translated [[Filter]]. The map is used for rebuilding
521+
* [[Expression]] from [[Filter]].
522522
* @return a `Some[Filter]` if the input [[Expression]] is convertible, otherwise a `None`.
523523
*/
524524
protected[sql] def translateFilterWithMapping(

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ object DataSourceV2Strategy extends Strategy with PredicateHelper {
4444
filters: Seq[Expression]): (Seq[Expression], Seq[Expression]) = {
4545
scanBuilder match {
4646
case r: SupportsPushDownFilters =>
47-
// A map from translated data source filters to original catalyst filter expressions.
47+
// A map from translated data source leaf node filters to original catalyst filter
48+
// expressions. For a `And`/`Or` predicate, it is possible that the predicate is partially
49+
// pushed down. This map can used to construct a catalyst filter expression from the input
50+
// filter, or a superset(partial push down filter) of the input filter.
4851
val translatedFilterToExpr = mutable.HashMap.empty[sources.Filter, Expression]
4952
val translatedFilters = mutable.ArrayBuffer.empty[sources.Filter]
5053
// Catalyst filter expression that can't be translated to data source filters.

0 commit comments

Comments
 (0)