cloud-fan commented on code in PR #47313: URL: https://github.com/apache/spark/pull/47313#discussion_r1675480235
########## sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PruneFileSourcePartitions.scala: ########## @@ -63,7 +63,11 @@ private[sql] object PruneFileSourcePartitions extends Rule[LogicalPlan] { _)) if filters.nonEmpty && fsRelation.partitionSchema.nonEmpty => val normalizedFilters = DataSourceStrategy.normalizeExprs( - filters.filter(f => f.deterministic && !SubqueryExpression.hasSubquery(f)), + filters.filter { f => + f.deterministic && + !SubqueryExpression.hasSubquery(f) && + !f.exists(_.isInstanceOf[PythonUDF]) Review Comment: let's add code comments to explain that `PythonUDF` rewriting happens later so we have to exclude it here. -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org