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 2022/02/09 15:35:13 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #35451: [SPARK-38148][SQL] Do not add dynamic partition pruning if there exists static partition pruning

cloud-fan commented on a change in pull request #35451:
URL: https://github.com/apache/spark/pull/35451#discussion_r802794715



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/dynamicpruning/PartitionPruning.scala
##########
@@ -229,6 +229,24 @@ object PartitionPruning extends Rule[LogicalPlan] with PredicateHelper {
     !plan.isStreaming && hasSelectivePredicate(plan)
   }
 
+  /**
+   * Check the partition has static filter. So we can skip add dynamic partition pruning
+   * if there already exists.
+   */
+  private def hasStaticPartitionEqualityCondition(e: Expression, p: LogicalPlan): Boolean = {
+    p.find {

Review comment:
       Shall we simply look at `LogicalPlan.constraints`? It's a bit risky to find a `Filter` in an arbitrary position.




-- 
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-unsubscribe@spark.apache.org

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