You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "milastdbx (via GitHub)" <gi...@apache.org> on 2024/01/04 09:24:03 UTC

Re: [PR] Collations proof of concept [spark]

milastdbx commented on code in PR #44537:
URL: https://github.com/apache/spark/pull/44537#discussion_r1441518135


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/dynamicpruning/PartitionPruning.scala:
##########
@@ -207,14 +208,20 @@ object PartitionPruning extends Rule[LogicalPlan] with PredicateHelper with Join
     }
   }
 
+  private def hasNoCollations(plan: LogicalPlan): Boolean = {
+    // TODO: Should be more selective here.
+    // Don't fully understand this code path.
+    !plan.expressions.exists(e => e.dataType.isInstanceOf[CollatedStringType])
+  }
+
   /**
    * To be able to prune partitions on a join key, the filtering side needs to
    * meet the following requirements:
    *   (1) it can not be a stream
    *   (2) it needs to contain a selective predicate used for filtering
    */
   private def hasPartitionPruningFilter(plan: LogicalPlan): Boolean = {
-    !plan.isStreaming && hasSelectivePredicate(plan)
+    !plan.isStreaming && hasSelectivePredicate(plan) && hasNoCollations(plan)

Review Comment:
   Was your intention to disable pruning altogether ?
   
   This pruning is just for dynamic pruning.
   
   There is also pruning happening during file listing in both static analysis and scan phy nodes



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