gengliangwang commented on a change in pull request #24598: [SPARK-27699][SQL] 
Partially push down disjunctive predicated in Parquet/ORC
URL: https://github.com/apache/spark/pull/24598#discussion_r284777650
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala
 ##########
 @@ -46,25 +46,30 @@ object DataSourceV2Strategy extends Strategy with 
PredicateHelper {
       case r: SupportsPushDownFilters =>
         // A map from translated data source filters to original catalyst 
filter expressions.
         val translatedFilterToExpr = mutable.HashMap.empty[sources.Filter, 
Expression]
+        val translatedFilters = mutable.ArrayBuffer.empty[sources.Filter]
         // Catalyst filter expression that can't be translated to data source 
filters.
         val untranslatableExprs = mutable.ArrayBuffer.empty[Expression]
 
         for (filterExpr <- filters) {
-          val translated = DataSourceStrategy.translateFilter(filterExpr)
-          if (translated.isDefined) {
-            translatedFilterToExpr(translated.get) = filterExpr
-          } else {
+          val translated =
 
 Review comment:
   With partial filter push down in Or operator, the result of pushedFilters() 
might not exist in the mapping translatedFilterToExpr. To fix it, this PR 
changes the mapping translatedFilterToExpr as leaf filter expression to 
sources.filter, and later on rebuild the whole expression with the mapping.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to