cloud-fan commented on a change in pull request #35451:
URL: https://github.com/apache/spark/pull/35451#discussion_r803664923
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/dynamicpruning/CleanupDynamicPruningFilters.scala
##########
@@ -34,6 +34,32 @@ import
org.apache.spark.sql.execution.datasources.v2.DataSourceV2ScanRelation
*/
object CleanupDynamicPruningFilters extends Rule[LogicalPlan] with
PredicateHelper {
+ private def collectEqualityConditionExpressions(condition: Expression):
Seq[Expression] = {
+ splitConjunctivePredicates(condition).flatMap(_.collect {
+ case EqualTo(l, r) if l.deterministic && r.foldable => l
+ case EqualTo(l, r) if r.deterministic && l.foldable => r
+ case EqualNullSafe(l, r) if l.deterministic && r.foldable => l
+ case EqualNullSafe(l, r) if r.deterministic && l.foldable => r
+ })
+ }
+
+ /**
+ * Remove DynamicPruningSubquery if the pruning key has equality condition
Review comment:
let's add more comments to explain the rationale: If a partition key
already has equality conditions, then its DPP filter is useless and can't prune
anything.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]