cloud-fan commented on a change in pull request #29318:
URL: https://github.com/apache/spark/pull/29318#discussion_r463654043



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala
##########
@@ -608,12 +608,16 @@ case class FileSourceScanExec(
     new FileScanRDD(fsRelation.sparkSession, readFile, partitions)
   }
 
+  private def filterUnnecessaryPredicates(predicates: Seq[Expression]): 
Seq[Expression] = {
+    predicates.filterNot(_ == Literal.TrueLiteral)
+  }
+
   override def doCanonicalize(): FileSourceScanExec = {
     FileSourceScanExec(
       relation,
       output.map(QueryPlan.normalizeExpressions(_, output)),
       requiredSchema,
-      QueryPlan.normalizePredicates(partitionFilters, output),
+      
QueryPlan.normalizePredicates(filterUnnecessaryPredicates(partitionFilters), 
output),

Review comment:
       Ah I got it. Maybe one side has DPP and one side not.
   
    Can we filter out `DynamicPruningExpression(Literal.TrueLiteral)`? Then we 
don't need to change 
https://github.com/apache/spark/pull/29318/files#diff-6c00f36fadec282fce72ad39cfea51caL81
 and make this PR less risky.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to