gengliangwang commented on a change in pull request #29075: URL: https://github.com/apache/spark/pull/29075#discussion_r453409529
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PruneFileSourcePartitions.scala ########## @@ -53,11 +53,17 @@ private[sql] object PruneFileSourcePartitions val partitionColumns = relation.resolve(partitionSchema, sparkSession.sessionState.analyzer.resolver) val partitionSet = AttributeSet(partitionColumns) - val (partitionFilters, dataFilters) = normalizedFilters.partition(f => + val (partitionFilters, remainingFilters) = normalizedFilters.partition(f => f.references.subsetOf(partitionSet) ) - (ExpressionSet(partitionFilters), dataFilters) + // Try extracting more convertible partition filters from the remaining filters by converting + // them into CNF. + val remainingFilterInCnf = remainingFilters.flatMap(CNFConversion) + val extraPartitionFilters = + remainingFilterInCnf.filter(f => f.references.subsetOf(partitionSet)) + + (ExpressionSet(partitionFilters ++ extraPartitionFilters), remainingFilters) Review comment: In that way, `otherFilters` can be very long, which leads to a longer codegen... I am avoiding that on purpose. Let me add comment 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. 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