li-boxuan commented on code in PR #49153:
URL: https://github.com/apache/spark/pull/49153#discussion_r2098496175
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/InMemoryBaseTable.scala:
##########
@@ -491,6 +492,16 @@ abstract class InMemoryBaseTable(
}
}
}
+
+ override def equals(other: Any): Boolean = other match {
+ case imbs: InMemoryBatchScan => this.readSchema == imbs.readSchema &&
Review Comment:
> that would be possible only in those cases where the Spark Operator
classes are not case classes (& there are only some exceptions) and case
classes cannot get extended , right?
Aha, thanks. I am new to scala and didn't notice the difference between case
classes and normal classes. You are right, this is a case class, which
presumably shouldn't be extended - even though Scala compiler doesn't prohibit
you from doing that. Gluten as a downstream application uses a plugin to
explicitly prohibit that behavior, so we are good. Not an issue then. I saw an
issue with some other classes, but it didn't happen with case class (thanks to
the plugin).
That being said, it's probably safe to add such a check, because after all,
Scala doesn't prohibit one from (wrongly) inheriting case classes. But anyways,
not an issue for my use case.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]