aokolnychyi commented on a change in pull request #32921:
URL: https://github.com/apache/spark/pull/32921#discussion_r658934396



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/dynamicpruning/PartitionPruning.scala
##########
@@ -66,10 +71,33 @@ object PartitionPruning extends Rule[LogicalPlan] with 
PredicateHelper with Join
             }
           case _ => None
         }
+      case (resExp, r @ DataSourceV2ScanRelation(_, scan: 
SupportsDynamicFiltering, _)) =>
+        val filterAttrs = AttributeSet(resolveRefs(r, scan.filterAttributes))
+        if (resExp.references.subsetOf(filterAttrs)) {
+          Some(r)
+        } else {
+          None
+        }
       case _ => None
     }
   }
 
+  // TODO: is there a good place to put this?
+  private def resolveRefs(

Review comment:
       Created SPARK-35899, will submit a PR for that now.




-- 
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.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to