You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/09 12:26:45 UTC

[GitHub] [spark] gengliangwang commented on a change in pull request #29831: [SPARK-32351][SQL] Show partially pushed down partition filters in explain()

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:
users@infra.apache.org



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