gengliangwang commented on a change in pull request #29831:
URL: https://github.com/apache/spark/pull/29831#discussion_r502391339



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala
##########
@@ -154,15 +154,8 @@ object FileSourceStrategy extends Strategy with 
PredicateHelper with Logging {
         l.resolve(
           fsRelation.partitionSchema, 
fsRelation.sparkSession.sessionState.analyzer.resolver)
       val partitionSet = AttributeSet(partitionColumns)
-      val partitionKeyFilters = if (partitionColumns.isEmpty) {
-        ExpressionSet(Nil)
-      } else {
-        val predicates = ExpressionSet(normalizedFilters
-          .filter(_.references.subsetOf(partitionSet)))
-        logInfo(s"Pruning directories with: ${predicates.mkString(",")}")
-        predicates
-      }
-
+      val partitionKeyFilters = 
DataSourceStrategy.getPushedDownFilters(partitionColumns,

Review comment:
       Nit: It would be better to add a comment saying that the 
`partitionKeyFilters`  here is the same as the filters used in the partition 
pruning rule `PruneFileSourcePartitions`. 




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



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

Reply via email to