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

Re: [PR] [SPARK-47657][SQL] Implement collation filter push down support per file source [spark]

cloud-fan commented on code in PR #45782:
URL: https://github.com/apache/spark/pull/45782#discussion_r1551349926


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceUtils.scala:
##########
@@ -284,12 +284,15 @@ object DataSourceUtils extends PredicateHelper {
    * Determines whether a filter should be pushed down to the data source or not.
    *
    * @param expression The filter expression to be evaluated.
+   * @param isCollationPushDownSupported Whether the data source supports collation push down.
    * @return A boolean indicating whether the filter should be pushed down or not.
    */
-  def shouldPushFilter(expression: Expression): Boolean = {
-    expression.deterministic && !expression.exists {
+  def shouldPushFilter(expression: Expression, isCollationPushDownSupported: Boolean): Boolean = {
+    if (!expression.deterministic) return false
+
+    isCollationPushDownSupported || !expression.exists {
       case childExpression @ (_: Attribute | _: GetStructField) =>
-        // don't push down filters for types with non-default collation
+        // don't push down filters for types with utf8 binary collation

Review Comment:
   non-binary-sortable?



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