li-boxuan commented on code in PR #50949:
URL: https://github.com/apache/spark/pull/50949#discussion_r2098508968


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -48,8 +48,8 @@ case class BatchScanExec(
   // TODO: unify the equal/hashCode implementation for all data source v2 
query plans.
   override def equals(other: Any): Boolean = other match {
     case other: BatchScanExec =>
-      this.batch != null && this.batch == other.batch &&
-          this.runtimeFilters == other.runtimeFilters &&
+      this.getClass == other.getClass && this.batch != null &&

Review Comment:
   Even though this is a `case` class, there's no `final` modifier, making it 
still possible to be extended. It seems to me that we should either mark this 
class as final, or explicitly check class equivalence here to prevent misuse 
(like this PR), or remove this override completely, so that Scala compiler 
would automatically generate an equals method that does proper class 
equivalence check.



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

Reply via email to