You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/16 09:13:08 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #31820: [SPARK-33482][SQL] Fix FileScan canonicalization

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala
##########
@@ -49,6 +49,15 @@ case class BatchScanExec(
   }
 
   override def doCanonicalize(): BatchScanExec = {
-    this.copy(output = output.map(QueryPlan.normalizeExpressions(_, output)))
+    val canonicalizedScan = scan match {
+      case s: FileScan =>
+        s.withFilters(
+          QueryPlan.normalizePredicates(s.partitionFilters, output),
+          QueryPlan.normalizePredicates(s.dataFilters, output))

Review comment:
       This works, but is a bit hacky as it doesn't apply to all the `Scan` implementations.
   
   I think we should add doc in the `Scan` interface to explain how the `hashCode/equals` should be implemented.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org