You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhztheplayer (via GitHub)" <gi...@apache.org> on 2025/07/29 12:13:51 UTC
Re: [PR] [SPARK-52226] [SQL] Fix unusual equality checks in three operators [spark]
zhztheplayer commented on code in PR #50949:
URL: https://github.com/apache/spark/pull/50949#discussion_r2239609337
##########
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:
> Usually Scala case class should not be extended, so this class check is not needed.
@cloud-fan Perhaps we can set a rule in the Maven configuration to forbid case-class inheritance? With the help of a wartremover [wart](https://github.com/wartremover/wartremover-contrib?tab=readme-ov-file#caseclassinheritance) which was authored by me and recently added to the plugin.
In Gluten we used to occasionally receive PRs that unintentionally violated the rule. The violations may be missed out in code review easily.
--
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-unsubscribe@spark.apache.org
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