Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/9634#discussion_r44610963
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
---
@@ -491,6 +493,9 @@ private[sql] object DataSourceStrategy extends Strategy
with Logging {
// Translated data source filters that can be handled by `relation`
val (_, handledFilters) = handled.unzip
- (unrecognizedPredicates ++ unhandledPredicates, handledFilters)
+ // translated contains all filters that have been converted to the
public Filter interface.
+ // We should always push them to the data source no matter whether the
data source can apply
+ // a filter to every row or not.
+ (unrecognizedPredicates ++ unhandledPredicates, translated.map(_._2))
--- End diff --
Would be nice to make `translated.map(_._2)` more explicit and readable as
follows, since this part is particularly tricky to understand:
```scala
// Translated data source filters, no matter `relation` can handle them or
not
val (_, translatedFilters) = translated.unzip
// ...
(unrecognizedPredicates ++ unhandledPredicates, translatedFilters)
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]